CINXE.COM
Mapy.cz
<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Mapy.cz</title> <script type="text/javascript" src="https://api.mapy.cz/loader.js"></script> <script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script> <script type="text/javascript"> Loader.load(); </script> <script type="text/javascript"> $(document).ready(function() { var center = SMap.Coords.fromWGS84(14.400307, 50.071853); var m = new SMap(JAK.gel("m"), center, 5); m.addDefaultLayer(SMap.DEF_TURIST).enable(); m.addDefaultControls(); var getUrlParameter = function getUrlParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'), sParameterName, i; for (i = 0; i < sURLVariables.length; i++) { sParameterName = sURLVariables[i].split('='); if (sParameterName[0] === sParam) { return sParameterName[1] === undefined ? true : decodeURIComponent(sParameterName[1]); } } }; var kml_file = ''; var kml_page = ''; var project = ''; if (getUrlParameter('article')) { var article = getUrlParameter('article'); if (getUrlParameter('project')) { project = getUrlParameter('project'); } else { project = 'cs'; } kml_file = 'https://kmlexport.toolforge.org/?project=' + project + '&article=' + article; if (getUrlParameter('linksfrom')) { kml_file += '&linksfrom=' + getUrlParameter('linksfrom'); } if (getUrlParameter('l')) { kml_file += '&l=' + getUrlParameter('l'); } if (getUrlParameter('section')) { kml_file += '§ion=' + getUrlParameter('section'); } } else if (getUrlParameter('kml')) { kml_file = getUrlParameter('kml'); if (kml_file.indexOf('.wikipedia.org') >= 0) { project = kml_file.match(/^(?:(?:https?:|)\/\/|)([^\.]+)\..*/)[1]; kml_page = kml_file.replace(/^((https?:)?\/\/)?[^\.]+?\.wikipedia\.org(\/wiki\/|\/?\?w\=)/, ''); kml_page = kml_page.replace(/[\?\&]action.*/, ''); kml_file = ''; } } if (kml_file) { $.get(kml_file, function(kml_text) { kml_text = kml_text.trim(); var xmlDoc = JAK.XML.createDocument(kml_text); var kml = new SMap.Layer.KML(xmlDoc, null, { maxPoints: 500 }); /* KML vrstva */ m.addLayer(kml); /* Přidáme ji do mapy */ kml.enable(); /* Zapnout vrstvu */ kml.fit(); /* Nastavit mapu tak, aby byla KML trasa dobře vidět */ }, 'text'); } else if (kml_page) { $.ajax({ url: 'https://' + project + '.wikipedia.org/w/api.php?action=query&origin=*&titles=' + kml_page + '&prop=revisions&rvprop=content&format=json&formatversion=2', dataType: 'json', type: 'POST', success: function(json_content) { var kml_text = json_content.query.pages[0].revisions[0].content; kml_text = kml_text.trim(); var xmlDoc = JAK.XML.createDocument(kml_text); var kml = new SMap.Layer.KML(xmlDoc, null, { maxPoints: 500 }); /* KML vrstva */ m.addLayer(kml); /* Přidáme ji do mapy */ kml.enable(); /* Zapnout vrstvu */ kml.fit(); /* Nastavit mapu tak, aby byla KML trasa dobře vidět */ } }); } else { $('#m').hide(); $('#p').show(); } }); </script> </head> <body id="advanced-markers" style="margin:0"> <div id="m" style="position:absolute; width:100%; height:100%"></div> <div id="p" style="display:none"> <pre> mapycz shows a map of geographical coordinates in a wiki page or an attached KML file. Usage: mapycz?article=Article (Czech Wikipedia) mapycz?project=project&article=Article (others) mapycz?kml=url_of_kml_file Optional parameters: linksfrom=1 – Return the coordinates on the pages linked from the given page in addition to its own coordinates l=0,1,2,3,... – Category recursion, where 0 means unlimited section=Name – Only parse a single named section of the article Note: This tool uses the kmlexport tool to extract coordinates from the given page. See also:</pre> <ul style="font-size:.9em"> <li><a href="https://bing-maps.toolforge.org/">Bing Maps tool</a></li> <li><a href="https://osm4wiki.toolforge.org/cgi-bin/wiki/wiki-osm.pl">OpenStreetMaps tool</a> by Plenz</li> </ul> </div> </body> </html>