Add map.getMapBaseLayer()

This commit is contained in:
Anton Khorev 2024-12-10 00:31:59 +03:00
parent de0bf25499
commit 2c84465cc2

View file

@ -130,11 +130,14 @@ L.OSM.Map = L.Map.extend({
},
getMapBaseLayerId: function () {
var baseLayerId;
this.eachLayer(function (layer) {
if (layer.options && layer.options.layerId) baseLayerId = layer.options.layerId;
});
return baseLayerId;
const layer = this.getMapBaseLayer();
if (layer) return layer.options.layerId;
},
getMapBaseLayer: function () {
for (const layer of this.baseLayers) {
if (this.hasLayer(layer)) return layer;
}
},
getUrl: function (marker) {