Class: EvSmartRoutingRequest

bemap.EvSmartRoutingRequest(optionsopt)

new EvSmartRoutingRequest(optionsopt)

BeNomad BeMap JavaScript API - EvSmartRoutingRequest (v1.5) Strongly-typed request builder. `toJson()` emits the REST **v1.0** body (`POST service/evsmartrouting/1.0`); `toJsonV2()` emits the REST **v2.0.0** body (`POST service/2.0/evsmartrouting`). Wire shapes cross-checked against the BeMap server contracts in `bemap_idea/.../service/v1_0_0/model/evSmartRouting/request/EvSmartRoutingRequest.java` and `.../service/v2_0_0/model/evSmartRouting/request/EvSmartRoutingRequest.java`. The server requires: - `startLon`, `startLat`, `stopLon`, `stopLat` (decimal degrees, WGS84) - `vehicle` — a vehicle key from the user's allowed EV brand catalogue - At least one entry in `chargingStationProviders` (`csps` on the wire) Example: var req = new bemap.EvSmartRoutingRequest({ start: new bemap.Coordinate(2.35, 48.85), stop: new bemap.Coordinate(4.83, 45.75), vehicle: 'renault-megane-e-tech-ev60', chargingStationProviders: ['ecoMovement'], initBatteryLevel: 80, minBatteryLevel: 10, minArrivalBatteryLevel: 20, temperature: 18 });
Parameters:
Name Type Attributes Description
options Object <optional>
Properties
Name Type Attributes Default Description
start bemap.Coordinate | Object Departure coordinate (decimal degrees, WGS84).
stop bemap.Coordinate | Object Arrival coordinate (decimal degrees, WGS84).
vias Array.<(bemap.Coordinate|{lon:Number, lat:Number})> <optional>
Intermediate waypoints, in order.
vehicle String Vehicle key (UUID-like, from the EV catalogue).
chargingStationProviders Array.<String> Allowed CSP keys (e.g. `'ecoMovement'`). Maps to the `csps` field.
chargingStationFilters Array.<String> <optional>
Filter expressions — see BeMap docs. Maps to `csfs`.
chargingStationDeprecatedConnector Boolean <optional>
false Allow stops on stations with deprecated connector types.
initBatteryLevel Number <optional>
100 Initial battery level (0-100).
minBatteryLevel Number <optional>
0 Minimum battery level allowed during the journey (0-100).
minArrivalBatteryLevel Number <optional>
0 Minimum battery level required at destination (0-100).
maxAfterChargeBatteryLevel Number <optional>
Maximum battery level after a stop (50-100). Vehicle default ≈ 90.
weather Boolean <optional>
false Include real-time weather impact in the energy calculation.
weatherProvider String <optional>
Optional explicit weather provider key.
temperature Number <optional>
20 Ambient temperature, °C.
departureTime String | Date | Number <optional>
Epoch ms, ISO string, or Date — when the trip starts.
stepPointPluggingTime Number <optional>
0 Extra time (in seconds) for each charging stop (plugging delay).
payload Number <optional>
75 Extra weight in kg.
criterias Array.<String> <optional>
EV-specific criteria — e.g. `AVOID_MOTORWAYS`, `AVOID_TOLLS`.
optimMode String <optional>
Optimisation mode, e.g. `FASTEST`.
connectorTypes Array.<Number> <optional>
Filter on these connector IDs.
restrictedEvse Boolean <optional>
false Allow private / employees-only stations.
polyline Boolean <optional>
true Include the route polyline.
encodedPolyline Boolean <optional>
false Include the Google-encoded polyline.
events Boolean <optional>
false Include route timeline events.
eventFrequency Number <optional>
60 Event sampling, seconds (`evtFreq`).
alternative Number <optional>
0 Alternative-route index (0..2) (`alr`).
currency String <optional>
ISO 4217 currency for cost calc.
drivingStyle String <optional>
Driving style enum.
allowNaStatus Boolean <optional>
false Allow stops on charging stations with unknown availability (`allowNaStatus`).
allowMaxSpeedReco Boolean <optional>
false Recommend max speed between step points (`allowMaxSpdReco`).
co2Emissions Boolean <optional>
false Include saved CO2 estimation in the journey summary.
debugStat Boolean <optional>
false Server-debug flag, leave false in prod.
arrivalTime String | Date | Number <optional>
Arrive-by time (epoch ms / Date / ISO) — alternative to departureTime.
extraPayload Number <optional>
Extra payload weight (kg) on top of `payload`.
stepPointTimeSlots Array.<Object> <optional>
Per-step charge time-slot windows (forced charges take priority).
aroundEvse Boolean <optional>
false Include charging stations around step points in the response.
ignoreStatus Boolean <optional>
false Ignore charging-station availability status.
evtExtKey String <optional>
Extended route-timeline key (requires events:true).
geoserver String <optional>
Override the Context geoserver.
chargingStationFiltersVersion Number <optional>
(v2) Charging-station filter logic version (1|2).
tariffChargePassHashIds Array.<String> <optional>
(v2) Eligible charge-pass hash IDs.
tollCost Boolean <optional>
false (v2) Enable toll-cost calculation + toll events.
routesheet Boolean <optional>
false (v2) Enable the route-sheet.
routesheetLanguage String <optional>
(v2) Route-sheet language.
routesheetMode String <optional>
(v2) Route-sheet mode: `TEXT`|`DETAILS`|`TEXT_DETAILS`.
routesheetVerboseLevel String <optional>
(v2) Route-sheet verbosity: `LOW`|`MEDIUM`|`HIGH`. NOTE ON VERSIONS: the same public options serialise to either wire shape — `toJson()` builds the REST **v1.0** body (flat), `toJsonV2()` builds the REST **v2.0.0** body (nested `vehicle`/`start`/`stop`/`vias`/`condition`). `bemap.EvSmartRouting.calculate()` uses `toJsonV2()`; the `(v2)` options above are honoured only by `toJsonV2()`.
Since:
  • 1.5.0
Source:

Methods

toJson() → {Object}

Build the wire-format JSON body. Drops null / default fields so the payload stays minimal.
Source:
Returns:
Type
Object

toJsonV2() → {Object}

Build the REST **v2.0.0** wire-format body for `POST service/2.0/evsmartrouting`. Same public options as `toJson()` (v1) — only the wire SHAPE differs: v2 nests `vehicle{key,initBatLvl,payload}`, `start`/`stop`/`vias` as `{lon,lat}` places, and most trip options inside `condition{}` (with the v2 key names). Drops null / default fields. The v1 `toJson()` above is left untouched.
Since:
  • 2.0.0
Source:
Returns:
Type
Object