မီႇတီႇယႃႇဝီႇၶီႇ:Gadget-MapFrame.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 ၼၼ်ႉလႄႈ။
/* Usage: inserts an iframe into a div with id "mapdiv", in conjunction with Template:MapFrame
for embeddable dynamic maps. Relies on HTML5 data parameters. */
function insertIFrame() {
var exhtml = '//tools.wmflabs.org/wikivoyage/w/poimap2.php?';
// hide the map iframe by default - only show if gadget is enabled
$('#mapwrap').show();
var map = $('#mapdiv');
if ( map.length ) {
validateMap(map);
var exsrc = exhtml+'lat='+encodeURIComponent(map.data("lat"))+'&lon='+encodeURIComponent(map.data("long"))
+'&zoom='+encodeURIComponent(map.data("zoom"))+'&layer='+encodeURIComponent(map.data("layer"))+'&lang='+encodeURIComponent(mw.config.get('wgContentLanguage'))+'&name='+encodeURIComponent(mw.config.get('wgPageName'));
var ifstr = $( '<iframe></iframe>' ).attr( { src: exsrc, width: map.data("width"), height: map.data("height" ), style: "border:0" } );
map.html(ifstr);
if ( map.data("layer").indexOf('M') < 0 ) {
$('.vcard a').attr('href', function () { return this.href.replace('layer=M','layer='+map.data("layer")[0]) });
}
}
}
function validateMap(map) {
if (!$.isNumeric(map.data("lat"))) map.data("lat", 51.47766);
if (!$.isNumeric(map.data("long"))) map.data("long", -0.00115);
if (!$.isNumeric(map.data("zoom")) && map.data("zoom") != 'auto') map.data("zoom", 14);
if (!$.isNumeric(map.data("height"))) map.data("height", 420);
if (!$.isNumeric(map.data("width"))) map.data("width", 420);
if (map.data("layer").length > 8) map.data("layer", 'M');
}
jQuery(document).ready(insertIFrame);