MarkerView does not follow map on drag (Android)
See original GitHub issueDescribe the bug
When using MarkerView
s on Android, if you drag the map to another position, the marker will remain in the same position on the screen rather than following the movement of the map. Once the drag has stopped, the marker seems to move to the correct location.
To Reproduce
This bug seems to be present any time a <MarkerView />
is used on Android.
It can actually be seen in the current example code for react-native-mapbox-gl
under “Annotations/MarkerView”: https://github.com/react-native-mapbox-gl/maps/blob/master/example/src/examples/Annotations/MarkerView.js
Expected behavior
The marker should remain at the same position on the map while dragging.
Actual behavior
The marker remains at a static position on the screen rather than moving along with the map.
Screenshots
Here is a video of the bug viewed in the unaltered project example code:
I also updated the example to include more MarkerView
s to make it more apparent what is happening:
Versions (please complete the following information):
- Platform: Android
- Platform OS: Android 11
- Device: Pixel 5 (Also Pixel 4 emulator)
- Emulator/ Simulator: Both
- Dev OS: macOS 11.5.2
- react-native-mapbox-gl Version: 8.3.0
- Mapbox GL version: (I’m honestly not sure how to find this, but it’s whatever is used by the example project.)
- React Native Version 0.64.2 (Also seeing it in 0.65.1)
Additional context
It kind of looks like when a marker hits the edge of the screen it just get’s stuck there rather than being removed. Maybe there is a bug in the code checking for elements that are not within the visible map?
Something interesting to note is that this bug does not seem to occur with PointAnnotation
s, only MarkerView
s.
I think this bug is specific to Android, as I am not seeing any problems on iOS.
Also, if you move the screen more slowly, you can see that the markers are slightly delayed in maintaining their correct location on the map. I’m not sure if that is even the same bug though.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:6
- Comments:21 (7 by maintainers)
Top GitHub Comments
mapbox is the worst map in the world
@ombogdan, thanks for helping to make it better 👍🏿