Difference between revisions of "Test"
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
var map = L.map('map').setView([10, 5], 5); | var map = L.map('map').setView([10, 5], 5); | ||
+ | // load a tile layer | ||
var topo=new L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{ | var topo=new L.tileLayer('http://{s}.tile.opentopomap.org/{z}/{x}/{y}.png',{ | ||
attribution: '© <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map); | attribution: '© <a href="http://osm.org/copyright">OpenTopoMap</a> contributors'}).addTo(map); | ||
Line 24: | Line 25: | ||
attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map); | attribution: '© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'}).addTo(map); | ||
− | + | // load GeoJSON from an external file | |
− | + | $.getJSON("REFUGIA_MALEY96.geojson",function(data){ | |
// add GeoJSON layer to the map once the file is loaded | // add GeoJSON layer to the map once the file is loaded | ||
L.geoJson(data).addTo(map); | L.geoJson(data).addTo(map); | ||
− | }); | + | }); |
− | + | ||
+ | |||
+ | // for Layer Control | ||
var baseMaps = { | var baseMaps = { | ||
"Open Street Map": osm, | "Open Street Map": osm, |
Revision as of 08:41, 25 February 2022