MapboxEvViewClient

class MapboxEvViewClient(mapboxEVSearchClientApi: MapboxEVSearchClientApi, options: MapboxEvViewOptions)

Constructors

Link copied to clipboard
constructor(mapboxEVSearchClientApi: MapboxEVSearchClientApi, options: MapboxEvViewOptions)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun cancel()

Cancels background tasks. This method should be called by the client application when the activity or fragment is cleaning up resources and/or going out of scope.

Link copied to clipboard
fun handleMapClick(target: Point, mapboxMap: MapboxMap)

Data from map click events should be forwarded to this method in order to search for EV stations at the click point. If an EV station is found it will be emitted via the flow.

Link copied to clipboard
fun hide()

Hides the map layer hosting the EV stations.

Link copied to clipboard

Initiates a render command to initialize the layer(s) used to display EV stations. It's not generally necessary to call this method since render commands will check for the presence the layer(s) and create them automatically. However under some circumstances it may be an advantage for an application to explicitly initialize the layer(s).

Link copied to clipboard
suspend fun mapClickEvStationSearch(target: Point, mapboxMap: MapboxMap, searchCache: Boolean = true): Either<EvStationNotFoundError, EVStation>

Looks for an EV station on the map at the target point. If found the EV station is returned or an error.

Link copied to clipboard
fun reRender()

Issues a render command that can be used to render the EV stations on the map.

Link copied to clipboard
fun show()

Shows the map layer hosting the EV stations.

Link copied to clipboard
fun update(data: SourceDataLoaded)

The client application should subscribe to SourceDataLoaded events from the MapboxMap and forward the events to this method in order to use this class correctly.

Link copied to clipboard

Update the MapboxEvViewOptions. Any changes to EV station icons will take effect with the next render command emitted.