mapbox / mapbox/mapbox-plugins-android

Should `MarkerViewManager` implement a more 'reactive' camera listener ?

Open
#1,115 2 comments 2 reactions 0 assignees View on GitHub
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:
![sluggish](https://i.imgur.com/MfsZelV.gif)

I tried replacing `MapView.OnCameraDidChangeListener` by `MapView.OnCameraIsChangeingListener` and had no more updates ?!

I then tried using `MapboxMap.OnCameraMoveListener` with better results:
![okish](https://i.imgur.com/ZNweZfQ.gif)
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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.