-
Notifications
You must be signed in to change notification settings - Fork 50
/
index.d.ts
52 lines (42 loc) · 1.4 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { PureComponent } from "react";
import type { GeolocateControl as MapboxGeolocateControl } from "mapbox-gl";
type Props = {
/* A Geolocation API PositionOptions object. */
positionOptions?: PositionOptions;
/**
* A `fitBounds` options object to use when the map is
* panned and zoomed to the user's location.
*/
fitBoundsOptions?: Object;
/**
* If `true` the Geolocate Control becomes a toggle button and when active
* the map will receive updates to the user's location as it changes.
*/
trackUserLocation?: boolean;
/**
* By default a dot will be shown on the map at the user's location.
* Set to `false` to disable.
*/
showUserLocation?: boolean;
/* A string representing the position of the control on the map. */
position?: "top-left" | "top-right" | "bottom-left" | "bottom-right";
/**
* Fired when the Geolocate Control changes to the background state.
*/
onTrackUserLocationEnd?: Function;
/**
* Fired when the Geolocate Control changes to the active lock state,
*/
onTrackUserLocationStart?: Function;
/**
* Fired on each Geolocation API position update which returned as an error.
*/
onError?: Function;
/**
* Fired on each Geolocation API position update which returned as success.
*/
onGeolocate?: Function;
};
export default class GeolocateControl extends PureComponent<Props> {
getControl(): MapboxGeolocateControl;
}