mapbox-maps-ios icon indicating copy to clipboard operation
mapbox-maps-ios copied to clipboard

Inconsistent attribution button and logo positioning

Open ir-fuel opened this issue 3 years ago • 1 comments

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:

Screenshot 2022-07-05 at 13 58 55

Screenshot 2022-07-05 at 14 03 07

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 avatar Jul 05 '22 12:07 ir-fuel

@ir-fuel, are you still seeing this in the newer versions of our SDK?

ZiZasaurus avatar Sep 12 '22 12:09 ZiZasaurus

@ir-fuel closing this ticket but please feel free to reopen if you have additional questions/ issues.

ZiZasaurus avatar Oct 24 '22 23:10 ZiZasaurus

@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?

ondrejkorol avatar Jan 24 '23 10:01 ondrejkorol