Unsubscribe a function that was previously subscribed with on.
mapView.BlueDot.on(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);
...
// Something changed and I no longer want this event to fire
mapView.BlueDot.off(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);
An E_BLUEDOT_EVENT that is fired when the blue dot changes.
A function that was previously passed to on. The function must have the same reference as the function that was subscribed.
Subscribe a function to be called when an E_BLUEDOT_EVENT is fired.
const blueDotChangeHandler = ({ map, nearestNode, position, bearing }) => {
// Do something with the new values
};
mapView.BlueDot.on(E_BLUEDOT_EVENT.POSITION_UPDATE, blueDotChangeHandler);
An E_BLUEDOT_EVENT that is fired when the blue dot changes.
A callback that gets called when the corresponding event is fired. The callback will get passed an argument with a type that's one of E_BLUEDOT_EVENT_PAYLOAD.
Disables Blue Dot that was enabled with enable and stops emitting events.
// Enable blue dot
mapView.BlueDot.enable();
// Disable blue dot
mapView.BlueDot.disable();
Enables Blue Dot. A blue dot will appear on the map that responds to the device's geolocation updates. It then emits TBlueDotStateChange and TBlueDotPositionUpdate events via E_BLUEDOT_EVENT.
// Enable blue dot
mapView.BlueDot.enable();
// Disable blue dot
mapView.BlueDot.disable();
Optional
options: TEnableBlueDotOptions
API to enable and respond to user position updates.