Angular service

service source

Description

Contains geolocation services, for mobile version through navigator.geolocation API, for classic version through OpenLayers ol.Geolocation class

Methods

changed_handler

(Only for Desktop) Change handler of ol.Geolocation object (for desktop use)

gpsFailCallback (e)

(PRIVATE) (Only for Mobile) Callback for handling geolocation error

Parameters

NameTypeDescription
e object

Position fail object

gpsOkCallback (position)

(PRIVATE) (Only for Mobile) Callback for handling successful location response, update location variables

Parameters

NameTypeDescription
position object

Position object

setCenter

(Only for Mobile) Center map on last location

startGpsWatch

(Only for Mobile) Start GPS tracking if possible, initialize Ol.geolocation handler

stopGpsWatch

(Only for Mobile) Stop GPS tracking and clears handlers

toggleFeatures (visible)

Set visibility of position layer on the map

Parameters

NameTypeDescription
visible Boolean

Visibility of position layer (true/false)

toggleGps

(Only for Mobile) Toggle (Start/Stop) GPS tracking, set display of position layer accordingly