Interface GeolocateControlProps

Components that implement this interface will allow the user to focus the map on their current location.

See

Mapbox GeoLocateControl

Hierarchy

Properties

Properties

obj?: ((obj) => void)

Type declaration

    • (obj): void
    • Invoked to pass the Mapbox control to the function provider, typically the parent React component.

      Parameters

      • obj: GeolocateControl

        An instance of the type of the Mapbox control that backs the React component.

      Returns void

on?: {
    error?: ((evt) => void) | ((evt) => any);
    geolocate?: ((evt) => void) | ((evt) => any);
    outofmaxbounds?: ((evt) => void) | ((evt) => any);
    trackuserlocationend?: ((evt) => void) | ((evt) => any);
    trackuserlocationstart?: ((evt) => void) | ((evt) => any);
}

A collection of handlers for events with names defined by the EventTypes generic.

Example

on: {
click: evt => console.log(evt),
drag: evt => console.log(evt)
};

Type declaration

options?: {
    fitBoundsOptions?: FitBoundsOptions;
    positionOptions?: PositionOptions;
    showAccuracyCircle?: boolean;
    showUserLocation?: boolean;
    trackUserLocation?: boolean;
}

Configuration for how geolocation appears and operates.

See

Mapbox GeoLocateControl Parameters

Type declaration

Generated using TypeDoc