You are viewing an older version of Mapbox.js. Check out v3.1.0 for the latest.

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 getAttribution method automatically. Extends Control.

Creation

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

Options

Option Type Default Description
position String 'bottomright' The position of the control (one of the map corners). See control positions.
prefix String 'Leaflet' The HTML text shown before the attributions. Pass false to disable.

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; Mapbox').
removeAttribution( <String> text ) this Removes an attribution text.