Class: RouteMap

cercalia.RouteMap

new cercalia.RouteMap(options)

Name Type Description
options

RouteMap options

Name Type Description
map cercalia.Map

Cercalia Map

autoCalculateRoute boolean | undefined optional

If autoCalculateRoute is true, the Map will calculate the route if user do 'setOrigin', 'setDestination' or 'setStep'

centerToRoute boolean | undefined optional

defould true

widget cercalia.widget.Routing | undefined optional

Widget.Routing

widgetReport cercalia.widget.RoutingReport | undefined optional

Widget.RoutingReport

widgetReport cercaliax.service.RoutingOptions | undefined optional

Service Routing Options

Methods

Calcule the route

Name Type Description
callback function

is called when route has been calculated

getAutoCalculateRoute(){boolean}

Returns:
autoCalculateRoute

getCenterToRoute(){boolean}

Returns:
centerToRoute
Returns:
ClassName.

getFeatures(){Array.<Feature>}

Returns:
return true if routeService has Destination, otherwise false.
Returns:
return true if routeService has Origin, otherwise false.

Hide routeMap contextMenu

Clear route (Remove route feature and route markers).

setAutoCalculateRoute(autoCalculateRoute){cercalia.RouteMap}

Name Type Description
autoCalculateRoute boolean
Returns:
this

setCenterToRoute(centerToRoute)

Center to the router

Name Type Description
centerToRoute boolean

setDestination(destination, calculateRoute, text)

Set destination of route

Name Type Description
destination cercalia.LonLat | Object
calculateRoute boolean

calculateRoute -> true Calcule route; calculateRoute -> false NO Calcule route; calculateRoute -> undefined depends of autoCalculateRoute

text string

label text for marker

setOrigin(origin, calculateRoute, text)

Set origin of route

Name Type Description
origin cercalia.LonLat | Object
calculateRoute boolean

calculateRoute -> true Calcule route; calculateRoute -> false NO Calcule route; calculateRoute -> undefined depends of autoCalculateRoute

text string

label text for marker

Name Type Description
opt
Name Type Description
destination cercalia.LonLat | cercaliax.service.RoutingStep

Destination coordinates.

lang string

Report language (only if report=true).

mindist boolean | undefined optional

Minimum substage distance, in meters (default value 1000). The larger this distance , the smaller the number of substages.

origin cercalia.LonLat | cercaliax.service.RoutingStep

Origin coordinates.

reorder boolean | undefined optional

Specify if you want to reorder or not the route stops, to get the faster/shorter route. Maximum 10 stop points.

report boolean | undefined optional

Get the textual route report (if not, gets a faster response). Default 0.

steps Array.<cercalia.LonLat> | Array.<cercaliax.service.RoutingStep> | undefined optional

Array with stop points coordinates (optional).

tolerance number | undefined optional

Route geometry generalization, in meters (if =0, returns the original geometry). Default value, 5 (meters).

toll boolean | undefined optional

Specify if you need to get the toll roads cost for the route. Currently only avaliable for Spain, Portugal and Andorra.

weight string | undefined optional

Route type: time (faster), distance (shorter), money (toll free route). Default value: time.

setStep(step, calculateRoute, text, position)

Set step of route

Name Type Description
step cercalia.LonLat | Object
calculateRoute boolean

calculateRoute -> true Calcule route; calculateRoute -> false NO Calcule route; calculateRoute -> undefined depends of autoCalculateRoute

text string

label text for marker

position integer
Name Type Description
widget cercalia.widget.Routing
Name Type Description
widget cercalia.widget.RoutingReport

Syncronize routeMap with widget. Widget fills RouteMap.

Name Type Description
widget cercalia.widget.Routing