Angular controller

controller source

Description

Main controller of default HSLayers map, initialize map service when default HSLayers template is used

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

init

Initialization of map object, initialize map and map state from permalink.

onCenterSync (data)

This gets called from Cesium map, to synchronize center and resolution between Ol and Cesium maps

Parameters

NameTypeDescription
data array

Coordinates in lon/lat and resolution

setTargetDiv (div_id) -> ol.Map

Sets div element of the map

Parameters

NameTypeDescription
div_id string

ID pf the container element

Returns

TypeDescription
ol.Map

zoomForResolution (resolution)

Calculates zoom level for a given resolution

Parameters

NameTypeDescription
resolution number

Resolution