File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -168,6 +168,8 @@ export var FeatureLayer = L.FeatureGroup.extend({
168168 this . _resetFeatures ( ) ;
169169 } ,
170170
171+ // remove or add features based on the min max attribute of the features,
172+ // and add placeholders to maintain position
171173 _resetFeatures : function ( ) {
172174 // since features are removed and re-added by zoom level, need to clean the feature index before re-adding
173175 if ( this . _map ) this . _map . featureIndex . cleanIndex ( ) ;
@@ -190,7 +192,11 @@ export var FeatureLayer = L.FeatureGroup.extend({
190192 ) ;
191193 // removing the rendering without removing the feature from the feature list
192194 this . removeLayer ( featureGroupLayer ) ;
193- } else if ( ! map . hasLayer ( featureGroupLayer ) ) {
195+ } else if (
196+ // checking for _map so we do not enter this code block during the connectedCallBack of the map-feature
197+ ! map . hasLayer ( featureGroupLayer ) &&
198+ ! featureGroupLayer . _map
199+ ) {
194200 this . addLayer ( featureGroupLayer ) ;
195201 // update the layerbounds
196202 let placeholder =
You can’t perform that action at this time.
0 commit comments