Interface GeolocateControlProps

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

interface GeolocateControlProps {
    obj?: ((obj) => 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);
    };
    options?: {
        fitBoundsOptions?: FitBoundsOptions;
        positionOptions?: PositionOptions;
        showAccuracyCircle?: boolean;
        showUserLocation?: boolean;
        trackUserLocation?: boolean;
    };
}

Hierarchy (view full)

Properties

Properties

obj?: ((obj) => void)

Invoked to pass the Mapbox control to the function provider, typically the parent React component.

Type declaration

    • (obj): void
    • 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.

Type declaration

Example

on: {
click: evt => console.log(evt),
drag: evt => console.log(evt)
};
options?: {
    fitBoundsOptions?: FitBoundsOptions;
    positionOptions?: PositionOptions;
    showAccuracyCircle?: boolean;
    showUserLocation?: boolean;
    trackUserLocation?: boolean;
}

Configuration for how geolocation appears and operates.

Type declaration