mapbox / mapbox/mapbox-maps-ios
Support for transition for data-driven properties
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## 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.
```swift
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](https://github.com/mapbox/mapbox-gl-js/issues/3170) and [rnmapbox](https://github.com/rnmapbox/maps/issues/2102).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the Swift SymbolLayer expression and StyleTransition APIs shown in the report, and compare them with the constant-value path and the onCameraChanged workaround. Confirm the behavior around zoom changes and determine what must change so iconOpacity transitions when driven by an expression; done means the reported fade-in and fade-out behavior works for the example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100