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 128

Get the projection of the source.

Returns:
Projection.

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

source/Source.js, line 143

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

Returns:
State.

refresh()

source/Source.js, line 158

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

setAttributions(attributions)

source/Source.js, line 169

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.