mapbox / mapbox-gl-leaflet

binding from Mapbox GL JS to the Leaflet API
ISC License
522 stars 154 forks source link

Mapbox logo/attribution controls not visible #147

Open thully opened 3 years ago

thully commented 3 years ago

It seems that the attribution controls are not visible by default in mapbox-gl-leaflet. The text attribution is disabled by default, and while the logo renders, it appears outside of the visible bounds of the Leaflet map, and even if you eliminate the padding (so that the size of the mapbox and Leaflet maps are the same), the z-index makes it render behind the map. The same applies to Mapbox's attribution control if it is manually enabled.

The problem with this is that a licensing requirement for Mapbox is to display attribution and the logo: https://docs.mapbox.com/help/getting-started/attribution/

Unlike vanilla Mapbox GL JS, Mapbox GL Leaflet does not comply by default. As such, users of the tool must either make changes to make the default attribution visible, or add Leaflet for this (Leaflet provides an attribution control, though you'd need another control for the logo). In my case I've created custom Leaflet controls that take the Mapbox controls and add them to the corresponding corners of the Leaflet map. However, it would be better if this were not necessary.