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

Annotations inappropriately disappear en masse based on zoom #10845

Closed friedbunny closed 6 years ago

friedbunny commented 6 years ago

On master circa 10a44050f485a18f8dd6523aca6a7a9f82f7afc7 (pre-ios-v4.0.0), zooming in/out of a map with 10,000 sprite annotations can cause virtually every annotation to inappropriately disappear.

  1. Add 10,000 sprite annotations in iosapp.
  2. Zoom several levels in and out — annotations will disappear and then mostly never reappear.

Check out this video for a demonstration.

If you quickly zoom in to ~z11 and then out to ~z4, it’s possible to have a single annotation remaining (out of the 10k that should be visible). In general, this appears to be happening within individual tiles.

sprites_gonezo Annotations have gonezo.

/cc @mapbox/gl-core @akitchen @fabian-guerra @lilykaiser

1ec5 commented 6 years ago

Does this issue reproduce only with annotations, or does it also reproduce with symbols in a symbol layer? Collision detection was overhauled in #10436 on master; could that be related?

ChrisLoer commented 6 years ago

Collision detection was overhauled in #10436 on master; could that be related?

Yeah, I think so, although I'm not super familiar with how Annotations are implemented -- basically a SymbolAnnotation should behave like an icon feature, right? @ansis, this makes me think "inappropriate CrossTileSymbolIndex duplicate detection" -- does this ring any bells with the work you're doing right now?

jfirebaugh commented 6 years ago

Symbol annotations use a symbol layer with "icon-allow-overlap": true and "icon-ignore-placement": true.

Another potential culprit is ac32b41493956e6b03ab13475f27a4dcd64355ae.

ChrisLoer commented 6 years ago

I can reproduce this on the commit before https://github.com/mapbox/mapbox-gl-native/commit/ac32b41493956e6b03ab13475f27a4dcd64355ae.

kkaefer commented 6 years ago

I believe https://github.com/mapbox/mapbox-gl-native/commit/ac32b41493956e6b03ab13475f27a4dcd64355ae isn't at fault here, since I can observe the same behavior in the commit immediately preceding it.

ChrisLoer commented 6 years ago

Bisected to #10436.

ChrisLoer commented 6 years ago

https://github.com/mapbox/mapbox-gl-native/pull/10899 appears to fix this (I've tested on macosapp and a simulated iphone 6s so far).