More general handling of zoom levels

This commit is contained in:
Davide Passoni
2024-02-29 17:22:29 +01:00
parent 4401261446
commit 2118ded496

View File

@@ -283,21 +283,11 @@ export class Map extends L.Map {
const layerData = this.#mapLayers[layerName];
if (layerData instanceof Array) {
let layers = layerData.map((layer: any) => {
var options: L.TileLayerOptions = {
attribution: layer.attribution,
minZoom: layer.minZoom,
maxZoom: layer.maxZoom
};
return new L.TileLayer(layer.urlTemplate, options);
return new L.TileLayer(layer.urlTemplate, layer);
})
this.#layer = new L.LayerGroup(layers);
} else {
var options: L.TileLayerOptions = {
attribution: layerData.attribution,
minZoom: layerData.minZoom,
maxZoom: layerData.maxZoom
};
this.#layer = new L.TileLayer(layerData.urlTemplate, options);
this.#layer = new L.TileLayer(layerData.urlTemplate, layerData);
}
}