-
Notifications
You must be signed in to change notification settings - Fork 157
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
Flickering: Modifying annotations in annotations manager causes remove and redraw #2249
Comments
I have a scenario where annotation array needs to be updated once every two seconds. When the array of annotations is updated the redraw should be smooth rather than clearing the annotations and redrawing them again.
|
Hi @sravanporipireddy - Can you share a bit more about your use case:
We have multiple ways of handling annotations/markers on the map, so another approach may better suit your use case. You can learn more about the different approaches here: https://docs.mapbox.com/ios/maps/guides/markers-and-annotations/ |
flickering.movHow many annotations do you have? -> Could be in thousands In the recording which i shared you can observe whenever we update the polygons in annotation manager the entire drawing is removed first and then redrawn with latest polygons. |
Hi @sravanporipireddy -- Thanks for sharing these additional details. In your case, I think using Style Layers makes more sense than using annotations. With this approach you add both a Source, which contains geographic data, and a Layer, which contains styling information, to the map. You can style this Layer according to your needs, in this case to create small polygons. We have more information on working with Sources and Layers here. I'd also recommend looking at our iOS examples here for inspiration. These examples are relevant to your implementation: feature state and draw geometries. |
Environment
Observed behavior and steps to reproduce
Expected behavior
The text was updated successfully, but these errors were encountered: