Letecké mapy.
parent
7993e3fb50
commit
1a7f236e9b
|
|
@ -5,6 +5,11 @@ var mapyCZ = L.tileLayer(`https://api.mapy.cz/v1/maptiles/basic/256/{z}/{x}/{y}?
|
||||||
maxZoom: 19,
|
maxZoom: 19,
|
||||||
attribution: '<a href="https://api.mapy.cz/copyright" target="_blank">© Seznam.cz a.s. a další</a>',
|
attribution: '<a href="https://api.mapy.cz/copyright" target="_blank">© Seznam.cz a.s. a další</a>',
|
||||||
})
|
})
|
||||||
|
var mapyCZletecka = L.tileLayer(`https://api.mapy.cz/v1/maptiles/aerial/256/{z}/{x}/{y}?apikey=${API_KEY}`, {
|
||||||
|
minZoom: 0,
|
||||||
|
maxZoom: 19,
|
||||||
|
attribution: '<a href="https://api.mapy.cz/copyright" target="_blank">© Seznam.cz a.s. a další</a>',
|
||||||
|
})
|
||||||
/*
|
/*
|
||||||
We also require you to include our logo somewhere over the map.
|
We also require you to include our logo somewhere over the map.
|
||||||
We create our own map control implementing a documented interface,
|
We create our own map control implementing a documented interface,
|
||||||
|
|
@ -28,29 +33,31 @@ const LogoControl = L.Control.extend({
|
||||||
return container;
|
return container;
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
// OpenStreetMap:
|
|
||||||
|
// OpenStreetMap - base:
|
||||||
var osm = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
var osm = L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||||
maxZoom: 19,
|
maxZoom: 19,
|
||||||
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
attribution: '© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>'
|
||||||
})
|
})
|
||||||
|
|
||||||
// Výchozí bod:
|
// Výchozí bod + podkladové mapy:
|
||||||
var map = L.map('map', {
|
var map = L.map('map', {
|
||||||
center: [50.853501146, 14.8425], // Hrádek
|
center: [50.853501146, 14.8425], // Hrádek
|
||||||
zoom: 16,
|
zoom: 16,
|
||||||
layers: [mapyCZ, osm]
|
layers: [mapyCZ, mapyCZletecka, osm]
|
||||||
});
|
});
|
||||||
|
|
||||||
// Rámeček s výběrem podkladů:
|
// Rámeček s výběrem podkladů:
|
||||||
var baseMaps = {
|
var baseMaps = {
|
||||||
"<span style='color: blue'>Mapy.cz</span>": mapyCZ,
|
"<span style='color: blue'>Mapy.cz</span>": mapyCZ,
|
||||||
|
"Mapy.cz (letecká)": mapyCZletecka,
|
||||||
"OpenStreetMap": osm
|
"OpenStreetMap": osm
|
||||||
};
|
};
|
||||||
var layerControl = L.control.layers(baseMaps).addTo(map);
|
var layerControl = L.control.layers(baseMaps).addTo(map);
|
||||||
|
|
||||||
// finally we add our LogoControl to the map
|
// finally we add our LogoControl to the map
|
||||||
new LogoControl().addTo(map, {
|
new LogoControl().addTo(map, {
|
||||||
layers: [osm, mapyCZ]
|
layers: [mapyCZ, mapyCZletecka]
|
||||||
});
|
});
|
||||||
|
|
||||||
// futury:
|
// futury:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue