new EvVehicles(context, optionsopt)
BeNomad BeMap JavaScript API - EvVehicles service (v1.5)
Promise-based wrapper around the v1.1 vehicle catalogue endpoints:
- `GET service/vehicle/1.1/getbrands` → `{brands: [{id, label}, ...]}`
- `GET service/vehicle/1.1/findvehicles` → `{vehicles: [VehicleInfo, ...]}`
**Why v1.1 (not the lightweight `evsmartrouting/vehicles*` endpoints).**
v1.1 returns structured plaintext fields — brandName, name, year,
variant, batteryName (kWh), chargerPowerDC (kW), chargerPowerAcThreePhases
(kW), connectorTypes[], wltp, consumptionInWhPerKm, dimensions — same
shape the Flutter SDK consumes via
`bemap-flutter-api/lib/service/vehicle/model/vehicle.dart`. No regex
parsing of pre-formatted titles, no AES decryption of `encDatasheet`.
Auth roles: `ROLE_VEHICLE` (+ `ROLE_VEHICLE_DATASHEET` for
`enableDatasheet: true`).
`bemap.EvSmartRouting.getBrands()` / `.getVehicles()` keep their existing
lightweight `evsmartrouting/vehicles*` endpoints for backward compat —
the two services serve different use cases.
Parameters:
| Name |
Type |
Attributes |
Description |
context |
bemap.Context
|
|
|
options |
Object
|
<optional>
|
|
- Since:
- Source:
Extends
Methods
brandLogo(brandId, optionsopt) → {Promise.<{brandId: String, pictureFileFormat: Object, logo: String}>}
Fetch the JSON-wrapped logo description for an EV brand (includes the
base64-encoded image bytes and the picture format). Wraps
`GET service/vehicle/1.1/getbrandlogo`.
For embedding the logo directly in `

` markup, prefer
`getBrandLogoUrl()` — it returns the URL of the binary endpoint.
Parameters:
| Name |
Type |
Attributes |
Description |
brandId |
String
|
|
|
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
|
|
- Since:
- Source:
Returns:
`logo` is base64-encoded image bytes.
-
Type
-
Promise.<{brandId: String, pictureFileFormat: Object, logo: String}>
brands(optionsopt) → {Promise.<Array.<bemap.EvBrand>>}
List EV brands the current user has access to.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
|
|
- Source:
Returns:
Sorted by label for deterministic UI.
-
Type
-
Promise.<Array.<bemap.EvBrand>>
get(vehicleKey, optionsopt) → {Promise.<bemap.EvVehicle>}
Fetch one vehicle by its UUID key.
Parameters:
| Name |
Type |
Attributes |
Description |
vehicleKey |
String
|
|
|
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Default |
Description |
enableDatasheet |
Boolean
|
<optional>
|
false
|
|
signal |
AbortSignal
|
<optional>
|
|
|
|
- Source:
Returns:
Rejects with `bemap.Error.VEHICLE_NOT_FOUND` when no match.
-
Type
-
Promise.<bemap.EvVehicle>
getBrandLogoUrl(brandId) → {String}
Build the URL of the binary brand-logo endpoint
(`GET service/vehicle/1.1/getbrandlogolite`) — returns raw image bytes
with the correct `Content-Type`. Customers fetch this with their own
auth (Basic via `Authorization` header) and turn the response into a
`Blob` URL for `
![]()
`.
**In proxy mode** (`ctx.proxy`, EVMOVE-307) do NOT add an `Authorization`
header — the URL already points at the proxy, which injects the credentials
server-side. Fetch it with no auth header at all.
Parameters:
| Name |
Type |
Description |
brandId |
String
|
|
- Since:
- Source:
Returns:
Full URL including the Context's base URL.
-
Type
-
String
getPictureUrl(vehicleKey) → {String}
Build the URL of the vehicle-photo endpoint
(`GET service/vehicle/picture/1.0/getone?vehicleUuidKey=`). Used
by customer UIs (e.g. `evmove5`'s car-select screen) to render vehicle
thumbnails. Customers fetch with their own auth.
Parameters:
| Name |
Type |
Description |
vehicleKey |
String
|
|
- Since:
- Source:
Returns:
-
Type
-
String
levels(filters) → {Promise.<Array.<String>>}
Walk the catalogue progressively, one attribute at a time — used by
cascading "brand → name → variant → battery → DC power → AC power"
UI flows (as in the `evmove5` car-select screen). Wraps
`GET service/vehicle/1.1/getlevelvehicleinfo`.
The `level` argument names which attribute the server returns. Each
deeper level filters by the levels already chosen.
Levels: `'NAME'` · `'VARIANT'` · `'YEAR'` · `'BATTERY_NAME'` ·
`'CHARGE_POWER_DC'` · `'CHARGE_POWER_AC'` · `'MOTOR_TYPE'`.
Parameters:
| Name |
Type |
Description |
filters |
Object
|
Properties
| Name |
Type |
Attributes |
Description |
level |
String
|
|
**R** One of the level names above. |
brandId |
String
|
|
**R** |
name |
String
|
<optional>
|
|
variant |
String
|
<optional>
|
|
year |
String
|
<optional>
|
|
batteryName |
String
|
<optional>
|
|
motorType |
String
|
<optional>
|
|
chargerPowerDC |
Number
|
<optional>
|
|
chargerPowerAC |
Number
|
<optional>
|
|
signal |
AbortSignal
|
<optional>
|
|
|
- Since:
- Source:
Returns:
-
Type
-
Promise.<Array.<String>>
list(filtersopt) → {Promise.<Array.<bemap.EvVehicle>>}
List vehicles, optionally filtered by brand or by an exact vehicle key.
Parameters:
| Name |
Type |
Attributes |
Description |
filters |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Default |
Description |
brandId |
String
|
<optional>
|
|
Restrict to one brand. |
vehicle |
String
|
<optional>
|
|
Restrict to one vehicle key (returns 0 or 1 entries). |
variant |
String
|
<optional>
|
|
Restrict to one variant (v1.1). |
enableDatasheet |
Boolean
|
<optional>
|
false
|
Include the encrypted datasheet blob. |
signal |
AbortSignal
|
<optional>
|
|
|
|
- Source:
Returns:
-
Type
-
Promise.<Array.<bemap.EvVehicle>>
toRoutingProfile(vehicleKey, optionsopt) → {Promise.<bemap.RoutingVehicleProfile>}
Convenience: fetch a vehicle and return a `RoutingVehicleProfile` ready
to plug into `bemap.RoutingV2.calculate()` or
`bemap.EvSmartRouting.calculate()`.
Parameters:
| Name |
Type |
Attributes |
Description |
vehicleKey |
String
|
|
|
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
|
|
- Source:
Returns:
-
Type
-
Promise.<bemap.RoutingVehicleProfile>