Jump to content

မီႇတီႇယႃႇဝီႇၶီႇ:GeoHack.js

လုၵ်ႉတီႈ ဝီႇၶီႇၽီးတီးယႃး ဢၼ်လွတ်ႈလႅဝ်းထၢင်ႇႁၢင်ႈ ၼၼ်ႉမႃး

မၢႆတွင်း: ဝၢႆးသေသိမ်းပၼ်ယဝ်ႉ၊ တွၼ်ႈတႃႇ ၸဝ်ႈၵဝ်ႇ တေႁၼ်လႆႈ လွင်ႈလႅၵ်ႈလၢႆႈၼၼ်ႉ ၸဝ်ႈၵဝ်ႇတေၸၢင်ႈလႆႈလတ်းၶၢမ်ႈ ၶႅတ်ႉၶျ် တူဝ်ပိုတ်ႇဝႅပ်ႉၸဝ်ႈၵဝ်ႇယဝ်ႉ။

  • ၽွင်းမိူဝ်ႈတိုၵ်ႉၼဵၵ်း Reload တီႈ Firefox / Safari: ၼၼ်ႉ ၼဵၵ်းဝႆႉပႃး Shift ၊ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5 ဢမ်ႇၼၼ် Ctrl-R (တီႈၼႂ်း Mac ၼႆ ၼဵၵ်းပၼ်⌘-R)
  • တီႈၼႂ်း Google Chrome: ၼဵၵ်းပၼ် Ctrl-Shift-R (တီႈၼႂ်း Mac ၼႆႉ ၼဵၵ်းပၼ်⌘-Shift-R )
  • ၽွင်းမိူဝ်ႈ တိုၵ်ႉၼဵၵ်း Refreshတီႈ Internet Explorer/ Edge: ၼဵၵ်းဝႆႉပၼ် Ctrl ဢမ်ႇၼၼ် ၼဵၵ်းပၼ် Ctrl-F5
  • တီႈၼႂ်း Opera: ၵႂႃႇၸူးတီႈ Menu → Settings (ပေႃးပဵၼ်တီႈၼႂ်း Mac ၸိုင် Opera → Preferences ) သေ သိုပ်ႇၵႂႃႇ Privacy & security → Clear browsing data → Cached images and files ၼၼ်ႉလႄႈ။
/**
 * The file is used by GeoHack on Tool Labs (linked from [[Template:GeoTemplate]]).
 *
 * This file is not loaded within a wiki context. Standard libraries (jQuery, mediawiki.js etc) are not available.
 */
 
/**
 * Copy of standard library function
 */
function appendCSS(text) {
	var s = document.createElement('style');
	s.type = 'text/css';
	s.rel = 'stylesheet';
	if (s.styleSheet) s.styleSheet.cssText = text //IE
	else s.appendChild(document.createTextNode(text + '')) //Safari sometimes borks on null
	document.getElementsByTagName('head')[0].appendChild(s);
}


window.onload = function() {
	/* Add row hover effect */
	appendCSS(".directory tr:hover {background:#fdc !important;}");
}

var head  = document.getElementsByTagName('head')[0];
var style  = document.createElement('link');
style.rel  = 'stylesheet';
style.type = 'text/css';
style.href = '//maps.wikimedia.org/leaflet/leaflet.css';
head.appendChild(style);

var script  = document.createElement('script');
script.type = 'text/javascript';
script.src = '//maps.wikimedia.org/leaflet/leaflet.js';
head.appendChild(script);
	    
var OSM_class_R = /\bOSM:([\d.+-]+)_([\d.+-]+)_([\d.+-]+)_(\w+)/;
function embedOpenStreetMap() {
    clearInterval(osmtimer);
    var osmTarget = document.getElementById('osmEmbed');
    if (osmTarget && OSM_class_R.exec(osmTarget.className)) {
        var lat = 1.0 * RegExp.$1,
        	lon = 1.0 * RegExp.$2,
        	zoom = RegExp.$3;
        	
	    var map = L.map('osmEmbed').setView([lat, lon], zoom);
	    map.attributionControl.setPrefix( '' );
		L.tileLayer('//maps.wikimedia.org/osm-intl/{z}/{x}/{y}{r}.png', {
		    attribution: 'Wikimedia maps beta | Map data &copy; <a href="http://osm.org/copyright">OpenStreetMap contributors</a>'
		}).addTo(map);
		
		L.marker([lat, lon]).addTo(map);
    }
}

osmtimer = setInterval("if (document.getElementById('osmEmbed') && L) { embedOpenStreetMap(); }", 200);
setTimeout('clearInterval(osmtimer)', 5000);