new cercalia.RouteMap(options)
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
RouteMap options
|
Methods
-
calculateRoute(callback)
-
Calcule the route
Name Type Description callback
function is called when route has been calculated
-
getAutoCalculateRoute(){boolean}
-
Returns:
autoCalculateRoute
-
getCenterToRoute(){boolean}
-
Returns:
centerToRoute
-
getClass(){string}
-
Returns:
ClassName.
-
getFeatures(){Array.<Feature>}
-
-
-
getServiceOptions(){cercaliax.service.RoutingOptions}
-
-
-
getWidgetReport(){cercalia.widget.RoutingReport}
-
-
hasDestination(){boolean}
-
Returns:
return true if routeService has Destination, otherwise false.
-
hasOrigin(){boolean}
-
Returns:
return true if routeService has Origin, otherwise false.
-
hideContextMenu(){cercalia.RouteMap}
-
Hide routeMap contextMenu
-
removeRoute()
-
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
-
setServiceOptions(opt)
-
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 -
setWidget(widget)
-
Name Type Description widget
cercalia.widget.Routing -
setWidgetReport(widget)
-
Name Type Description widget
cercalia.widget.RoutingReport -
sincronize(widget){cercalia.RouteMap}
-
Syncronize routeMap with widget. Widget fills RouteMap.
Name Type Description widget
cercalia.widget.Routing