Class: Distance

cercalia.service.Distance

Class designed for route calculation.

new cercalia.service.Distance(options)

Name Type Description
options cercaliax.service.DistanceOptions

Params and options for distance calculation

Methods

calculate(callbackFn)

Distance calculation with the assigned parameters, and returns the data to the callback function specified by parameter by the user.

Name Type Description
callbackFn function

callback funcion

Returns the object type.

Returns:
Returns the destination assigned previously
Returns:
Returns the origin assigned previously
Returns:
destination

getWeight(){string}

Values = [line|time|distance|money]

Returns:
weight

isCalculateGeometry(){boolean}

Returns if calculate geometry function it's on or off

Returns:
calculateGeometry

setCalculateGeometry(calculateGeometry)

Name Type Description
calculateGeometry boolean

setDestination(lonLat)

Name Type Description
lonLat cercalia.LonLat

Destination

Name Type Description
lonLat cercalia.LonLat

Assign the origin of distance calculation

Name Type Description
steps Array.<cercalia.LonLat>

Array with steps

Name Type Description
weight string