-
Name Type Description optionsParams and options for distance calculation
Name Type Description calculateGeometryboolean Specify if you need to obtain the shape geometry when calculating the distance. For weight=='line' this option is not avaliable.
originmodule:cercaliagl/LonLat~LonLat Origin. If not defined, then use
setOriginto initialize variable;destinationmodule:cercaliagl/LonLat~LonLat Destination. If not defined, then use
setDestinationto initialize variable;stepsArray.<module:cercaliagl/LonLat~LonLat> Sequential stop list.
weightstring | undefined Distance calculation considering weight/type
line|time|distance|money. Default valueline.
Extends
- module:cercaliagl/service/Service~Service
Methods
-
module:cercaliagl/service/Distance~Distance.calculateDistanceOnArea(area){number}
-
Name Type Description areamodule:@turf/helpers~Feature | module:@turf/helpers~FeatureCollection.<any> | module:@turf/helpers~Geometry input GeoJSON feature(s)
Returns:
Distance in quare meters
-
module:cercaliagl/service/Distance~Distance.calculateDistanceOnLine(geojson, units){number}
-
Name Type Description geojsonGeoJSON.Feature.<(GeoJSON.LineString|GeoJSON.MultiLineString)> GeoJSON to measure
unitsmodule:@turf/helpers~Units (defaults to kilometers) Kilometers || miles || radians || degrees. Kilometers by default
Returns:
Distance in the specified units
-
Distance calculation with the assigned parameters, and returns the data to the callback function which is called once server returns response.
Name Type Description callbackFnfunction Callback function
-
Returns the destination.
Returns:
Destination point
-
Obtain origin.
Returns:
Returns the origin assigned previously
-
Get steps (or waypoints)
Returns:
Steps
-
Get weight. Available values
line|time|distance|moneyReturns:
weight
-
Returns if calculate geometry functionality is active or inactive
Returns:
calculateGeometrytrueorfalse. If calculate geometry option is enabled.
-
Name Type Description calculateGeometryboolean trueif geometry will be returned after calculation.. -
Set destination point.
Name Type Description lonLatmodule:cercaliagl/LonLat~LonLat Destination point
-
Set origin point.
Name Type Description lonLatmodule:cercaliagl/LonLat~LonLat Origin point
-
Set steps (or waypoints)
Name Type Description stepsArray.<module:cercaliagl/LonLat~LonLat> Array with steps
-
Set weight to calculate distance
Name Type Description weightstring Weight. Available values
line|time|distance|money