Class: Source

ol/source/Source~Source


import Source from 'ol/source/Source';

Abstract base class; normally only used for creating subclasses and not instantiated in apps. Base class for module:ol/layer/Layer~Layer sources.

A generic change event is triggered when the state of the source changes.

new Source(options)

source/Source.js, line 49
Name Type Description
options

Source options.

Name Type Description
attributions module:ol/source/Source~AttributionLike
projection module:ol/proj~ProjectionLike
state module:ol/source/State
wrapX boolean

Methods

getProjection(){module:ol/proj/Projection~Projection}

source/Source.js, line 121

Get the projection of the source.

Returns:
Projection.

getState(){module:ol/source/State}

source/Source.js, line 136

Get the state of the source, see module:ol/source/State~State for possible states.

Returns:
State.

refresh()

source/Source.js, line 151

Refreshes the source and finally dispatches a 'change' event.

setAttributions(attributions)

source/Source.js, line 162

Set the attributions of the source.

Name Type Description
attributions module:ol/source/Source~AttributionLike | undefined

Attributions. Can be passed as string, Array<string>, module:ol/source/Source~Attribution, or undefined.