Class: MapZone

ol.control. MapZone

A control to jump from one zone to another.


new MapZone( [options])

Parameters:
Name Type Argument Description
options Object <optional>

Control options.

Properties
Name Type Description
className string

class name

zone Array.<any>

an array of zone: { name, extent (in EPSG:4326) }

layer ol.layer.Layer | function

layer to display in the control or a function that takes a zone and returns a layer to add to the control

projection ol.ProjectionLike

projection of the control, Default is EPSG:3857 (Spherical Mercator).

centerOnClick bolean

center on click when a zone is clicked (or listen to 'select' event to do something), default true

Fires:
  • event:select

Extends

Members


<static> zones

Pre-defined zones

Methods


addZone(z, title, extent, map [, layer])

Add a new zone to the control

Parameters:
Name Type Argument Description
z Object
title string
extent ol.extent

if map is not defined

map ol.Map

if map is defined use the map extent

layer ol.layer.Layer <optional>

layer of the zone, default use default control layer


getCollapsed()

Get control collapsed

Returns:
Type
boolean

getLength()

Get nb zone


getMaps()

Get associated maps

Returns:
Type
ol.Map

removeZone(index)

Remove a zone from the control

Parameters:
Name Type Description
index number

setCollapsed(b)

Collapse the control

Parameters:
Name Type Description
b boolean

setVisible(b)

Show the control

Parameters:
Name Type Description
b boolean