JF: fix map performance#2
Open
aymoun95 wants to merge 5 commits into
Open
Conversation
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.
Description
Time Track
Test
Screenshots
Edit: for now we can show the image of company as cluster image and once zoom in the group is going to be shown
Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2024-05-16.at.20.05.36.mp4
PS: we can further improve the performance by setting the
tracksViewChangestofalseas here it will work because of conditional rendering by the supercluster but one downside to it is that the image will be shown as white until it loads but there will be no flicker. This has the best performance until now ( did not push this, just disable thetracksViewChanges)Simulator.Screen.Recording.-.iPhone.SE.3rd.generation.-.2024-05-16.at.21.15.12.mp4
Notes
Sol 1: this solution uses clustering, I used only the installed library use-supercluster (found another that simplifies react-native-maps-clustering but no need for extra bundle size)
Sol 2: tried out to only show the markers that appear inside the bounding box (we can simplify getting it using predefined react native maps method:
getBounds), but the problem persisted as almost all the markers are scattered in the same area: I didn't want to change the data as I assumed that this is a real scenario as stated in the challenge.Sol 3: tried setting the
tracksViewChangestofalseand re-render the marker custom image using theredrawmethod but got no luck on ios as the redraw was not called either insideonLoador when using an effect.Sol 4: I am thinking of creating a small server and will try to send data by chunks but I thought that the map will flicker a bit as if I set the
tracksViewChangestofalseI need to force a re-render.PS: I think we can overcome the Sol 3 issue with further investigation, will keep trying for it and once done will create another PR for it. Also will try Sol 4 after that.