Angular controller

controller source

Description

Controller for management of deafult HSLayers layer manager template

Methods

addDrawingLayer

Create new vector layer for drawing features by user

dateToNonUtc (d)

Convert date to non Utc format

Parameters

NameTypeDescription
d Date

Date to convert

dragged (event, index, item, type, external, layerTitles)

Parameters

NameTypeDescription
event unknow
index unknown
item unknown
type unknown
external unknown
layerTitles Array

Array of layer titles of group in which layer should be moved in other position Callback for dnd-drop event to change layer position in layer manager structure (drag and drop action with layers in layer manager - see https://github.com/marceljuenemann/angular-drag-and-drop-lists for more info about dnd-drop).

getExtentFromBoundingBoxAttribute (layer)

(PRIVATE) Get transformated extent from layer "BoundingBox" property

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

hasBoxLayers

Test if box layers are loaded

isLayerInResolutionInterval (lyr)

Test if layer (WMS) resolution is within map interval

Parameters

NameTypeDescription
lyr Ol.layer

Selected layer

isLayerQueryable (layer_container)

Test if layer is queryable (WMS layer with Info format)

Parameters

NameTypeDescription
layer_container object

Selected layer - wrapped in layer object

isLayerRemovable (lyr)

Check if layer can be removed based on 'removable' layer attribute

Parameters

NameTypeDescription
lyr Ol.layer

OL layer to check if removable

isLayerWithDimensions (lyr)

Test if layer has dimensions

Parameters

NameTypeDescription
lyr Ol.layer

Selected layer

isLayerWMS (layer)

Test if layer is WMS layer

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

isScaleVisible (layer)

Test if layer has min and max relolution set

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

layerIsStyleable (layer)

Determines if layer is a Vector layer and styleable. Used for allowing styling

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

layerIsZoomable (layer)

Determines if layer has BoundingBox defined as its metadata or is a Vector layer. Used for setting visibility of 'Zoom to ' button

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

layerLoaded (layer)

Test if selected layer is loaded in map

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

layerValid (layer)

Test if selected layer is valid (true for invalid)

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

removeAllLayers (confirmed, loadComp)

Removes all layers which don't have 'removable' attribute set to false. If removal wasn´t confirmed display dialog first. Might reload composition again

Parameters

NameTypeDescription
confirmed Boolean

Whether removing was confirmed (by user/code), (true for confirmed, left undefined for not)

loadComp Boolean

Whether composition should be loaded again (true = reload composition, false = remove without reloading)

removeLayer (layer)

Removes layer from map object

Parameters

NameTypeDescription
layer Ol.layer

Layer to remove

setLayerOpacity (layer)

Set selected layers opacity and emits "compositionchanged"

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

setLayerResolution (layer)

Set max and min resolution for selected layer (with layer params changed in gui)

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

setOpacity (layer)

Set selected layers opacity and emits "compositionchanged"

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

setTitle

styleLayer (layer)

Display styler panel for selected layer, so user can change its style

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

toggleCurrentLayer (layer, index)

Opens detailed panel for manipulating selected layer and viewing metadata

Parameters

NameTypeDescription
layer object

Selected layer to edit or view - Wrapped layer object

index number

Position of layer in layer manager structure - used to position the detail panel after layers li element

toggleLayerRename

Toogle layer rename control on panel (through layer rename variable)

zoomToLayer (layer)

Zoom to selected layer (layer extent). Get extent from bounding box property, getExtent() function or from BoundingBox property of GetCapabalities request (for WMS layer)

Parameters

NameTypeDescription
layer Ol.layer

Selected layer