mapbox / mapbox/mapbox-plugins-android
Should `MarkerViewManager` implement a more 'reactive' camera listener ?
- Dominant language
- Java
- Stars
- 242
- Forks
- 116
- PR merge metrics
- No merged PRs in 30d
Description
Hello,
The `MarkerViewManager` implements the `MapView.OnCameraDidChangeListener` so updating a `MarkerView` is only updated after the camera did change, and not while the camera is changing.
The consequence of that is some sluggish `MarkerView` re-positioning after a camera move, as shown here:

I tried replacing `MapView.OnCameraDidChangeListener` by `MapView.OnCameraIsChangeingListener` and had no more updates ?!
I then tried using `MapboxMap.OnCameraMoveListener` with better results:

https://imgur.com/ZNweZfQ
GPU usage is a tad high, that's why I'm not sending a PR.
Should `MarkerViewManager` implements a more 'reactive' camera listener ?
PS: on the above gifs, I'm using react-native with:
- https://github.com/react-native-mapbox-gl/maps
- and https://github.com/react-native-community/lottie-react-native for the animated orange markers
Contributor guide
Research direction
Start by locating MarkerViewManager and its MapView.OnCameraDidChangeListener implementation, then compare its behavior with the camera listeners mentioned in the report. Reproduce the sluggish marker repositioning with the linked React Native and Lottie setup; done means smoother updates without an unacceptable GPU cost.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100