mapbox / mapbox/mapbox-maps-ios

Attribution Button not respecting 'y' margin

Open
#2,402 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

auto-triaged bug :beetle:
Dominant language
Swift
Stars
601
Forks
196
PR merge metrics
No merged PRs in 30d

Description

## Environment

- Xcode version: 26.2
- iOS version: 26.2
- Devices affected: iPhone 17 Pro , iPhone simulators
- Maps SDK Version: 11.18.1

## Observed behavior and steps to reproduce

Given the following code the, 'y' margin of the o.attrributionButton.margins is not working. No matter what number I pul there the attribution button has a static position. The 'x' margin is working as expected. This happens no matter what the 'position' of the attributionButton is (topLeft, topRight, etc)

```
.ornamentOptions({
var o = OrnamentOptions()
let yOffset: CGFloat = !showPOIFilterBar || isShowingNearby || (waypointsCollection.count == 1 && pinnedWaypoint != nil) ? -50 : 0
o.logo.position = .topLeft
o.logo.margins = CGPoint(x: 8, y: 105 + yOffset)
o.attributionButton.position = .topLeft
o.attributionButton.margins = CGPoint(x: 80, y: 105 + yOffset) // <--- issue is here
o.scaleBar.position = .topLeft
o.scaleBar.margins = CGPoint(x: 8, y: 125 + yOffset)
o.compass.position = .topRight
o.compass.margins = CGPoint(x: 5, y: 105 + yOffset)

return o
}())
```

In this image the attribution button should be positioned next to the Mapbox logo. It previously was until after I updated from SDK 11.16 to 11.18

Image

## Expected behavior

I would expect that y margin adjusted based on the value in the ornamentOptions setting

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 reproducing the sample OrnamentOptions configuration with SDK 11.18.1 and compare its attributionButton behavior with SDK 11.16. Inspect the attributionButton margin handling, focusing on why the x margin changes while the y margin does not; done means the y value positions the button as expected for each supported position.

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
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.