mapbox / mapbox/mapbox-maps-ios
Cannot filter based off non-integer zooms
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## Environment
- Xcode version: 16.0
- iOS version: 18.1
- Devices affected: Simulator, iPhone 13 Pro Max
- Maps SDK Version: 24.6.1
## Observed behavior and steps to reproduce
```
private func rankThresholdForZoomExpression() -> Exp {
return Exp(.interpolate) {
Exp(.linear)
Exp(.zoom)
11.0
1
12.0
5
13.0
10
14.0
100
}
}
```
```
exampleLayer.filter = Exp(.lte) {
Exp(.get) { "rank" }
rankThresholdForZoomExpression()
}
```
When zooming on the map, this interpolation is only done on integer values. If we add a step at 13.5 for example it is ignored.
## Expected behavior
At zoom level 12.5, we would see 7.5 or 7 instead the value does not change until we reach zoom level 13, when it changes from 5 to 10.
Is it possible to do this, I have also tried using fractional steps and comparisons which also only evaluate on integers.
Is there any possible way have smoother filtering from zoom? Even just filtering when zoom is 12.5 would be great.
## Notes / preliminary analysis
## Additional links and references
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 by reproducing the behavior with rankThresholdForZoomExpression(), Exp(.zoom), Exp(.interpolate), and exampleLayer.filter on the listed iOS and Maps SDK versions. The issue names no source file or test; done means fractional zoom values such as 12.5 affect filtering or the supported limitation is documented.
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