1

I'm wondering how do I move Mapbox's logo and the info button up a little on the map view. But anything I do doesn't seem to affect the map

enter image description here

--my first attempt to solve the problem

    let mapboxLogo = mapView.logoView
    mapView.logoView.isHidden = true
    let logoLeftConstraint = NSLayoutConstraint(item: mapboxLogo, attribute: NSLayoutAttribute.leading, relatedBy: .equal, toItem: mapView, attribute: NSLayoutAttribute.leading, multiplier: 1.0, constant: 8)
    let logoBottomConstraint = NSLayoutConstraint(item: mapboxLogo, attribute: NSLayoutAttribute.bottom, relatedBy: .equal, toItem: mapView, attribute: NSLayoutAttribute.bottom, multiplier: 1.0, constant: 32)

    mapboxLogo.translatesAutoresizingMaskIntoConstraints = false
    mapView.addConstraints([logoLeftConstraint, logoBottomConstraint])

    mapView.addSubview(mapboxLogo)

The result: enter image description here

Eric Aya
  • 69,473
  • 35
  • 181
  • 253
Daniel Espina
  • 614
  • 11
  • 24

1 Answers1

1

If you are on Mapbox Maps SDK for iOS v3.7.0, you should be able to do this by a couple of ways:

  1. Save the attribution button's action sheet. Then remove the original wordmark and attribution button, and place a new wordmark and attribution button in the desired location. Add the action sheet to the new attribution button.
  2. Remove the original constraints and add your own.

You can find more suggestions and sample code here.

jmkiley
  • 976
  • 5
  • 8
  • I came across that post before and it didn't help me. Maybe i'm not doing the constraints correctly? I'm not sure. I updated my post to include my attempt at this. – Daniel Espina Dec 01 '17 at 23:22