Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove MapBox logo from bottom left corner?

I'm embeding a MapBox map in my html page via mapbox.js script like so:

L.mapbox.accessToken = 'pk.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxx';
var map = L.mapbox.map('map', 'xxxxx.xxxxxxxx', {
    zoomControl: false
});

This produces a map like this: http://s4.postimg.org/58m4aeb8d/mapbox.png

How do I remove "Mapbox" logo in the bottom left corner?

like image 238
lateo Avatar asked May 19 '15 08:05

lateo


2 Answers

You can only completely remove the attribution on maps that do not contain Mapbox (Streets, Terrain, Satellite) or OpenStreetMap layers. This is because the OpenStreetMap and DigitalGlobe data contained in these layers legally require attribution.

If your map doesn’t include these layers, you can remove the default attribution by setting the info control to false:

var map = L.mapbox.map('map', 'examples.map-8ced9urs', {attributionControl: false});

You can add your own attribution by using the L.control.attribution constructor.

var credits = L.control.attribution().addTo(map);
credits.addAttribution('Credits: Penny Dog Mapping Co.');

You can, however, move the attribution. If you are using a layer that requires attribution, but want to move it to a different part of the page, you can insert this HTML snippet elsewhere on the page, like a page footer:

<a href='https://www.mapbox.com/about/maps/' target='_blank'>Maps &copy; Mapbox &copy; OpenStreetMap</a>
like image 188
Dave Avatar answered Sep 29 '22 16:09

Dave


This may violate the MapBox terms of service. Adding this css will remove it...

.mapbox-logo{
    display: none !important;
}
like image 31
max kaplan Avatar answered Sep 29 '22 17:09

max kaplan