Javascript – How to remove MapBox logo from bottom left corner

javascriptmapbox

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?

Best Solution

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>