Angular controller

controller source

Methods

activate

Activate route layer and routing interaction

addWayPoint (coordinate)

(PRIVATE) Add a way point to the list (computes Route for Shortest route operation)

Parameters

NameTypeDescription
coordinate ol.coordinate

clearAll

Clear route's vector source

clearSearchResults

Clear current search results

clearWayPoints

Clear drawn waypoints

clickHandler (evt)

(PRIVATE) Click handler for clicks, call handler by operation

Parameters

NameTypeDescription
evt ol.click.event

deactivate

Deactivate route layer and routing interaction, clear data

getReachableArea (fromNode, distance)

(PRIVATE) Calculate reachable area

Parameters

NameTypeDescription
fromNode Number

Node to compute area

distance Number

Maximum distance of area

getRouteDescription (geoJsonFeatures) -> array

(PRIVATE) Get route description as street list with their lengths

Parameters

NameTypeDescription
geoJsonFeatures GeoJSON

Returns

TypeDescription
array

description List of streetnames and distances

getShortestRoute (fromNode, toNode)

(PRIVATE) Calculate the shortest route

Parameters

NameTypeDescription
fromNode Number

Identifier of from node

toNode Number

Identifier of to node

moveDown (from)

Move selected waypoint down in order

Parameters

NameTypeDescription
from Number

Current position of waypoint in order

moveUp (from)

Move selected waypoint up in order

Parameters

NameTypeDescription
from Number

Current position of waypoint in order

optimalRouteClickHandler (evt)

(PRIVATE) Handler to be invoked when the optimal route operation is activated

Parameters

NameTypeDescription
evt ol.ClickEvent

optimizeRoute

Optimaze route for waypoints

reachableAreaClickHandler (evt)

(PRIVATE) Handler to be invoked when the reachable area operation is activated

Parameters

NameTypeDescription
evt ol.ClickEvent

setDefaultOperation

Set the default operation (Shortest route)

setOperation (operation)

Set routing operation and remove previous results and waypoints

Parameters

NameTypeDescription
operation String

Selected operation

shortestRouteClickHandler (evt)

(PRIVATE) Handler to be invoked when the shortest route operation is activated

Parameters

NameTypeDescription
evt ol.ClickEvent

trans (coordinate, inverse) -> ol.coordinate

(PRIVATE) Utility function to transform forward/inverse between 4326 - 3857

Parameters

NameTypeDescription
coordinate ol.coordinate

Coordinate to transform

inverse Boolean

Direction of transformation (true = 3857 -> 4326, false = 4326 -> 3857)

Returns

TypeDescription
ol.coordinate

p Transformated coordinate