mapbox / mapbox.js

Mapbox JavaScript API, a Leaflet Plugin
mapbox.com/mapbox.js/
Other
1.92k stars 386 forks source link

Fix for missing wordmark attribution on older mapbox.js maps #1314

Closed marenab closed 4 years ago

marenab commented 4 years ago

We were having some issues with missing attribution on maps built with a mapbox.js widget made by Action Network. And it looks like watermark attribution is missing from at least some of our older examples as well, like: https://docs.mapbox.com/mapbox.js/example/v1.0.0/

Jason from Action Network was able to figure out a solution :tada: and I thought I'd share it here in case anyone else has run into this:

I was able to get the logo to show up by setting a map ID per the second option here: https://docs.mapbox.com/mapbox.js/api/v3.2.1/l-mapbox-map/

So

map = L.mapbox.map('map_canvas');

became

map = L.mapbox.map('map_canvas','mapbox.streets');

Seems like you need to set that map ID or the logo won't show up, even though that's not a required option.