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 30
Name Type Description
options

Attribution options.

Name Type Description
html string

HTML markup for this attribution. Required.

Deprecated
  • This class is deprecated and will removed in the next major release.

    Methods

    getHTML(){string}

    src/ol/attribution.js, line 52

    Get the attribution markup.

    Returns:
    The attribution HTML.