new ChargingStations(context, optionsopt)
BeNomad BeMap JavaScript API - ChargingStations service (v1.5)
Promise-based wrapper around `POST service/chargingstation/search/1.0`.
**What it does.** Fetches pools of charging stations around a coordinate,
along a corridor, or inside a bounding box. The user's ACL filters the
providers exposed via `bemap.AclService.getCurrentUserDetails()` — pass
one of those `key` values into `request.providers`.
Auth: requires `ROLE_CHARGINGSTATION` or `ROLE_EVSMARTROUTING`.
Typical usage:
var cs = new bemap.ChargingStations(ctx);
var req = new bemap.ChargingStationSearchRequest({
providers: ['ecoMovement'],
coordinate: new bemap.Coordinate(2.35, 48.85),
radius: 2000,
maxPoolResult: 25,
options: [bemap.ChargingStationOption.PATH_POOL_MAP]
});
cs.search(req).then(function(response) {
response.getPools().forEach(function(pool) {
addMarker(pool.getCoordinate(), pool.getName());
});
});
Parameters:
| Name |
Type |
Attributes |
Description |
context |
bemap.Context
|
|
BeMap-JS-API Context. Mandatory. |
options |
Object
|
<optional>
|
|
- Since:
- Source:
Extends
Methods
getConnectorTypes(optionsopt) → {Promise.<Array.<Object>>}
Fetch the list of connector types known by the server. The result is the
`types[]` array from `GET service/chargingstation/connector/list/1.0`.
Parameters:
| Name |
Type |
Attributes |
Description |
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
geoserver |
String
|
<optional>
|
Override the Context geoserver. |
signal |
AbortSignal
|
<optional>
|
|
|
- Source:
Returns:
The raw `types[]` array from the server.
-
Type
-
Promise.<Array.<Object>>
Search for charging-station pools matching the supplied filters.
Parameters:
| Name |
Type |
Attributes |
Description |
request |
bemap.ChargingStationSearchRequest
|
|
|
options |
Object
|
<optional>
|
Properties
| Name |
Type |
Attributes |
Description |
signal |
AbortSignal
|
<optional>
|
AbortSignal for cancellation. |
|
- Source:
Returns:
-
Type
-
Promise.<bemap.ChargingStationSearchResponse>