Implemented tracksViewChanges for Android#2477
Merged
alvelig merged 1 commit intoreact-native-maps:masterfrom Sep 9, 2018
Merged
Implemented tracksViewChanges for Android#2477alvelig merged 1 commit intoreact-native-maps:masterfrom
tracksViewChanges for Android#2477alvelig merged 1 commit intoreact-native-maps:masterfrom
Conversation
This will help avoid unstable rendering of markers, and even support some level of animation. (like in iOS)
Collaborator
|
@alvelig LGTM but this is android , could you 🐽 |
Contributor
|
LGTM |
Stalder
referenced
this pull request
in 91team/react-native-maps
Feb 5, 2019
pinpong
pushed a commit
to pinpong/react-native-maps
that referenced
this pull request
Feb 28, 2025
…acksViewChanges Implemented `tracksViewChanges` for Android
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.
Does any other open PR do the same thing?
No
What issue is this PR fixing?
This is related to the following issues:
#1870 #2105 #2048 #2082
How did you test this PR?
In my own project, with a progressing pie animation inside the marker.
I've also made sure that tracking stops when the marker is removed from the map etc.
Some background and explanation
iOS has the
tracksViewChangesproperty which causes re-renders of the markers all the time, and slows down performance of the map greatly.Still, it is very handy especially given the async nature of React.
As many times the first images cached is of a blank component, it is very useful to use
tracksViewChanges=trueand then set it tofalsewhencomponentDidUpdateis hit.Another issue is loading images. Assuming the image loading issue will be fixed one day - we will still want
tracksViewChangesand disabled that whenonLoadEndhits.We could even start with it as a false value, and then turn it on and off when the loading is done.
Now some people use several hacks for the image issue on Android, like actual changes to Fesco code and usage of SVG images inside the Marker. But in those cases it is still slightly unstable and sometimes blank - but just because of the asyncronisity of react. This will also solve that.
I've set a default fps of 25, which seemed reasonable to me. But based on user feedback this could be easily adjusted.