-
Notifications
You must be signed in to change notification settings - Fork 1.3k
No annotations at initial zoom level #1675
Comments
Likely the same issue as #1279. |
Because of this issue, bsudekum/react-native-mapbox-gl’s /cc @bsudekum |
Let's hit this as part of our focus on annotation solidification in b3. |
Trying to draw a shape annotation in Here's a GeoJSON polyline demo for iOS using the same delay technique as |
@1ec5 I think this should be fixed by the @tmpsantos do these partial parsing changes look right? 5f90c60 |
@ansis, yes, that fixes it. Thanks! |
This was also fixed by @jfirebaugh's work that merged yesterday |
Perfect. |
Still seeing this issue. Annotations don't load at the initial zoom, but load (and stay) after zooming in/out to the next level. |
So was @ansis' patch needed then? |
I have theory why this is happening: could be that we add the layer so fast that we emit the |
@tmpsantos Any more movement on this? Is this something you can look into? |
Yes, I managed to reproduce this early today. But I'll have to get back to this one later. :-/ |
Working on this one today. It is indeed related to adding the annotation before the style gets parsed. I can reproduce adding the annotation after calling |
Possibly relevant @tmpsantos: cutting-room-floor/tilelive-gl#11 (comment) |
I put together a small app that reproduces this issue. Tapping the "Redraw" button re-creates the MapView and sometimes gives a different manifestation of the problem. This project uses the latest published pod, but this is also seen from latest source in Master. |
Thanks @picciano — reopening. |
It looks like the cases where shape annotations render at all is entirely by accident. There is no guarantee that
I'm not sure how this was intended to work. @incanus? |
Keep in mind that this was perhaps significantly changed recently in 2141d95 and I'm unfamiliar with that work. Do things look the same on the iOS release branch or |
That commit didn't change this aspect of annotation behavior (or to my knowledge any aspects: it was a pure refactor). |
OTOH, I think shape tiles behave differently from point tiles, since shape tiles are actually generated by geojson-vt so that it can simplify shapes as well as trivially create tiles which are wholly inside filled polygons. I can get back into this shortly and try to provide more details after reviewing the code a bit. |
First, move style mutation code out of StyleParser and into AnnotationManager, coalescing it with the mutation code for shape layers. Second, allow AnnotationManager to keep track of stale tiles entirely internally. There's no reason to pass sets of TileIDs around. Third, correct the logic for invalidating the shape source. Since AnnotationManager does not track shape invalidations on a tile-by-tile basis, don't try to invalidate the shape source tile-by-tile. Fixes #1675 Fixes #2322 Fixes #2095
First, move style mutation code out of StyleParser and into AnnotationManager, coalescing it with the mutation code for shape layers. Second, allow AnnotationManager to keep track of stale tiles entirely internally. There's no reason to pass sets of TileIDs around. Third, correct the logic for invalidating the shape source. Since AnnotationManager does not track shape invalidations on a tile-by-tile basis, don't try to invalidate the shape source tile-by-tile. Fixes #1675 Fixes #2322 Fixes #2095
…gger post-sprite/sprite store load
…gger post-sprite/sprite store load
…gger post-sprite/sprite store load
First, move style mutation code out of StyleParser and into AnnotationManager, coalescing it with the mutation code for shape layers. Second, allow AnnotationManager to keep track of stale tiles entirely internally. There's no reason to pass sets of TileIDs around. Third, correct the logic for invalidating the shape source. Since AnnotationManager does not track shape invalidations on a tile-by-tile basis, don't try to invalidate the shape source tile-by-tile. Fixes mapbox#1675 Fixes mapbox#2322 Fixes mapbox#2095
If you follow the “First steps with Mapbox GL for iOS” guide, you wind up initializing an
MGLMapView
, centering it on the U.S. President’s front yard, and placing an annotation there, all within-[ViewController viewDidLoad]
. But if you do all that in-viewDidLoad
, the annotations fail to display at the initial zoom level. They appear when you zoom in or out to a different zoom level and disappear when you reenter the initial zoom level.At launch, the map view happens to show z15 tiles:
Then zoom in, right to the cusp of z16:
And zoom in just a little farther to z17:
Or zoom out, right to the cusp of z14:
And a little further out to 14:
The upshot is that our guide does not work as designed. We didn’t catch this issue in development because the iOS demo app only adds annotations in response to an action sheet button, not within
-viewDidLoad
.Reproduces in ios-v0.3.1 as well as master, regardless of style.
/cc @incanus
The text was updated successfully, but these errors were encountered: