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({
168
168
this . _resetFeatures ( ) ;
169
169
} ,
170
170
171
+ // remove or add features based on the min max attribute of the features,
172
+ // and add placeholders to maintain position
171
173
_resetFeatures : function ( ) {
172
174
// since features are removed and re-added by zoom level, need to clean the feature index before re-adding
173
175
if ( this . _map ) this . _map . featureIndex . cleanIndex ( ) ;
@@ -190,7 +192,11 @@ export var FeatureLayer = L.FeatureGroup.extend({
190
192
) ;
191
193
// removing the rendering without removing the feature from the feature list
192
194
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
+ ) {
194
200
this . addLayer ( featureGroupLayer ) ;
195
201
// update the layerbounds
196
202
let placeholder =
You can’t perform that action at this time.
0 commit comments