Methods

(inner) changeEnd()

The changeEnd method assigned to the mapview [this] will be triggered by the Openlayers mapview.Map moveend event.

The changeEnd method stores the current view parameters lat, lng, z in the locale view.

The view parameters will also be set as url params with hooks option priovided to the mapview decorator.

(inner) decorate(mapview) → {mapview}

The mapview decorator method decorates the mapview object param as a typedef mapview object.

The mapview decorator may return the async mapviewPromise method which must be awaited if svgTemplates must be loaded or syncPlugins must be executed.

Parameters:
NameTypeDescription
mapviewobject

JSON params for a new mapview.

Properties
NameTypeAttributesDefaultDescription
mapview.hoststring<optional>
mapp.host

The host domain/path for queries.

mapview.localeobject

The locale defintion for the mapview.

locale.svgTemplatesObject<optional>

Object of template key and src values to be loaded as svg strings. locale.svg_templates is the legacy property.

locale.syncPluginsarray<optional>

An array plugins to be loaded in order.

Returns:

Decorated Mapview.

Type: 
mapview

(inner) mapviewControls(mapview)

The method parses mapview control configs in the locale and creates the mapview.controls array of openlayer map control elements.

An array of mapviewControls, eg. mapviewControls = ['Zoom'] can be defined to add the control to the mapview.Map on creation.

Parameters:
NameTypeDescription
mapviewobject

JSON params for the new mapview.Map.

Properties
NameTypeAttributesDescription
mapview.localelocale

The mapview locale.

locale.mapviewControlsarray<optional>

Array of openlayers map controls eg. 'Zoom'.

locale.showScaleBarboolean<optional>

Legacy config to show metric ScaleLine.

locale.scalebarstring<optional>

Legacy config to define ScaleLine units.

locale.ScaleLinestring<optional>

String configuration for openlayers ScaleLine units ['metric' or 'imperial'].

(async, inner) mapviewPromise(mapview) → {Promise.<mapview>}

mapviewPromise is an async method which resolves to the mapview object. The method is returned from the mapview decorator if the creation of the mapview must be awaited in order to import and execute synchronous plugin methods or load svg_templates required for synchronous feature style render methods.

Parameters:
NameTypeDescription
mapviewobject
Properties
NameTypeAttributesDescription
mapview.localelocale

The locale defintion for the mapview.

locale.pluginsarray

Array of plugins to dynamically import.

locale.syncPluginsarray<optional>

Array of plugins [key] to be executed in sync.

locale.svgTemplatesarray<optional>

Array of svg_templates [objects] to be loaded.

Returns:

The async method resolves to the decorated mapview object.

Type: 
Promise.<mapview>

(inner) viewConfig(mapview)

The method sets the view config for the mapview.

Parameters:
NameTypeDescription
mapviewobject

JSON params for a new mapview.

Properties
NameTypeAttributesDefaultDescription
mapview.viewobject<optional>

The view config.

view.lngfloat<optional>
0

Longitude

view.latfloat<optional>
0

Latitude

(inner) viewExtent(mapview)

The methods checks the locale extent configuration and sets the view extent.

Parameters:
NameTypeDescription
mapviewobject

JSON params for a new mapview.

Properties
NameTypeAttributesDescription
mapview.localelocale

The mapview locale.

mapview.viewobject<optional>

The view config.

locale.extentobject<optional>

The locale/view extent.

(inner) viewMask(mapview)

A mask layer will be added to the mapview map if the mask flag is set in the locale.extent.

Parameters:
NameTypeDescription
mapviewobject

JSON params for a new mapview.

Properties
NameTypeAttributesDescription
mapview.localelocale

The mapview locale.

locale.extentobject<optional>

The locale/view extent.

extent.maskboolean<optional>

Apply mask layer to the view extent.