mapbox / mapbox/mapbox-maps-ios
Add a way to SwiftUI Map() to add an UIImage to SourceLayer
Nobody has claimed this yet.
- Dominant language
- Swift
- Stars
- 601
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
## New Feature
In SwiftUI / Mapbox add a way to set/update an image in ImageSource like
ImageSource(id: sourceId)
.image(someImage)
.coordinates(coords)
## Why
I am using a SwiftUI Map() view with
ImageSource(id: sourceId)
.url(someUrl)
.coordinates(coords)
This works, but I would like to use my own Image cache to update ImageSource.
I can use MapReader, to get the map object and do a
try map.updateImageSource(withId: sourceId, image: someImage)
but this is not very SwiftUI like
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 tracing the SwiftUI Map() and ImageSource APIs, then compare the existing url-based source flow with MapReader and updateImageSource(withId:image:). Done means SwiftUI can set or update an ImageSource from a cached UIImage while retaining coordinate support and matching the requested usage pattern.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- ios, swift
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100