Attributions
Scope
This plugin shows attributions (that is, legal information) regarding copyrights and sources of the currently visible layers.
Configuration
attributions
All parameters are optional. However, setting neither layerAttributions
nor staticAttributions
results in an empty window.
fieldName | type | description |
---|---|---|
buttonComponent | VueContructor? | If renderType is set to 'independent' , this component is used as the button to open the attributions. |
icons | Record<string, string>? | Optional icon override. |
initiallyOpen | boolean? | Whether the information box is open by default. Only usable when renderType is set to 'independent', otherwise the IconMenu handles this. |
layerAttributions | layerAttribution[]? | List of attributions that are shown when the matching layer is visible. |
listenToChanges | string[]? | Store variable paths to listen to for changes. Will update the currently visible layers depending on the current map state on changes to these values. Please mind that, when referencing another plugin, that plugin must be in addPlugins before this one. |
renderType | 'iconMenu' | 'independent' | 'footer'? | Defines whether this plugin ('independent') or the IconMenu ('iconMenu') should handle opening the information box or if a small information box should always be visible ('footer'). Defaults to 'independent'. |
staticAttributions | string[]? | List of static attributions that are always shown. May contain HTML elements. |
windowWidth | number? | If renderType is set to independent , sets the width of the container of the attributions. Defaults to 500. |
For details on the displayComponent
attribute, refer to the Global Plugin Parameters section of @polar/core
.
Example configuration:
attributions: {
initiallyOpen: false,
windowWidth: 300,
renderType: 'independent',
listenToChanges: [
'plugin/zoom/zoomLevel',
'plugin/layerChooser/activeBackgroundId',
],
layerAttributions: [
{
id: basemapId,
title: 'Basemap',
},
{
id: subway,
title: 'Subway',
},
],
staticAttributions: [
'<a href="https://www.hamburg.de/impressum/" target="_blank">Impressum</a>',
],
}
attributions.icons
fieldName | type | description |
---|---|---|
close | string? | Icon shown when pressing the button closes the attributions. Defaults to 'fa-chevron-right' . |
open | string? | Icon shown when pressing the button opens the attributions. Defaults to 'fa-regular fa-copyright' . |
attributions.layerAttribution
fieldName | type | description |
---|---|---|
id | string | ID of service the attribution relates to. The text will only be shown when the layer is visible. |
title | string | Attribution text or localization key. May contain HTML. The tags <YEAR> and <MONTH> are translated to the current year or month respectively. |
Example configuration:
layerAttributions: [
{
id: basemapId,
title: 'Basemap © <YEAR>',
},
{
id: subway,
title: 'Subway',
},
]
Locales
Locale Key | German default | English default |
---|---|---|
plugins.attributions.button.closeTitle | Quellennachweis ausblenden | Hide Attributions |
plugins.attributions.button.openTitle | Quellennachweis einblenden | Show Attributions |
plugins.attributions.sourceCode | Quellcode lizenziert unter EUPL v1.2 | Source code licensed under EUPL v1.2 |
plugins.attributions.title | Quellennachweis | Attributions |