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:
Methods
-
addFilter(filter)
-
Add a filter to an ol.Map
Parameters:
Name Type Description filterol.filter -
animateFeature(feature, fanim)
-
Animate feature on a map
Parameters:
Name Type Description featureol.Feature Feature to animate
fanimol.featureAnimation | Array.<ol.featureAnimation> the animation to play
Returns:
an object to control animation with start, stop and isPlaying function
- Type
- animationControler
-
animExtent(point, options)
-
Pulse an extent on postcompose
Parameters:
Name Type Description pointol.coordinates to pulse
optionsol.pulse.options pulse options param
Properties
Name Type Description projectionol.projectionLike | undefined projection of coords, default no transform
durationNumber animation duration in ms, default 2000
easingol.easing easing function, default ol.easing.upAndDown
styleol.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 pointol.coordinates to pulse
pulseol.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 pointol.coordinates to pulse
pulseol.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 filterol.filter -
showTarget(coord)
-
Show a target overlay at coord
Parameters:
Name Type Description coordol.coordinate