Since Esri Leaflet v2.4.0, the addfeature and removefeature events are not working properly on a FeatureLayer with a minZoom/maxZoom.
Expected behavior
When there is a minZoom or maxZoom defined on the layer, the addfeature and removefeature events should get called as the user zooms "when a feature on the layer is removed from the map" (removefeature) and "when a previously removed feature is added back to the map" (addfeature) (quotes from the docs)
Actual behavior
As you zoom out and in, the addfeature and removefeature events are fired too many times.
Describe the bug
Since Esri Leaflet v2.4.0, the
addfeature
andremovefeature
events are not working properly on a FeatureLayer with a minZoom/maxZoom.Expected behavior
When there is a
minZoom
ormaxZoom
defined on the layer, theaddfeature
andremovefeature
events should get called as the user zooms "when a feature on the layer is removed from the map" (removefeature
) and "when a previously removed feature is added back to the map" (addfeature
) (quotes from the docs)Actual behavior
As you zoom out and in, the
addfeature
andremovefeature
events are fired too many times.To Reproduce
Esri Leaflet v2.3.3 - working as expected: https://jsbin.com/duyupof/edit?html,output
Esri Leaflet v3.0.3 (latest) - NOT working as expected: https://jsbin.com/yoyifa/2/edit?html,output
Environment Information
L.version
): 1.7.1L.esri.VERSION
): happening on > v2.4.0Additional context