Add adjustable maxzoom level, expand documentation

This commit is contained in:
Antonia 2024-09-13 22:34:50 +02:00
parent 92cf623f93
commit d35d3df5ec
3 changed files with 50 additions and 11 deletions

View file

@ -11,15 +11,6 @@ legend.onAdd = function (map) {
};
var strecken = protomapsL.leafletLayer({
url: "strecken.pmtiles",
maxDataZoom: 10,
maxZoom: 19,
paintRules: rules,
});
const map = L.map("map", { center: [52,13], zoom: 3, minZoom: 0 });
fetch("layers.json")
.then((response) => response.json())
@ -40,7 +31,14 @@ fetch("layers.json")
maxZoom: 19,
attribution: tiles["attribution"]
}
)
);
var strecken = protomapsL.leafletLayer({
url: "strecken.pmtiles",
maxDataZoom: data["maxZoom"] ?? 10,
maxZoom: 19,
paintRules: rules,
});
osm.addTo(map);
legend.addTo(map);
strecken.addTo(map);