Skip to content

Attribution

Attribution is the copyright attribution control. It extends Control. It displays data source or copyright information on the map, usually by default at the bottom-left corner. Use setContent to dynamically update the attribution content.

js
import { Attribution } from "maptalks";

const attribution = new Attribution({
  content: "© OpenStreetMap contributors"
}).addTo(map);

Constructor

js
new Attribution(options)

Parameters:

  • options — Attribution control options.

options

NameTypeDescriptionDefault
positionObjectThe control position{ bottom: 0, left: 0 }
contentString / HTMLElementThe attribution content'<a href="http://maptalks.org" target="_blank">maptalks</a>'
customBooleanWhether custom content is usedfalse

Member Methods

  • getContent(): String — Gets the attribution content.
  • setContent(content): Attribution — Sets the attribution content.