mapbox / mapbox/mapbox-maps-ios

Add a way to SwiftUI Map() to add an UIImage to SourceLayer

Open
#2,314 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged feature :green_apple:
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.