@@ -79,7 +79,7 @@ export class MapFeature extends HTMLElement {
7979 this . _removeInFeatureList ( oldValue ) ;
8080 let native = this . _getNativeZoomAndCS ( layer . _content ) ;
8181 mapmlvectors . zoomBounds = M . getZoomBounds (
82- layerEl . shadowRoot || layerEl ,
82+ layer . _content ,
8383 native . zoom
8484 ) ;
8585 }
@@ -160,7 +160,7 @@ export class MapFeature extends HTMLElement {
160160 let container = this . _layer . shadowRoot || this . _layer . _layerEl ;
161161 // update zoom bounds of vector layer
162162 mapmlvectors . zoomBounds = M . getZoomBounds (
163- container ,
163+ this . _layer . _content ,
164164 this . _getNativeZoomAndCS ( this . _layer . _content ) . zoom
165165 ) ;
166166 }
@@ -216,18 +216,20 @@ export class MapFeature extends HTMLElement {
216216 // if the <layer- > is not removed, then regenerate featureGroup and update the mapmlvectors accordingly
217217 let native = this . _getNativeZoomAndCS ( this . _layer . _content ) ;
218218 this . _featureGroup = mapmlvectors . addData ( this , native . cs , native . zoom ) ;
219- this . _layer . _setLayerElExtent ( ) ;
220219 mapmlvectors . _layers [ this . _featureGroup . _leaflet_id ] = this . _featureGroup ;
221220 this . _groupEl = this . _featureGroup . options . group ;
222221 if ( mapmlvectors . _staticFeature ) {
223222 let container = this . _layer . shadowRoot || this . _layer . _layerEl ;
224223 // update zoom bounds of vector layer
225224 mapmlvectors . zoomBounds = M . getZoomBounds (
226- container ,
225+ this . _layer . _content ,
227226 this . _getNativeZoomAndCS ( this . _layer . _content ) . zoom
228227 ) ;
228+ // update layer bounds of vector layer
229+ mapmlvectors . layerBounds = M . getBounds ( this . _layer . _content ) ;
229230 // add feature layers to map
230231 mapmlvectors . _resetFeatures ( ) ;
232+ this . _layer . _setLayerElExtent ( ) ;
231233 // update map's zoom limit
232234 this . _map . _addZoomLimit ( mapmlvectors ) ;
233235 L . extend ( mapmlvectors . options , mapmlvectors . zoomBounds ) ;
0 commit comments