React component that wraps AttributionControl.
import * as React from 'react';
import Map, {AttributionControl} from 'react-map-gl';
function App() {
return <Map
initialViewState={{
longitude: -100,
latitude: 40,
zoom: 3.5
}}
mapStyle="mapbox://styles/mapbox/streets-v9"
{
// disable the default attribution
}
attributionControl={false}
>
<AttributionControl customAttribution="Map design by me" />
</Map>;
}
Note that the following properties are not reactive. They are only used when the component first mounts.
compact
: boolean | undefinedtrue
, force a compact attribution that shows the full attribution on mouse hover.false
, force the full attribution control.Note that your attribution must adhere to Mapbox's guidelines.
customAttribution
: string | string[]String or strings to show in addition to any other attributions.
position
: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left'Default: 'bottom-right'
Placement of the control relative to the map.
style
: CSSPropertiesCSS style override that applies to the control's container.