new cercalia.service.Distance(options)
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
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
-
getClass(){string}
-
Returns the object type.
-
getDestination(){cercalia.LonLat}
-
Returns:
Returns the destination assigned previously
-
Returns:
Returns the origin assigned previously
-
getSteps(){Array.<cercalia.LonLat>}
-
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
-
setOrigin(lonLat)
-
Name Type Description lonLat
cercalia.LonLat Assign the origin of distance calculation
-
setSteps(steps)
-
Name Type Description steps
Array.<cercalia.LonLat> Array with steps
-
setWeight(weight)
-
Name Type Description weight
string