Control.Attribution

The attribution control allows you to display attribution data in a small text box on a map. It is put on the map by default unless you set its attributionControl option to false, and it fetches attribution texts from layers with the getAttribution method automatically. Extends Control.

Creation

Factory Description
L.control.attribution(<Control.Attribution options> options) Creates an attribution control.

Options

Option Type Default Description
prefix String 'Leaflet' The HTML text shown before the attributions. Pass false to disable.
Option Type Default Description
position String 'topright' The position of the control (one of the map corners). Possible values are 'topleft', 'topright', 'bottomleft' or 'bottomright'

Methods

Method Returns Description
setPrefix(<String> prefix) this

Sets the text before the attributions.

addAttribution(<String> text) this

Adds an attribution text (e.g. 'Vector data &copy; OpenStreetMap contributors').

removeAttribution(<String> text) this

Removes an attribution text.

Method Returns Description
getPosition() string

Returns the position of the control.

setPosition(<string> position) this

Sets the position of the control.

getContainer() HTMLElement

Returns the HTMLElement that contains the control.

addTo(<Map> map) this

Adds the control to the given map.

remove() this

Removes the control from the map it is currently active on.

v1.1.0
Props Wrld.Prop
Themes Wrld.themes
Heatmaps Wrld.Heatmap
Events Event objects
Services (Optional) WrldPoiApi