Repositorio para la herramienta Tupale completo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.1KB

  1. <html>
  2. <head>
  3. <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.css"/>
  4. <script src="http://cdn.leafletjs.com/leaflet-0.7.3/leaflet.js"></script>
  5. <script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
  6. <script src="librerias/leaflet/leaflet-providers.js"></script>
  7. </head>
  8. <body>
  9. <div id="map" style="width: 100%; height: 300px;"></div>
  10. <script type="text/javascript">
  11. var map = L.map('map');
  12. var terrainTiles = L.tileLayer.provider('OpenStreetMap.Mapnik');
  13. terrainTiles.addTo(map);
  14. map.setView([4, -72], 3);
  15. function addDataToMap(data, map) {
  16. var dataLayer = L.geoJson(data, {
  17. onEachFeature: function(feature, layer) {
  18. var popupText = "Titulo: " + feature.properties.name
  19. + "<br>Location: " + feature.properties.coordinates
  20. + "<br><a href='" + feature.properties.title + "'>More info</a>";
  21. layer.bindPopup(popupText); }
  22. });
  23. dataLayer.addTo(map);
  24. }
  25. $.getJSON("https://www.kleper.net/wiki/lib/exe/fetch.php/ruta_paz_territorial.geojson", function(data) { addDataToMap(data, map); });
  26. </script>
  27. </body>
  28. </html>