Skip to content

Commit 0f1549e

Browse files
committed
make the only layer match the map max/min_zoom
1 parent 295c408 commit 0f1549e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

leaflet/static/leaflet/leaflet.extras.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,11 @@ L.Map.DjangoMap = L.Map.extend({
105105

106106
if (layers.length == 1) {
107107
var layer = l2d(layers[0]);
108+
// make the only layer match the map max/min_zoom
109+
layer.options = L.Util.extend(layer.options, {
110+
'minZoom': this.options['minZoom'],
111+
'maxZoom': this.options['maxZoom']
112+
});
108113
L.tileLayer(layer.url, layer.options).addTo(this);
109114
return;
110115
}

0 commit comments

Comments
 (0)