Class: Attribution

ol.Attribution


import Attribution from 'ol/attribution';

An attribution for a layer source.

Example:

source: new ol.source.OSM({
  attributions: [
    new ol.Attribution({
      html: 'All maps © ' +
          '<a href="https://www.opencyclemap.org/">OpenCycleMap</a>'
    }),
    ol.source.OSM.ATTRIBUTION
  ],
..

new ol.Attribution(options)

src/ol/attribution.js, line 29
Name Type Description
options

Attribution options.

Name Type Description
html string

HTML markup for this attribution. Required.

Methods

getHTML(){string}

src/ol/attribution.js, line 51

Get the attribution markup.

Returns:
The attribution HTML.