@@ -119,11 +119,13 @@ export var MapMLLayer = L.Layer.extend({
119119 extentEl : extentEl . _DOMnode || extentEl
120120 } ) . addTo ( this . _map ) ;
121121 extentEl . templatedLayer . setZIndex ( ) ;
122+ this . _setLayerElExtent ( ) ;
122123 }
123124 } else {
124125 L . DomEvent . stopPropagation ( e ) ;
125126 extentEl . checked = false ;
126127 if ( this . _layerEl . checked ) this . _map . removeLayer ( extentEl . templatedLayer ) ;
128+ this . _setLayerElExtent ( ) ;
127129 }
128130 } ,
129131 titleIsReadOnly ( ) {
@@ -185,6 +187,7 @@ export var MapMLLayer = L.Layer.extend({
185187 this
186188 ) ;
187189 }
190+ this . _setLayerElExtent ( ) ;
188191
189192 this . setZIndex ( this . options . zIndex ) ;
190193 this . getPane ( ) . appendChild ( this . _container ) ;
@@ -258,7 +261,7 @@ export var MapMLLayer = L.Layer.extend({
258261 } ,
259262
260263 //sets the <layer-> elements .bounds property
261- _getExtent : function ( ) {
264+ _setLayerElExtent : function ( ) {
262265 let bounds ,
263266 zoomMax ,
264267 zoomMin ,
@@ -402,7 +405,8 @@ export var MapMLLayer = L.Layer.extend({
402405 }
403406 } ) ;
404407 if ( bounds ) {
405- return Object . assign (
408+ //assigns the formatted extent object to .extent and spreads the zoom ranges to .extent also
409+ this . _layerEl . extent = Object . assign (
406410 M . _convertAndFormatPCRS ( bounds , this . _properties . crs ) ,
407411 { zoom : zoomBounds , projection : this . _properties . projection }
408412 ) ;
0 commit comments