Angular service

service source

Description

Contains map object and few utility functions working with whole map. Map object get initialized with default view specified in config module (mostly in app.js file), and basic set of hs.map.service#interactions interactions.

Methods

findLayerByTitle (title) -> Ol.layer

Find layer object by title of layer

Parameters

NameTypeDescription
title string

Title of the layer (from layer creation)

Returns

TypeDescription
Ol.layer

Ol.layer object

getMap

Get ol.map object from service

init

Initialization function for HSLayers map object. Initialize map with basic interaction, scale line and watcher for map view changes. When default controller is used, its called automaticaly, otherwise its must be called before other modules dependent on map object are loaded.

isLayerVisible (lyr, visible_layers) -> Boolean

Determine if layer is visible, either by its visibility status in map, or by its being in visible_layers group

Parameters

NameTypeDescription
lyr ol.Layer

Layer for which to determine visibility

visible_layers Array

Layers which should be programmticaly visible

Returns

TypeDescription
Boolean

Detected visibility of layer

proxifyLayerLoader (lyr, tiled)

Proxify layer loader to work with layers from other sources than app

Parameters

NameTypeDescription
lyr Ol.layer

Layer to proxify

tiled Boolean

Info if layer is tiled

puremap

Clean interactions and zoom from map to get pure map

repopulateLayers (visible_layers)

Add all layers from app config (box_layers and default_layers) to the map. Only layers specified in visible_layers parameter will get instantly visible.

Parameters

NameTypeDescription
visible_layers object

List of layers, which should be visible.

reset

Reset map to state configured in app config (reload all layers and set default view)

resetView

Reset map view to view configured in app config