Guest User

Untitled

a guest
Dec 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>A Cyprus map!</title>
  4. <link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.4/dist/leaflet.css" />
  5. <script src="https://unpkg.com/leaflet@1.3.4/dist/leaflet.js"></script>
  6. <script src="jquery-2.2.4.min.js"></script>
  7. <style>
  8. #map{ height: 100% }
  9. </style>
  10. </head>
  11. <body>
  12.  
  13. <div id="map"></div>
  14.  
  15. <script>
  16.  
  17. // initialize the map
  18. var map = L.map('map').setView([35.170582481889134, 33.42520000000002],9);
  19.  
  20. // load a tile layer
  21. L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png',
  22. {
  23. attribution: 'by <a href="http://www.acgoldman.com/">Goldman solutions & services</a>, Data by <a href="http://www.opencartography.com">Open Cartography</a>',
  24. maxZoom: 17,
  25. minZoom: 9
  26. }).addTo(map);
  27.  
  28. // loading GeoJSON file - Here my html and PicnicSites.geojson file resides in same folder
  29. $.getJSON("PicnicSites.geojson",function(data){
  30. // L.geoJson function is used to parse geojson file and load on to map
  31. L.geoJson(data).addTo(map);
  32. });
  33.  
  34. </script>
  35. </body>
  36. </html>
  37.  
  38. $ is not defined
  39.  
  40. <script src="https://unpkg.com/jquery@2.2.4/dist/jquery.min.js"></script>
Add Comment
Please, Sign In to add comment