Closed 1ec5 closed 7 years ago
Moving to v3.5.0 because mbgl changes are needed.
-[MGLStyle layerFromMBGLLayer:]
calls [MGL*StyleLayer initWithIdentifier:source:]
, which sets _pendingLayer
to a new mbgl::style::*Layer
. This seems like a bug. Among other things rawLayer
and _pendingLayer
will wind up pointing to different objects, which appears to be the cause of this bug.
Basically https://github.com/mapbox/mapbox-gl-native/blob/dfb737ee0fcae49a4cbe2d9fabbea939642d94d8/platform/darwin/src/MGLStyle.mm#L356 needs to be folded into the initializers for the various style layers. We did this more correctly in https://github.com/mapbox/mapbox-gl-native/blob/dfb737ee0fcae49a4cbe2d9fabbea939642d94d8/platform/darwin/src/MGLStyle.mm#L168 for wrapping sources.
If you remove a layer from a style and add it back in, all its former paint properties are reset to the default values.
To reproduce this issue in macosapp:
country-layer-lg
and go to Delete.The layer comes back with the right layout properties but the wrong paint properties. For example, the readded symbol layer has the right
textField
,textSize
,textFont
, etc. but the wrongtextHaloBlur
:Essentially what macosapp does is to hold onto the selected layers for later insertion before removing them from the style. Given that the layout properties are persisted, I’d imagine the problem lies in core rather than at the SDK or application level.
/cc @boundsj