mapbox / mapbox-maps-ios

Interactive, thoroughly customizable maps for iOS powered by vector tiles and Metal
https://www.mapbox.com/mapbox-mobile-sdk
Other
482 stars 157 forks source link

Logo can be hidden - is that expected? (attribution concern for new developers) #2012

Closed ax-vasquez closed 1 year ago

ax-vasquez commented 1 year ago

Environment

Observed behavior and steps to reproduce

I've noticed that one can simply set isHidden to true for the logoView in the OrnamentsManager. I recognize that the docs say to not do it this way, but since it does successfully remove the logo from the map (at least, when the MapView is created via a UIViewRepresentable - I haven't been testing this in UIKit, but SwiftUI), I'm concerned less wary developers may see that as an option and hide it to make the app "look nice". If that's not allowed, I imagine they would run the risk of having their access to the SDK revoked, but I'm not too sure.

Wouldn't this violate the Terms of using the SDK, since attribution is required? If not, that's also useful to know since it might be nice to hide the logo (and instead just keep the 'i' icon that renders the attribution toast).

Example custom UIViewRepresentable:

struct CustomMapView: UIViewRepresentable {
   func makeUIView(context: Context) -> MapView {
      // Code to set up MapView (ResourceOptions and whatnot)...
      let mapView = MapView(frame: .zero, mapInitOptions: myMapInitOptions)
      let manager = mapView.ornaments
      manager?.logoView.isHidden = true   // Offending line - hides the icon - should `isHidden` even exist on logoView if it shouldn't be hide-able?
      mapView.autoresizingMask = [.flexibleWidth, .flexibleHeight]
      return mapView
   }

   // Rest...
}

Expected behavior

Unsure - I expected this to not be an option for the logo since I thought it was required to always have it on the map

Notes / preliminary analysis

I am a bit rusty with iOS dev, so please forgive any ignorance in my statements here. Still brushing off some dust while pursuing a side project. In my day job, I am a senior web dev, so I do very little with mobile development.

Additional links and references

pjleonard37 commented 1 year ago

Hi @ax-vasquez -

Thanks for sharing this report. You are correct that hiding the logo is a violation of the terms of using the SDK (as is hiding the attribution for map data sources). We have more information on this in our attribution guide here as well as our Legal documentation here.

As for your broader concern about a developer unwittingly hiding the logo, this is a reasonable concern. In our in-code documentation we have additional notification that setting the visibility property is a restricted API (see here). Nonetheless, I'm going to take this back to our full team and consider other steps we could take here. Again, thanks for raising this and for experimenting with the SDK!