mapbox / mapbox/mapbox-maps-ios

Add geometryPadding parameter for .camera Viewport

Open
#2,383 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

<- Description of the feature being requested and any outcomes desired, an example use case, and any suggestions for solution ->
Similar to `.overview `**Viewport** we should have a `geometryPadding` parameter that applies padding to the map’s coordinate geometry. Currently, the only way to create an inset is by using the `.padding` modifier. The problem is that `.padding` shifts the entire rendered map, which—when using the Globe projection—results in the entire globe being visually offset. A dedicated `geometryPadding` argument would avoid this by padding only the coordinate space, not the rendered map.

## Why
<- 1-2 sentence description of why you're requesting this feature. What problem does it solve? Why is it valuable? ->
This is both a feature but also a bug in the current SDK. It would enable offsetting the map without offsetting the Globe projection for when wanting to fully zoom out

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 locating the .camera Viewport and .overview Viewport APIs, then compare how their padding is represented and applied. Done means a geometryPadding parameter affects only coordinate geometry, allowing Globe projection insets without shifting the rendered map.

Written by the indexing model from the issue text.

Assessment

Tech stack
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.