-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Features added to a mapView through addAnnotation appear below raster tyle sources #6774
Comments
@Jmaguerre To speed this along, could you whip up a quick code demo? Based on the loading behavior, it does sound like a possible bug. |
@Icanus Okay so while trying to reproduce I think I know what's happening but don't know why.
Result: So here comes another posible bug. If I do the same thing without having the network call the source added is never loaded.
Result: |
Closing due to ticket age. If this is still a problem, please re-open |
this is still a problem. I am running the IOS SDK version 3.7.0 B1. I have several MGLPointAnnotation added to my MGLMapView. They are visible on top of the default streetmap. I use the following code to add a raster layer to the map and the raster layer appears over top of the MGLPointAnnotations. The MGLPointAnnotations are no longer visible. This is also true of MGLPolyline that I have added to the map. The raster layer also hides them.
|
An implementation detail worth mentioning is that annotations are backed by a built-in symbol style layer that gets added to the style in after Until we implement either #6181 or #1734 (comment), the annotation and runtime styling APIs don’t always interact intuitively when used together with the same map view, but MGLMapViewDelegate and MGLStyle do provide hooks for avoiding these conflicts.
@Jmaguerre, the network request in your code most likely finishes at some point after the annotation layer is added. A little advertised behavior of the SDK is that you can add arbitrary layers to the top of the style in
In fact, anything you do to an MGLStyle before
@amphib, you can avoid this issue by adding the style layers in |
Perfectly understood, thanks for the details of the explanation. |
Platform:
iOS
Mapbox SDK version:
https://github.com/mapbox/mapbox-gl-native/releases/tag/ios-v3.4.0-beta.1
Steps to trigger behavior
Using the new styles API adding a raster source to the map style makes any annotation appear below the tiles
Expected behavior
Annotations should appear on top of the raster layers
Actual behavior
I have a glimpse of the annotations appearing on the map before the tiles load. After tiles finish loading annotations do not show.
It happens either adding annotations conforming to MGLAnnotation protocol or MGLPointFeatures.
I don't know if there's anything I'm doing wrong or it is a bug. We have an app using the old RMTileSources and RMMapLayer where it works as expected.
Thanks
The text was updated successfully, but these errors were encountered: