5

In the copyright section of a Mapbox GL map using a Mapbox Studio style, I see the message "Improve this map", which links here (https://www.mapbox.com/map-feedback/). Where is this link stored or how can I remove it?

I can only set it false, but then no text is shown. I do want to credit Mapbox and OSM:

    var map = new mapboxgl.Map({
        container: 'map',
        style: 'mapbox://styles/myname/mystyle',
        attributionControl: false,
        center: [10, 30],
        zoom: 1
    });
4
  • I don't know for sure, but you might check to make sure that it is not a part of the license to have that attribution there. By the way, the link is in the 'attribution' option of the 'map'. The purpose of the link is to report something to be fixed in OpenStreetMap, since that is the data source of Mapbox styles.
    – Tangnar
    Commented Feb 3, 2016 at 14:16
  • I can only find the documentation for the leaflet API and not the mapbox-gl api: mapbox.com/help/attribution Commented Feb 3, 2016 at 14:46
  • oh, I see. I wonder if you can create your own attribution control and it will override the default?
    – Tangnar
    Commented Feb 3, 2016 at 14:53
  • The easiest workaround is just to create another <div> in the same container containing the text and floating it above the map. Probably needed at the moment: github.com/mapbox/mapbox-gl-js/issues/1485 Commented Feb 3, 2016 at 14:57

4 Answers 4

6

The current version of Mapbox GL JS doesn't let you programatically hide that link. You can hide it with CSS:

.mapbox-improve-map {
    display: none;
}

This assumes OpenStreetMap/Mapbox is ok with it, as @Tangnar mentioned.

Incidentally, even if you programatically disable map rotation, you still need to hide the rotation control button with CSS.

.mapboxgl-ctrl-compass { display: none; }
4
  • OpenStreetMap is not okay with it. If you ('a Dev', not the responder) want to use maps provided by volunteers for free then the least you can do is display their attribution statements to thank them.
    – jnicho02
    Commented Mar 5, 2021 at 11:43
  • 2021 solution, mapbox does not add easy to select css classes anymore, but currently improve map link is the last of 3, so something like this works .mapboxgl-ctrl-attrib-inner a:last-of-type { display: none; }
    – mwallisch
    Commented Aug 27, 2021 at 10:07
  • 1
    @jnicho02 On what basis do you say that OSM requires the "Improve this map" wording? Hiding it would still show the "(C) OpenStreetMap" wording. Commented Jan 19 at 0:47
  • Hi Steve, I take it back if the solutions being suggested block the a.mapbox-improve-map statement and not the whole mapboxgl-ctrl-attrib-inner. I notice that Mapbox themselves do this (2024).
    – jnicho02
    Commented Feb 16 at 13:57
0

In 2021, here's how I hid that section:

  .mapboxgl-ctrl-bottom-right {
     display: none;
  }
0

attributionEnabled={false}

Just giving a pointer, look for something similar in MapView. I am doing in React-Native and I have this property available. I disabled it and worked for me.

1
  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jun 25 at 17:44
0

Not a direct solution, but I would say the most ethically correct option (imo) if you don't like the 'improve this map' on your map at any time, but still would like to credit Mapbox / OSM - would be showing a compact version of the attribution, like so:

    var map = new mapboxgl.Map({
        container: 'map',
        style: 'mapbox://styles/myname/mystyle',
        attributionControl: false,
        center: [10, 30],
        zoom: 1
    }).addControl(new mapboxgl.AttributionControl({compact: true}));

Don't forget that in order to show compact version you need to remove the classic attribution with attributionControl: false.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.