-
Notifications
You must be signed in to change notification settings - Fork 799
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels removed when features move outside of view and back. #1193
Comments
That's an interesting catch, thanks for pointing this out. I haven't had focused time yet to debug what is going on the way that sample was written and in your linked issue #408 comment thread, but according to the API docs all of this should work as-is. I created a remixed codepen of the sample page in question using a different approach. It is just a quick trial and exploration, and admittedly it may be a bit heavy-handed doing the label removing/adding on map https://codepen.io/jwasilgeo/pen/xxwbEXP (I had used the |
Thanks for the quick response and quick solution, which seems like it should do the trick in the meantime. |
There's also Geovation/labelgun. Would be interesting to compare/contrast and give it a whirl. They've a live demo with esri-leaflet and here's the source. Ah, and there's an existing conversation that touches on labelgun over in #916. |
@freewheelCarto, I think this has been fixed with the latest release of v2.4.0. Can you double-check, please, at the original labeling docs demo page? I'm thinking it still may be useful to point to a 3rd party library like labelgun on that demo page to help folks find their way to dynamic labeling solutions. |
Closing. Believe to have been fixed in the release of v2.4.0. |
Sorry I never tested this out again - ended up going a different direction with that project. But when I have time I'll verify the fix. Thanks! |
Using the code given for the Labeling Features example (and in the example itself), labels are sometimes removed when the features move out of the viewport and back in.
It seems related to the removefeature events. In some cases (but not always), when the features move out of the viewport, I was able to see that the removefeature event is fired (related to this functionality?). In the example code, the labels are removed from the map on this event. I do see that addfeature is fired when the map is panned and features make it back into view, but it doesn't add the labels.
I'm trying to figure out a solution for my current project. If I can figure something out, it will probably be more of a work around than a permanent solution. Maybe someone will be able to address this in a more permanent way for the example on the Esri Leaflet docs.
Here is a screenshot from the Esri Leaflet example page that shows missing labels.
The text was updated successfully, but these errors were encountered: