Change the default position for attribution
Replicates the MapLibre example Change the default position for attribution.
The complete document
Section titled “The complete document”# yaml-language-server: $schema=https://docs.maplibre-yaml.org/schema/latest/map.schema.json# Gallery twin of https://maplibre.org/maplibre-gl-js/docs/examples/change-the-default-position-for-attribution/type: mapid: change-the-default-position-for-attributionconfig: center: [-77.0353, 38.8895] zoom: 12 mapStyle: "https://demotiles.maplibre.org/style.json"# customAttribution gives the control text: declaring controls.attribution# replaces the built-in control, and if neither it nor any source# contributes attribution text the control renders empty — i.e. invisible.controls: attribution: position: top-left customAttribution: "MapLibre demo tiles"What to notice
Section titled “What to notice”- Declaring
controls.attributionreplaces the built-in control;positiontakes any of the four corners. customAttributionmatters here: the replacement control only shows source-contributed attribution text, and if there is none it renders empty — invisible. Give it content when your basemap carries no attribution of its own.