Add possibility to disable collapsible attributions from Source
This commit is contained in:
@@ -31,6 +31,7 @@ import SourceState from './State.js';
|
||||
/**
|
||||
* @typedef {Object} Options
|
||||
* @property {AttributionLike} [attributions]
|
||||
* @property {boolean} [attributionsCollapsible] Whether attributions should be collapsible.
|
||||
* @property {import("../proj.js").ProjectionLike} projection
|
||||
* @property {SourceState} [state]
|
||||
* @property {boolean} [wrapX]
|
||||
@@ -66,6 +67,13 @@ class Source extends BaseObject {
|
||||
*/
|
||||
this.attributions_ = this.adaptAttributions_(options.attributions);
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {boolean}
|
||||
*/
|
||||
this.attributionsCollapsible_ = options.attributionsCollapsible !== undefined ?
|
||||
options.attributionsCollapsible : true;
|
||||
|
||||
/**
|
||||
* This source is currently loading data. Sources that defer loading to the
|
||||
* map's tile queue never set this to `true`.
|
||||
@@ -120,6 +128,13 @@ class Source extends BaseObject {
|
||||
return this.attributions_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean} Should the attributions be collapsible or not.
|
||||
*/
|
||||
getAttributionsCollapsible() {
|
||||
return this.attributionsCollapsible_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the projection of the source.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
|
||||
Reference in New Issue
Block a user