ProtecteddisposedThe object has already been disposed.
ProtectedrenderedKey name.
Listener.
Type.
Listener.
ProtectedapplyProtected
Apply any properties from another object without triggering events.
The source object.
This will clear the renderer so that a new one can be created next time it is needed
ProtectedcreateDispatches an event and calls all listeners listening for events
of this type. The event parameter can either be a string or an
Object with a type property.
Event object.
false if anyone called preventDefault on the
event object or if any of the listeners returned false.
Clean up.
ProtecteddisposeProtected
Extension point for disposable objects.
Get the attributions of the source of this layer for the given view.
Optionalview: OlView | ViewStateLayerStateExtent
View or import("../Map.js").FrameState. Only required when the layer is not added to a map.
Attributions for this layer at the given view.
Get the background for this layer.
Layer background.
CSS class name.
Pixel.
Pixel data.
Declutter
Pixel.
Promise that resolves with an array of features.
AbstractgetThis method is not meant to be called by layers or layer renderers because the state is incorrect if the layer is included in a layer group.
Optionalmanaged: boolean
Layer is managed.
Layer state.
AbstractgetOptionalstates: State[]
Optional list of layer states (to be modified in place).
List of layer states.
Get the listeners for a specified event type. Listeners are returned in the order that they will be called in.
Type.
Listeners.
Get an object of all property names and values.
Object.
Get an object of all property names and values.
Object.
The source being rendered.
AbstractgetSource state.
Optionaltype: string
Type. If not provided,
true will be returned if this event target has any listeners.
Has listeners.
The object has properties.
The layer has a renderer.
The layer is visible on the map view, i.e. within its min/max resolution or zoom and
extent, not set to visible: false, and not inside a layer group that is set
to visible: false.
Optionalview: OlView | ViewStateLayerStateExtent
View or import("../Map.js").FrameState. Only required when the layer is not added to a map.
The layer is visible in the map view.
Key name.
Old value.
ProtectedonceProtectedonKey name.
Listener.
Type.
Listener.
In charge to manage the rendering of the layer. One layer type is bounded with one layer renderer.
Frame state.
Target which the renderer may (but need not) use for rendering its content.
The rendered element.
Frame state.
Layer state.
When the renderer follows a layout -> render approach, do the final rendering here.
Frame state
Sets the background color.
Optionalbackground: BackgroundColor
Background color.
Sets the layer to be rendered on top of other layers on a map. The map will
not manage this layer in its layers collection. This
is useful for temporary layers. To remove an unmanaged layer from the map,
use #setMap(null).
To add the layer to a map and have it managed by the map, use :ol/Map~Map#addLayer instead.
Map.
ProtectedunProtected
Unlisten for a certain type of event.
Type.
Listener.
Called when a layer is not visible during a map render.
Classdesc
Base class from which all layer types are derived. This should only be instantiated in the case where a custom layer is added to the map with a custom
renderfunction. Such a function can be specified in theoptionsobject, and is expected to return an HTML element.A visual representation of raster or vector map data. Layers group together those properties that pertain to how the data is to be displayed, irrespective of the source of that data.
Layers are usually added to a map with [map.addLayer()]import("../Map.js").default#addLayer. Components like :ol/interaction/Draw~Draw use unmanaged layers internally. These unmanaged layers are associated with the map using [layer.setMap()]:ol/layer/Layer~Layer#setMap instead.
A generic
changeevent is fired when the state of the source changes. Asourcereadyevent is fired when the layer's source is ready.Fires
import("../render/Event.js").RenderEvent#prerender
Fires
import("../render/Event.js").RenderEvent#postrender
Fires
import("../events/Event.js").BaseEvent#sourceready
Api