-
Notifications
You must be signed in to change notification settings - Fork 51
/
Copy pathindex.d.ts
80 lines (65 loc) · 2.07 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
import { PureComponent, ReactNode } from "react";
import type { Marker as MapboxMarker, PointLike, LngLat } from "mapbox-gl";
type Props = {
/** Marker content */
children: ReactNode;
/**
* A string indicating the part of the Marker
* that should be positioned closest to the coordinate
*/
anchor?:
| "center"
| "top"
| "bottom"
| "left"
| "right"
| "top-left"
| "top-right"
| "bottom-left"
| "bottom-right";
/** The longitude of the center of the marker. */
longitude: number;
/** The latitude of the center of the marker. */
latitude: number;
/**
* The offset in pixels as a `PointLike` object to apply
* relative to the element's center. Negatives indicate left and up.
*/
offset?: PointLike;
/**
* Boolean indicating whether or not a marker is able to be dragged
* to a new position on the map.
*/
draggable?: boolean;
/**
* The rotation angle of the marker in degrees, relative to its
* respective `rotationAlignment` setting. A positive value will
* rotate the marker clockwise.
*/
rotation?: number;
/**
* map aligns the `Marker` to the plane of the map. `viewport`
* aligns the Marker to the plane of the viewport. `auto` automatically
* matches the value of `rotationAlignment`.
*/
pitchAlignment?: string;
/**
* map aligns the `Marker`'s rotation relative to the map, maintaining
* a bearing as the map rotates. `viewport` aligns the `Marker`'s rotation
* relative to the viewport, agnostic to map rotations.
* `auto` is equivalent to `viewport`.
*/
rotationAlignment?: string;
/** Fired when the marker is clicked */
onClick?: (event: MouseEvent) => void;
/** Fired when the marker is finished being dragged */
onDragEnd?: (lngLat: LngLat) => void;
/** Fired when the marker is finished being dragged */
onDragStart?: (lngLat: LngLat) => void;
/** Fired when the marker is dragged */
onDrag?: (lngLat: LngLat) => void;
};
export default class Marker extends PureComponent<Props> {
constructor(props: Props);
getMarker(): MapboxMarker;
}