new RoutingV2(context, optionsopt)
BeNomad BeMap JavaScript API - RoutingV2 (v1.5)
Modern, Promise-based router. Single endpoint
`POST service/routing/1.0` covers point-to-point routing (with vias),
matrix and isochrone calculations — `routingMode` discriminates.
Wire shape mirrors the BeMap server contract (cross-checked against
`bemap-flutter-api/lib/service/routing/provider/routing_server.dart`).
In-flight requests are tracked by `requestId` and aborted via `cancel(id)`.
Parameters:
| Name |
Type |
Attributes |
Description |
context |
bemap.Context
|
|
BeMap-JS-API Context. Mandatory. |
options |
Object
|
<optional>
|
|
- Since:
- Source:
Extends
Methods
calculate(request, optionsopt) → {Promise.<bemap.RoutingResponse>}
Calculate one or several routes (or a matrix, or an isochrone, depending
on `request.routingMode`).
Parameters:
| Name |
Type |
Attributes |
Description |
request |
bemap.RoutingRequest
|
|
|
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
|
|
- Source:
Returns:
-
Type
-
Promise.<bemap.RoutingResponse>
cancel(requestId) → {Boolean}
Cancel an in-flight request. Returns `true` when the request was found
and aborted, `false` otherwise.
Parameters:
| Name |
Type |
Description |
requestId |
String
|
|
- Source:
Returns:
-
Type
-
Boolean
isochrone(origin, criterion, optionsopt) → {Promise.<bemap.RoutingResponse>}
Compute the reachable-area polygon for a given budget (time in seconds,
distance in metres or — with an EV profile — energy in Wh).
Parameters:
| Name |
Type |
Attributes |
Description |
origin |
bemap.Coordinate
|
bemap.CoordinateSat
|
bemap.RoutingDestination
|
|
|
criterion |
Object
|
|
Properties
| Name |
Type |
Attributes |
Description |
budget |
Number
|
|
Budget value passed as `isoChroneLimit`. |
criterias |
Array.<String>
|
<optional>
|
Defaults to [FASTEST] (time-based budget). |
|
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
routingVehicleProfile |
bemap.RoutingVehicleProfile
|
<optional>
|
|
options |
Array.<String>
|
<optional>
|
|
outputLanguage |
String
|
<optional>
|
|
departureTime |
Date
|
Number
|
String
|
<optional>
|
|
signal |
AbortSignal
|
<optional>
|
|
geoserver |
String
|
<optional>
|
|
requestId |
String
|
<optional>
|
|
|
- Source:
Returns:
-
Type
-
Promise.<bemap.RoutingResponse>
matrix(originList, destinationList, optionsopt) → {Promise.<bemap.RoutingResponse>}
Compute a duration / distance matrix between every origin and every
destination. The Worker uses `matrixStartCount` to discriminate origins
from destinations inside the flat `destinations` list.
Parameters:
- Source:
Returns:
-
Type
-
Promise.<bemap.RoutingResponse>