You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Prevent flickering when adding/removing annotations #1688
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.
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.
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.
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.
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
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?
@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. 💥
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.
@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?
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?
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 ?
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.
Activity
incanus commentedon Aug 18, 2015
@jfirebaugh Would you have time to look into this sometime, at least to scope the work required?
incanus commentedon Sep 4, 2015
This is pretty satisfactory right now. See #1798 (comment).
parrots commentedon Sep 5, 2015
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:
mourner commentedon Sep 5, 2015
This is what GL JS does currently, which is good enough for use cases like mouse-driven polylines etc.
pkmital commentedon Sep 6, 2015
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.
maciekish commentedon Sep 7, 2015
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
incanus commentedon Sep 15, 2015
Going to have to move this from the current iOS milestone as it's non-blocking.
17 remaining items
incanus commentedon Nov 3, 2015
🎉
[core] Monitor annotation tiles, rather than completely invalidating …
mitchellporter commentedon Nov 17, 2015
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?
friedbunny commentedon Nov 17, 2015
@mitchellporter It's possible to use the
masterdevelopment 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. 💥incanus commentedon Nov 17, 2015
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.podspecinstead, but post-release it will go away once the release branch is merged completely back tomaster.mitchellporter commentedon Nov 17, 2015
@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?
incanus commentedon Nov 17, 2015
I’d say flag any specific issues, indicating the version tested against, as we near release.
euroboy commentedon Sep 26, 2016
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?
zivlevy commentedon Jun 23, 2017
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 ?
t-yoshii commentedon Jun 26, 2017
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:
zivlevy commentedon Jun 26, 2017
@t-yoshii thanks.
Unfortunately that doesn't help with the flickering.
t-yoshii commentedon Jun 26, 2017
@zivlevy How about replaceCoordinates? I made a mistake...
zivlevy commentedon Aug 20, 2017
@t-yoshii - Yes, that removes the flickering.
Thanks for your help !
stuyam commentedon Jan 30, 2018
I can confirm that the method @t-yoshii suggests of using
replaceCoordinatesto update a line rather than deleting a line and redrawing it does in fact fix the flicker.