AttributionControl.js

AttributionControl()


constructor

AttributionControl class is responsible for displaying attribution information on the map. Controls should be added using Map

Options:
  • separator(String)The separator between attribution texts (default: ' | ')
  • prefix(String)The prefix that will be added before the attribution texts (default: '')
  • offset(Array)The offset in pixels from the control's original position (default: [0, 0])
  • fontSize(Number)The size of attribution texts' font (default: 10)
  • fontFamily(String)The family of the attribution texts' font (default: 'Tahoma')
  • opacity(Number)The opacity of the control. Values from 0 to 1 (default: 0.5)
Parameter Type Description
options Object The options of the control

addAttribution()


method

Adds a text to attribution text collection

Parameter Type Description
text String The text to add to the attribution text collection
returns
AttributionControl - The control instance

removeAttribution()


method

Removes a text from attribution text collection

Parameter Type Description
text String The text to remove from the attribution text collection
returns
AttributionControl - The control instance

getAttributionIndex()


method

Returns the index of the text in the attribution text collection

Parameter Type Description
text String The text to search for
returns
Number - The index of the text in the attribution text collection