Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Prevent flickering when adding/removing annotations #1688

Closed

Description

@kkaefer

When adding a new annotation, tiles that contain this annotation are flickering because we are removing the tile, and parsing the new tile may still take a frame or two. Instead of removing the tile, we should reparse the tile and update the bucket as required.

Activity

  1. self-assigned this
    on Jun 30, 2015
  2. added
    performance
    on Jul 10, 2015
  3. incanus commented on Aug 18, 2015

    @incanus
    Contributor

    @jfirebaugh Would you have time to look into this sometime, at least to scope the work required?

  4. added this to the ios-v2.1.0 milestone on Sep 1, 2015
  5. self-assigned this
    on Sep 4, 2015
  6. incanus commented on Sep 4, 2015

    @incanus
    Contributor

    This is pretty satisfactory right now. See #1798 (comment).

  7. parrots commented on Sep 5, 2015

    @parrots

    Regarding comment about #1798 demo seemingly addressing flickering, made a PR to Justin's sample project to show the flickering is still there. See here: incanus/UISyncedMap#1 which just zooms out the map to show the entire user route.

    Ideal outcomes, as far as I'd see, besides just "make it faster" which could always still have a visible flicker on old hardware or with enough complex data:

    • Find a way to not remove the old drawn layer until the new version can be swapped in so there is 0.1 seconds of stale data vs 0.1 seconds of empty space.
    • Only redraw the annotations that were modified.
  8. mourner commented on Sep 5, 2015

    @mourner
    Member

    Find a way to not remove the old drawn layer until the new version can be swapped in so there is 0.1 seconds of stale data vs 0.1 seconds of empty space.

    This is what GL JS does currently, which is good enough for use cases like mouse-driven polylines etc.

  9. pkmital commented on Sep 6, 2015

    @pkmital

    We're still experiencing issues with flickering for our use case. We are drawing a polyline of about 100 points, and are constantly removing it and redrawing it with each update, though require updating the polyline so often as we are changing only the last few points of the line.

  10. maciekish commented on Sep 7, 2015

    @maciekish
    Contributor

    We're also experiencing this issue in 294b307. When the user pans our map we reload search results and the experience is horrible. The idea suggested by @mourner sounds like a very good one. cc @Zakay

  11. incanus commented on Sep 15, 2015

    @incanus
    Contributor

    Going to have to move this from the current iOS milestone as it's non-blocking.

  12. removed this from the ios-v2.1.0 milestone on Sep 15, 2015
  13. 17 remaining items

  14. incanus commented on Nov 3, 2015

    @incanus
    Contributor

    🎉

  15. added a commit that references this issue on Nov 6, 2015
    10d488b
  16. mitchellporter commented on Nov 17, 2015

    @mitchellporter

    I'm really excited for this fix. What's the best way for me to get this for the iOS SDK? I've already been using the latest version @ 2.1.2 with Cocoapods. Will the pod be ready to be updated soon, or do I need to start using a custom fork?

  17. friedbunny commented on Nov 17, 2015

    @friedbunny
    Contributor

    @mitchellporter It's possible to use the master development branch as a pod and get the latest pre-release, but be aware that things can/will break. Don't use this in production, clearly. 💥

    pod 'Mapbox-iOS-SDK', :podspec => 'https://raw.githubusercontent.com/mapbox/mapbox-gl-native/master/ios/Mapbox-iOS-SDK.podspec'
  18. incanus commented on Nov 17, 2015

    @incanus
    Contributor

    More closely to the impending release, you could use https://raw.githubusercontent.com/mapbox/mapbox-gl-native/release-ios-v3.0.0/ios/Mapbox-iOS-SDK.podspec instead, but post-release it will go away once the release branch is merged completely back to master.

  19. mitchellporter commented on Nov 17, 2015

    @mitchellporter

    @friedbunny @incanus Thanks guys. I've already noticed some things with the update, both good and bad. Would you prefer me to post here or create a separate issue specifically for iOS?

  20. incanus commented on Nov 17, 2015

    @incanus
    Contributor

    I’d say flag any specific issues, indicating the version tested against, as we near release.

  21. euroboy commented on Sep 26, 2016

    @euroboy

    Hi. I'm facing this issue in version 3.3.4. I'm drawing a tracking path on map, and before adding annotations I remove the old ones, and as result the path is blinking. How to fix this?

  22. zivlevy commented on Jun 23, 2017

    @zivlevy

    I have the same issue as @euroboy when removing MGLPolyline and re-adding it it flickers.
    I need to update the polyline every 1 sec due to user location update. The current flickering is unacceptable UX.
    What is the best way to overcome this issue ?

  23. t-yoshii commented on Jun 26, 2017

    @t-yoshii

    MGLPolyline (MGLMultipoint) has setCoodinates method. I think it dynamically updates its coordinates without removing/re-adding.

    https://www.mapbox.com/ios-sdk/api/3.4.0-beta.6/Classes/MGLMultiPoint.html#/c:objc(cs)MGLMultiPoint(im)setCoordinates:count:

  24. zivlevy commented on Jun 26, 2017

    @zivlevy

    @t-yoshii thanks.
    Unfortunately that doesn't help with the flickering.

  25. t-yoshii commented on Jun 26, 2017

    @t-yoshii

    @zivlevy How about replaceCoordinates? I made a mistake...

  26. zivlevy commented on Aug 20, 2017

    @zivlevy

    @t-yoshii - Yes, that removes the flickering.
    Thanks for your help !

  27. stuyam commented on Jan 30, 2018

    @stuyam

    I can confirm that the method @t-yoshii suggests of using replaceCoordinates to update a line rather than deleting a line and redrawing it does in fact fix the flicker.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

performance

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions