Merge pull request #8804 from notnotse/issue/8621-disable-collapsible-attributions-for-osm
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=true] Attributions are collapsible.
|
||||
* @property {import("../proj.js").ProjectionLike} projection
|
||||
* @property {SourceState} [state='ready']
|
||||
* @property {boolean} [wrapX=false]
|
||||
@@ -66,6 +67,13 @@ class Source extends BaseObject {
|
||||
*/
|
||||
this.attributions_ = 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`.
|
||||
@@ -96,6 +104,13 @@ class Source extends BaseObject {
|
||||
return this.attributions_;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return {boolean} Aattributions are collapsible.
|
||||
*/
|
||||
getAttributionsCollapsible() {
|
||||
return this.attributionsCollapsible_;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the projection of the source.
|
||||
* @return {import("../proj/Projection.js").default} Projection.
|
||||
|
||||
Reference in New Issue
Block a user