0

Rotating the map according to the device orientation, makes position of watermark a bit strange. I understand that that watermark and text attribution are placed relatively to the margin
screenshot of landscape view of map on iphone X I would prefer to locate these objects closer to the corners screenshot of portrait app view with mapbox wordmark How can I get it?

mathmax
  • 5
  • 2

1 Answers1

0

If you would like to set the logoView and the attributionButton margins to different values when the device is rotated, you need to access the MGLOrnamentPosition enumeration using the following code:

 if UIDevice.current.orientation.isLandscape {
     mapView.logoViewMargins = CGPoint()
     mapView.attributionButtonMargins = CGPoint()
 }

where CGPoint would reference the appropriate x and y values for your device.

invaderzizim
  • 311
  • 1
  • 5