Class: OverviewMap

ol/control/OverviewMap~OverviewMap


import OverviewMap from 'ol/control/OverviewMap';

Create a new control with a map acting as an overview map for an other defined map.

new OverviewMap(opt_options)

control/OverviewMap.js, line 66
Name Type Description
options

OverviewMap options.

Name Type Default Description
className string 'ol-overviewmap'

CSS class name.

collapsed boolean true

Whether the control should start collapsed or not (expanded).

collapseLabel string | HTMLElement '«'

Text label to use for the expanded overviewmap button. Instead of text, also an element (e.g. a span element) can be used.

collapsible boolean true

Whether the control can be collapsed or not.

label string | HTMLElement '»'

Text label to use for the collapsed overviewmap button. Instead of text, also an element (e.g. a span element) can be used.

layers Array.<module:ol/layer/Layer~Layer> | module:ol/Collection~Collection.<module:ol/layer/Layer~Layer>

Layers for the overview map. If not set, then all main map layers are used instead.

render function

Function called when the control should be re-rendered. This is called in a requestAnimationFrame callback.

target HTMLElement | string

Specify a target if you want the control to be rendered outside of the map's viewport.

tipLabel string 'Overview map'

Text label to use for the button tip.

view module:ol/View~View

Custom view for the overview map. If not provided, a default view with an EPSG:3857 projection will be used.

Methods

getCollapsed(){boolean}

control/OverviewMap.js, line 555

Determine if the overview map is collapsed.

Returns:
The overview map is collapsed.

getCollapsible(){boolean}

control/OverviewMap.js, line 516

Return true if the overview map is collapsible, false otherwise.

Returns:
True if the widget is collapsible.

getOverviewMap(){module:ol/PluggableMap~PluggableMap}

control/OverviewMap.js, line 564

Return the overview map.

Returns:
Overview map.

setCollapsed(collapsed)

control/OverviewMap.js, line 543

Collapse or expand the overview map according to the passed parameter. Will not do anything if the overview map isn't collapsible or if the current collapsed state is already the one requested.

Name Type Description
collapsed boolean

True if the widget is collapsed.

setCollapsible(collapsible)

control/OverviewMap.js, line 525

Set whether the overview map should be collapsible.

Name Type Description
collapsible boolean

True if the widget is collapsible.

setMap()

control/OverviewMap.js, line 233