Selectors
To optimize response times and size, by default, the MVT and JSON API return a minimized response. This approach ensures peak performance and reduces tile payload sizes, which is critical for smooth map interactions. By using selectors, you can include the additional data points your application specifically requires.
Where to use
- Station Features Only: Selectors are only applicable to station features (
count: 1). They do not affect the properties of cluster features. - MVT and JSON endpoits only: Selectors can be used in both the MVT and JSON Tile services, but not in count endpoint.
Available selectors
Any field listed in the station properties for MVT and JSON tiles can be used as a selector in its respective service, with exception of the mandatory GeoJSON fields returned in JSON tile service.
Implementation
To request specific properties, append stationProperties[] query parameter to the tile request URL.
Selectors / URL Structure
- 01
https://api.chargetrip.io/v2/station/..../?stationProperties[]={selector1}&stationProperties[]={selector2}&stationProperties[]={selector3}..
Behaviour Examples
When selectors are provided, the request returns only the specified fields.
GeoJSON
In the GeoJSON tile service, the mandatory GeoJSON fields (type and geometry) are always returned regardless of the selector choice.
GeoJSON Tile / Custom selectors response
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
.../?stationProperties[]=station_maximum_power&stationProperties[]=preferred_operator&stationProperties[]=id { "type": "FeatureCollection", "features": [ // Station feature { "id": "132313", "type": "Feature", "geometry": { "type": "Point", "coordinates": [6.789, 52.234] }, // 'count' is missing because it wasn't provided as selector "properties": { "station_maximum_power": 350, "preferred_operator": true } }, // Cluster feature // Cluster feature is not modified, as it's not affected by the selectors. { "type": "Feature", "geometry": { "type": "Point", "coordinates": [6.723, 50.000] }, "properties": { "count": 3, "expansion_zoom": 18 } } ]}
MVT
In MVT Tile Service, only the parameters explicitly selected are returned as there is no mandatory fields.
Mapbox Vector Tile / Custom selectors response
- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
.../?stationProperties[]=station_maximum_power&stationProperties[]=preferred_operator&stationProperties[]=id // Station feature// 'count' is missing because it wasn't provided as a selector.{ "id": "132313", "preferred_operator": false, "station_maximum_power": 350} // Cluster feature// Cluster feature is not modified, as it's not affected by the selectors.{ "count": 3, "expansion_zoom":32}