Android: setOverrideSynchronousUpdate for existing sources#4366
Open
systemed wants to merge 1 commit into
Open
Android: setOverrideSynchronousUpdate for existing sources#4366systemed wants to merge 1 commit into
systemed wants to merge 1 commit into
Conversation
louwers
approved these changes
Jul 1, 2026
louwers
left a comment
Member
There was a problem hiding this comment.
LGTM, @alexcristici maybe you can also have a look.
Contributor
Bloaty Results 🐋Compared to main Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4366-compared-to-main.txtCompared to d387090 (legacy) Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4366-compared-to-legacy.txt |
Contributor
|
Benchmark Results ⚡ Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-4366-compared-to-main.txt |
Contributor
Bloaty Results (iOS) 🐋Compared to main Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-4366-compared-to-main.txt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#4092 replaced
setGeoJsonSyncon Android with a new.withSynchronousUpdate(true)option when creating a new GeoJSONSource.However, this removed the possibility to use synchronous updates for existing GeoJSON sources defined in the stylesheet. Previously we could write:
which is no longer possible.
This PR reinstates this possibility by giving the user the option to override the synchronous updates setting for a GeoJSON source. With this, we can write:
This fixes #4187 using the approach I described in the comment and subsequently commented on by @louwers. I've chosen to fix it at the code level, rather than the stylesheet level, because this is a matter of client implementation rather than map style - in other words, it's very possible that one client using a given stylesheet might want synchronous updates, and another might not.
I've tested it locally using a special build of cycle.travel's app and it works well for me.
AI disclosure: I wrote the code and text myself, but did ask Claude to verify if I'd missed anything along the way, because it's better at C++ than I am. ;)