Closed main-kun closed 3 years ago
Thank you for the report. I've tested your jsbin on different versions of Esri Leaflet. From what I can tell, it seems like the bug you're describing started at v2.4.0. (In other words, if you change the script tag in your jsbin to <script src="https://unpkg.com/esri-leaflet@2.3.3/dist/esri-leaflet.js"></script>
it works fine).
In that release (v2.4.0), the only change related to Feature Layer was #1189, so I suspect this bug has to do with that change.
I think there may be something unexpected happening with the "removefeature" event too. For example, in your jsbin, if youzoom out once, and then zoom out a few more times, the removefeature event still gets called (expected: should only be called once when the features went invisible).
I've created a more general issue report to replace this one with a few more specifics on what I've found: #1298. Please follow that for updates.
Describe the bug
I'm trying to add feature labeling to a layer with
minZoom
option following the docs example: https://esri.github.io/esri-leaflet/examples/labeling-features.html When the zoom level decreases,removefeature
event fires as expected and the labels are removed together with the markers. When zoom is increased again, markers come back butaddfeature
event does not fire so labels cannot be added back to the map.Expected behavior
addfeature
event fires when features are brought back on zoom level changeActual behavior
addfeature
does not fire afterremovefeature
on zoom changeTo Reproduce
Please share and fill in the steps below to reproduce the behavior.
THIS IS REQUIRED - If you do not provide the steps for others to reproduce the issue you're seeing, it is impossible for them to assist you. Please create a jsbin that demonstrates the problem and include the steps to see the issue:
Example
console.log
for theaddfeature
event and the labels are not brought backScreenshots
If applicable, add screenshots to help explain your problem.
Environment Information
L.version
): 1.7.1L.esri.VERSION
): 3.0.3Additional context
Add any other context about the problem here. If you're are not using the CDN, please note what loading/bundling library you are using (webpack, browserify, RequireJS)?