coverage map zoom
let coverageMap;
let leafletMarkers;
let allOverlays = [];
+const coverageMapMaxZoom = 18;
$(document).ready(function () {
// Draw marker on text change
@@ -184,7 +185,7 @@ function initMap() {
{
attribution:
'Map tiles by <a href="http://stamen.com" target="_blank">Stamen Design</a>, under <a href="http://creativecommons.org/licenses/by/3.0" target="_blank">CC BY 3.0</a>. Data by <a href="http://openstreetmap.org" target="_blank">OpenStreetMap</a>, under <a href="http://www.openstreetmap.org/copyright" target="_blank">ODbL</a>.',
- maxZoom: 18,
+ maxZoom: coverageMapMaxZoom,
}
);
@@ -193,14 +194,14 @@ function initMap() {
{
attribution:
'Map data &copy; <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap</a> contributors',
- maxZoom: 18,
+ maxZoom: coverageMapMaxZoom,
}
);
const googleSat = L.tileLayer(
"http://{s}.google.com/vt/lyrs=s&x={x}&y={y}&z={z}",
{
- maxZoom: 20,
+ maxZoom: coverageMapMaxZoom,
subdomains: ["mt0", "mt1", "mt2", "mt3"],
}
);
@@ -316,7 +317,7 @@ function initMap() {
L.DomEvent.on(recenterButton, "click", (e) => {
e.stopPropagation();
try {
- coverageMap.fitBounds(leafletMarkers.getBounds(), { maxZoom: 7 });
+ coverageMap.fitBounds(leafletMarkers.getBounds(), { maxZoom: coverageMapMaxZoom });
} catch (error) {
coverageMap.setView([30, 0], 1);
}
@@ -387,7 +388,7 @@ function drawMarker(latLng) {
marker.addTo(coverageMap);
// Center map at new marker
- coverageMap.fitBounds(leafletMarkers.getBounds(), { maxZoom: 7 });
+ coverageMap.fitBounds(leafletMarkers.getBounds(), { maxZoom: coverageMapMaxZoom });
}
function drawRectangleOnTextChange() {
@@ -452,7 +453,7 @@ function drawRectangle(bounds) {
leafletMarkers.addLayer(rectangle);
rectangle.addTo(coverageMap);
- coverageMap.fitBounds(rectangle.getBounds(), { maxZoom: 7 });
+ coverageMap.fitBounds(rectangle.getBounds(), { maxZoom: coverageMapMaxZoom });
}
function processDrawing(coordinates, shape) {
