Angular service

service source

Description

Service for core layers management. Maintain layer management structures and connect layer manager with map.Automatically update manager when layer is added or removed from map.

Methods

activateTheme (theme)

Show all layers of particular layer group (when groups are defined)

Parameters

NameTypeDescription
theme ol.layer.Group

Group layer to activate

boxLayersInit

Initilaze box layers and their starting active state

changeBaseLayerVisibility ($event, layer)

Change visibility (on/off) of baselayers, only one baselayer may be visible

Parameters

NameTypeDescription
$event object

Info about the event change visibility event, used if visibility of only one layer is changed

layer object

Selected layer - wrapped layer object (layer.layer expected)

changeBaseLayerVisibility ($event, layer)

Change visibility (on/off) of baselayers, only one baselayer may be visible

Parameters

NameTypeDescription
$event object

Info about the event change visibility event, used if visibility of only one layer is changed

layer object

Selected layer - wrapped layer object (layer.layer expected)

changeLayerVisibility (visibility, layer)

Change visibility of selected layer. If layer has exclusive setting, other layers from same group may be turned unvisible

Parameters

NameTypeDescription
visibility Boolean

Visibility layer should have

layer Object

Selected layer - wrapped layer object (layer.layer expected)

getLayerByTitle (Hslayers)

(PRIVATE) Get layer by its title

Parameters

NameTypeDescription
Hslayers Object

layer

getMyLayerPosition (layer)

(PRIVATE) Get position of selected layer in map layer order

Parameters

NameTypeDescription
layer Ol.layer

Selected layer

init

Initialization of needed controllers, run when map object is available

isLayerInResolutionInterval (lyr)

Test if layer (WMS) resolution is within map interval

Parameters

NameTypeDescription
lyr Ol.layer

Selected layer

layerRemoved (e)

Callback function for removing layer. Clean layers variables

Parameters

NameTypeDescription
e ol.CollectionEvent

Events emitted by ol.Collection instances are instances of this type.

loadingEvents (layer)

Create events for checking if layer is being loaded or is loaded for ol.layer.Image or ol.layer.Tile

Parameters

NameTypeDescription
layer ol.layer

Layer which is being added

removeAllLayers

Remove all layers from map

updateLayerOrder

Update "position" property of layers, so layers could be correctly ordered in GUI

cleanFolders (lyr)

Remove layer from layer folder structure a clean empty folder

Parameters

NameTypeDescription
lyr ol.Layer

Layer to remove from layer folder

getLayerTitle (Layer) -> String

Get title of selected layer Move to utils?

Parameters

NameTypeDescription
Layer Ol.layer

to get layer title

Returns

TypeDescription
String

Layer title or "Void"

getLegendUrl (source_url, layer_name) -> Boolean

Prepare URL for GetLegendGraphic WMS request, expect wms version 1.3.0 and sld version 1.1.0

Parameters

NameTypeDescription
source_url String

Url of WMS server

layer_name String

Name of layer to get graphic legend

Returns

TypeDescription
Boolean

Full Url for request

getLegendUrl () -> Boolean

Parameters

NameTypeDescription
Object

Returns

TypeDescription
Boolean

getLegendUrl () -> Boolean

Parameters

NameTypeDescription
Object

Returns

TypeDescription
Boolean

getLegendUrl () -> Boolean

Parameters

NameTypeDescription
Object

Returns

TypeDescription
Boolean

getLegendUrl () -> Boolean

Parameters

NameTypeDescription
Object

Returns

TypeDescription
Boolean

layerAdded (e)

Function for adding layer added to map into layer manager structure. In service automatically used after layer is added to map. Layers which shouldn´t be in layer manager (show_in_manager property) aren´t added. Loading events and legends URLs are created for each layer. Layers also get automatic watcher for changing visibility (to synchronize visibility in map and layer manager.) Position is calculated for each layer and for time layers time properties are created. Each layer is also inserted in correct layer list and inserted into folder structure.

Parameters

NameTypeDescription
e ol.CollectionEvent

Event object emited by Ol add layer event

populateFolders (lyr)

Place layer into layer manager folder structure based on path property hsl-path of layer

Parameters

NameTypeDescription
lyr Object

Layer to add into folder structure