Search code examples
gismapbox-glmapbox-gl-js

How do I add custom attribution to the default mapbox-gl attribution control?


attributionControl: true

Does nothing. Where do I need to put the attribution in the mapbox-gl style so that it shows up in the control?


Solution

  • For those that still wondering about this. Mapbox have made a good workaround for this as described in Mapbox issue #1485.

    I'm simply copying the solution provided by a collaborator of Mapbox:

    map.addSource('attribution', {
    type: 'geojson',
    data: {
      type: 'FeatureCollection',
      features: []
    },
    attribution: 'Your custom attribution'
    });