mapbox-maps-ios
mapbox-maps-ios copied to clipboard
Inconsistent attribution button and logo positioning
Environment
- Xcode version: 13.4.1
- iOS version: 15.5
- Devices affected: all
- Maps SDK Version: 10.5.1
Observed behavior and steps to reproduce
We have a SwiftUI view containing a Mapbox MapView, through an UIViewControllerRepresentable.
The ornaments of that MapView are configured as follows:
mapView = MapView(frame: view.bounds, mapInitOptions: options)
mapView.location.options.puckType = .none
mapView.ornaments.options.scaleBar.visibility = .hidden
mapView.ornaments.options.compass.visibility = .hidden
mapView.ornaments.options.attributionButton.position = .bottomRight
mapView.ornaments.options.attributionButton.margins = .zero
mapView.ornaments.options.logo.position = .bottomLeft
mapView.ornaments.options.logo.margins = .zero
We instantiate a bunch of those views in a SwiftUI List
For some reason some maps have a bottom margin on the logo and attribution button, and some don't:


Expected behavior
All map instances should have the logo and button at the bottom of the map.
I checked the documentation and I can't find why it does this. I would expect to see either a margin for all of them or for none of them, but not for some.
I can't debug this because the view hierarchy doesn't go into the Mapbox MapView component.
@ir-fuel, are you still seeing this in the newer versions of our SDK?
@ir-fuel closing this ticket but please feel free to reopen if you have additional questions/ issues.
@ZiZasaurus This is still an issue for me - described behavior when using Mapbox with SwiftUI. I'm using the latest version 10.10.1. When I scroll revealed maps have the wrong position of the logo and attribution button. When I tap on the map or I go to the background and back to foreground, it'll fix for the visible maps. Is there any recommendation please on how could I trigger the refresh manually?