mapbox / mapbox/mapbox-maps-ios
Adding system UIImages to map gives `mismatched image size`
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: N/A
- Maps SDK Version: 11.3.0.rc1
## Observed behavior and steps to reproduce
When I try to use the following code to add system `UIImage` to a `MapboxMap` called `map`:
```swift
try map.addImage(
UIImage(systemName: "mappin")!,
id: "pin"
)
```
I get an error: `StyleError(rawValue: "mismatched image size")`.
## Expected behavior
I should be able to use this image the same way I can use images that come from my `Assets`.
## 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 issue with the `map.addImage` call and a system `UIImage` named `mappin` on the stated Maps SDK, Xcode, and iOS versions. Trace the image-size validation reached by `addImage`; done means system images can be added without `StyleError(rawValue: "mismatched image size")`, while existing asset images continue to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100