Skip to content

fix: redraw markers manually#3

Open
aymoun95 wants to merge 1 commit into
Jobflow-io:mainfrom
aymoun95:fix/map-performance-sol2
Open

fix: redraw markers manually#3
aymoun95 wants to merge 1 commit into
Jobflow-io:mainfrom
aymoun95:fix/map-performance-sol2

Conversation

@aymoun95

Copy link
Copy Markdown

Description

  • Enhance map poor performance upon loading multiple markers solution 2

Test

  • Before pulling try out the map on the main branch, open the performance monitor and check the js and ui threads fps
  • checkout out this branch
  • check the performance monitor, it gets 60 fps all the time for Android and ios gets to 60fps on loading the markers

Screenshots

android.mp4
ios.mp4

Idea

  • On Android: set track changes to false always and once the custom image was loaded we force a marker re-render using the redraw function
  • On IOS: the redraw doesn't work properly so to overcome this, we use a state to update the tracksViewChanges to false once the image is loaded

The problem with this approach is that on Android the markers appear "suddenly" and on IOS the performance starts slow and with every image load it flickers as we re-render. I think we can overcome this we can use an Animated marker so it appears smoothly.

Also we can reduce the number of re-renders by making a global state and once all images with uri are loaded we update that state (used for tracksViewChanges value). But this requires extra work as we need to follow every network request status as some of them may fail so we can count those as success to update our state in the end

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants