mapbox / mapbox-gl-native

Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL
https://mapbox.com/mobile
Other
4.37k stars 1.33k forks source link

Markers disappear when zooming in/out fast #9487

Closed mrfaa closed 7 years ago

mrfaa commented 7 years ago

Platform: Android Mapbox SDK version: 5.1.0

Steps to trigger behavior

Hi Team,

attached you will find a short video, which shows the bug i have identified in the latest stable mapbox version. I used the Demo App. When I zoom out quickly some marker disappear. When i pan the map again the markers appear again. Is this a normal behavior? I have in my app round about 400 markers. Most of them disappear when zooming fast in/out and appear again when i pan the map.

Best Fabian

Expected behavior

All markers remain visible.

Actual behavior

Markers disappear. videotogif_2017 07 12_18 39 07 1

tobrun commented 7 years ago

Thank you for the report @mrfaa, adding context here that the marker shown in the gif are MarkerViews.

tobrun commented 7 years ago

normally those markers should re show after a maximum of 250 ms (this is what I'm observing in the MarkerViewActivity) Though these are shown at a high zoomlevel, I'm guessing this issue only shows at low zoomlevel as we probably aren't hitting the correct map change events for triggering an update to MarkerViews.

tobrun commented 7 years ago

In any case, I would advice you to look into using SymbolLayer instead. We will be deprecating support for MarkerViews in an upcoming release. See #9365.

tobrun commented 7 years ago

MarkerView is going to be deprecated with https://github.com/mapbox/mapbox-gl-native/pull/9782. We are no longer maintaining this API and will remove it in future versions of the SDK. As noted in the deprecation message. We are advising users to leverage SymbolLayer instead (you can use the sample code in #9782 to convert Android SDK views to an Image to be used as a Symbol). While we no longer maintain the API we are happy to accept any PRs on it.