Namespace: Map

ol. Map

The map is the core component of OpenLayers. For a map to render, a view, one or more layers, and a target container are needed:

See:

Methods


addFilter(filter)

Add a filter to an ol.Map

Parameters:
Name Type Description
filter ol.filter

animateFeature(feature, fanim)

Animate feature on a map

Parameters:
Name Type Description
feature ol.Feature

Feature to animate

fanim ol.featureAnimation | Array.<ol.featureAnimation>

the animation to play

Fires:
  • animationstart,event: animationend
Returns:

an object to control animation with start, stop and isPlaying function

Type
olx.animationControler

animExtent(point, options)

Pulse an extent on postcompose

Parameters:
Name Type Description
point ol.coordinates

to pulse

options ol.pulse.options

pulse options param

Properties
Name Type Description
projection ol.projectionLike | undefined

projection of coords, default no transform

duration Number

animation duration in ms, default 2000

easing ol.easing

easing function, default ol.easing.upAndDown

style ol.style.Stroke

stroke style, default 2px red


getFilters()

Get filters associated with an ol.Map

Returns:
Type
Array.<ol.filter>

hideTarget()

Hide the target overlay


markup(point, pulse)

Show a markup a point on postcompose

Parameters:
Name Type Description
point ol.coordinates

to pulse

pulse ol.markup.options

options param

    - projection {ol.projection|String|undefined} projection of coords, default none
    - delay {Number} delay before mark fadeout
    - maxZoom {Number} zoom when mark fadeout
    - style {ol.style.Image|ol.style.Style|Array<ol.style.Style>} Image to draw as markup, default red circle
Deprecated:
  • use map.animateFeature instead
Returns:

Unique key for the listener with a stop function to stop animation


pulse(point, pulse)

Pulse a point on postcompose

Parameters:
Name Type Description
point ol.coordinates

to pulse

pulse ol.pulse.options

options param

    - projection {ol.projection||String} projection of coords
    - duration {Number} animation duration in ms, default 3000
    - amplitude {Number} movement amplitude 0: none - 0.5: start at 0.5*radius of the image - 1: max, default 1
    - easing {ol.easing} easing function, default ol.easing.easeOut
    - style {ol.style.Image|ol.style.Style|Array<ol.style.Style>} Image to draw as markup, default red circle
Deprecated:
  • use map.animateFeature instead

removeFilter(filter)

Remove a filter to an ol.Map

Parameters:
Name Type Description
filter ol.filter

showTarget(coord)

Show a target overlay at coord

Parameters:
Name Type Description
coord ol.coordinate