mapbox-maps-ios
mapbox-maps-ios copied to clipboard
Support for transition for data-driven properties
Environment
- Xcode version: 15.3
- iOS version: 17.4
- Devices affected: iPhone 15 Pro
- Maps SDK Version: 11.1.0
Observed behavior and steps to reproduce
Transitions don't seem to function at all when layer properties are set using expressions rather than constant values.
var layer = SymbolLayer(id: layerId, source: sourceId)
layer.iconImage = "icon"
layer.iconOpacity = .expression(Exp(.step) {
Exp(.zoom)
0
15
1
})
layer.iconOpacityTransition = StyleTransition(duration: 1, delay: 0)
Expected behavior
I'd expect the opacity to fade in and out when zooming past the specified zoom level.
The transition works properly if you use an onCameraChanged
listener and set the value to a constant instead.
Notes / preliminary analysis
This may be related to similar issues in mapbox-gl-js and rnmapbox.