Readonly
centerReturns the current center of the map.
Same as olView.getCenter()
, but reactive.
Readonly
containerThe container in which the map is currently being rendered. This is the same as the target element of the underlying OpenLayers map.
May be undefined if the map is not being rendered at the moment. May change at runtime.
Readonly
idThe unique id of the map.
Readonly
initialThe initial map extent.
May be undefined before the map is shown. This is guaranteed to be initialized if the promise returned by whenDisplayed has resolved.
Readonly
layersContains all known layers of this map.
Note that not all layers in this collection may be active in the OpenLayers map. Also note that not all layers in the OpenLayers map may be contained in this collection.
Readonly
olThe raw OpenLayers map.
Readonly
olReturns the current view of the OpenLayers map.
Readonly
projectionReturns the current projection of the map (reactive).
Readonly
resolutionReturns the current resolution of the map.
Same as olView.getResolution()
, but reactive.
Readonly
scaleReturns the current scale of the map.
The scale is a value derived from the current center
, resolution
and projection
of the map.
The scale will change when the map is zoomed in our out, but depending on the projection, it may also
change when the map is panned.
NOTE: Technically, this is the denominator of the current scale. In order to display it, use a format like
1:${scale}
.
Readonly
zoomReturns the current zoom level of the map.
Same as olView.getZoom()
, but reactive.
Creates a highlight at the given targets.
A highlight is a temporary graphic on the map that calls attention to a point or an area.
Call destroy()
on the returned highlight object to remove the highlight again.
Optional
options: HighlightOptionsOptional
options: HighlightZoomOptionsRemoves any existing highlights from the map.
Changes the current scale of the map to the given value.
Internally, this computes a new zoom level / resolution based on the scale
and the current center.
The new resolution is then applied to the current olView
.
See also scale.
Returns a promise that resolves when the map has mounted in the DOM.
Zooms to the given targets.
Optional
options: ZoomOptions
Represents a map.