Angular service

service_parser source

Description

Contains function of managing composition (loading, removing Layers)

Methods

jsonToLayer (lyr_def) -> Function

Select correct layer parser for input data based on layer "className" property (HSLayers.Layer.WMS/OpenLayers.Layer.Vector)

Parameters

NameTypeDescription
lyr_def Object

Layer to be created (encapsulated in layer definition object)

Returns

TypeDescription
Function

Parser function to create layer (using config_parsers service)

jsonToLayers (composition) -> Array

Parse composition object to extract individual layers and add them to map

Parameters

NameTypeDescription
composition Object

Composition object with Layers

Returns

TypeDescription
Array

Array of created layers

load (url, overwrite, callback, pre_parse)

Load selected composition from server, parse it and add layers to map. Optionally (based on app config) may open layer manager panel

Parameters

NameTypeDescription
url String

Url of selected composition

overwrite Boolean

Whether overwrite current composition in map - remove all layers from maps which originate from composition (if not pasted, it counts as "true")

callback Function

Optional function which should be called when composition is successfully loaded

pre_parse Function

Optional function for pre-parsing loaded data about composition to accepted format

loadInfo (url) -> Object

Send Ajax request to selected server to gain information about composition

Parameters

NameTypeDescription
url String

Url to composition info

Returns

TypeDescription
Object

Object containing composition info

removeCompositionLayers

Remove all layers gained from composition from map