Move AttributionOptions to ol/control/Attribution
This commit is contained in:
@@ -12,90 +12,6 @@ let olx;
|
|||||||
olx.control;
|
olx.control;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @typedef {{className: (string|undefined),
|
|
||||||
* collapsible: (boolean|undefined),
|
|
||||||
* collapsed: (boolean|undefined),
|
|
||||||
* tipLabel: (string|undefined),
|
|
||||||
* label: (string|Element|undefined),
|
|
||||||
* collapseLabel: (string|Element|undefined),
|
|
||||||
* render: (function(ol.MapEvent)|undefined),
|
|
||||||
* target: (Element|string|undefined)}}
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* CSS class name. Default is `ol-attribution`.
|
|
||||||
* @type {string|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.className;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specify a target if you want the control to be rendered outside of the map's
|
|
||||||
* viewport.
|
|
||||||
* @type {Element|string|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.target;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specify if attributions can be collapsed. If you use an OSM source,
|
|
||||||
* should be set to `false` — see
|
|
||||||
* {@link https://www.openstreetmap.org/copyright OSM Copyright} —
|
|
||||||
* Default is `true`.
|
|
||||||
* @type {boolean|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.collapsible;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specify if attributions should be collapsed at startup. Default is `true`.
|
|
||||||
* @type {boolean|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.collapsed;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Text label to use for the button tip. Default is `Attributions`
|
|
||||||
* @type {string|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.tipLabel;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Text label to use for the collapsed attributions button. Default is `i`.
|
|
||||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
|
||||||
* @type {string|Element|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.label;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Text label to use for the expanded attributions button. Default is `»`.
|
|
||||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
|
||||||
* @type {string|Element|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.collapseLabel;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Function called when the control should be re-rendered. This is called
|
|
||||||
* in a requestAnimationFrame callback.
|
|
||||||
* @type {function(ol.MapEvent)|undefined}
|
|
||||||
* @api
|
|
||||||
*/
|
|
||||||
olx.control.AttributionOptions.prototype.render;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {{element: (Element|undefined),
|
* @typedef {{element: (Element|undefined),
|
||||||
* render: (function(ol.MapEvent)|undefined),
|
* render: (function(ol.MapEvent)|undefined),
|
||||||
|
|||||||
@@ -1,24 +1,4 @@
|
|||||||
|
|
||||||
/**
|
|
||||||
* @typedef {Object} control_AttributionOptions
|
|
||||||
* @property {string|undefined} className CSS class name. Default is `ol-attribution`.
|
|
||||||
* @property {Element|string|undefined} target Specify a target if you want the control to be rendered outside of the map's
|
|
||||||
* viewport.
|
|
||||||
* @property {boolean|undefined} collapsible Specify if attributions can be collapsed. If you use an OSM source,
|
|
||||||
* should be set to `false` — see
|
|
||||||
* {@link https://www.openstreetmap.org/copyright OSM Copyright} —
|
|
||||||
* Default is `true`.
|
|
||||||
* @property {boolean|undefined} collapsed Specify if attributions should be collapsed at startup. Default is `true`.
|
|
||||||
* @property {string|undefined} tipLabel Text label to use for the button tip. Default is `Attributions`
|
|
||||||
* @property {string|Element|undefined} label Text label to use for the collapsed attributions button. Default is `i`.
|
|
||||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
|
||||||
* @property {string|Element|undefined} collapseLabel Text label to use for the expanded attributions button. Default is `»`.
|
|
||||||
* Instead of text, also an element (e.g. a `span` element) can be used.
|
|
||||||
* @property {function(ol.MapEvent)|undefined} render Function called when the control should be re-rendered. This is called
|
|
||||||
* in a requestAnimationFrame callback.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @typedef {Object} control_ControlOptions
|
* @typedef {Object} control_ControlOptions
|
||||||
* @property {Element|undefined} element The element is the control's container element. This only needs to be
|
* @property {Element|undefined} element The element is the control's container element. This only needs to be
|
||||||
|
|||||||
@@ -10,6 +10,34 @@ import {listen} from '../events.js';
|
|||||||
import EventType from '../events/EventType.js';
|
import EventType from '../events/EventType.js';
|
||||||
import {visibleAtResolution} from '../layer/Layer.js';
|
import {visibleAtResolution} from '../layer/Layer.js';
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} Options
|
||||||
|
* @property {string|undefined} className CSS class name. Default is
|
||||||
|
* `'ol-attribution'`.
|
||||||
|
* @property {Element|string|undefined} target Specify a target if you
|
||||||
|
* want the control to be rendered outside of the map's
|
||||||
|
* viewport.
|
||||||
|
* @property {boolean|undefined} collapsible Specify if attributions can
|
||||||
|
* be collapsed. If you use an OSM source, should be set to `false` — see
|
||||||
|
* {@link https://www.openstreetmap.org/copyright OSM Copyright} —
|
||||||
|
* Default is `true`.
|
||||||
|
* @property {boolean|undefined} collapsed Specify if attributions should
|
||||||
|
* be collapsed at startup. Default is `true`.
|
||||||
|
* @property {string|undefined} tipLabel Text label to use for the button
|
||||||
|
* tip. Default is `'Attributions'`
|
||||||
|
* @property {string|Element|undefined} label Text label to use for the
|
||||||
|
* collapsed attributions button. Default is `'i'`.
|
||||||
|
* Instead of text, also an element (e.g. a `span` element) can be used.
|
||||||
|
* @property {string|Element|undefined} collapseLabel Text label to use
|
||||||
|
* for the expanded attributions button. Default is `'»'`.
|
||||||
|
* Instead of text, also an element (e.g. a `span` element) can be used.
|
||||||
|
* @property {function(ol.MapEvent)|undefined} render Function called when
|
||||||
|
* the control should be re-rendered. This is called in a `requestAnimationFrame`
|
||||||
|
* callback.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @classdesc
|
* @classdesc
|
||||||
* Control to show all the attributions associated with the layer sources
|
* Control to show all the attributions associated with the layer sources
|
||||||
@@ -19,7 +47,7 @@ import {visibleAtResolution} from '../layer/Layer.js';
|
|||||||
*
|
*
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends {ol.control.Control}
|
* @extends {ol.control.Control}
|
||||||
* @param {olx.control.AttributionOptions=} opt_options Attribution options.
|
* @param {module:ol/control/Attribution~Options=} opt_options Attribution options.
|
||||||
* @api
|
* @api
|
||||||
*/
|
*/
|
||||||
const Attribution = function(opt_options) {
|
const Attribution = function(opt_options) {
|
||||||
|
|||||||
Reference in New Issue
Block a user