forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
leaflet-label.d.ts
81 lines (69 loc) · 2.15 KB
/
leaflet-label.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
81
// Type definitions for Leaflet.label v0.2.1
// Project: https://github.com/Leaflet/Leaflet.label
// Definitions by: Wim Looman <https://github.com/Nemo157>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference path="../leaflet/leaflet.d.ts" />
declare namespace L {
export interface IconOptions {
labelAnchor?: Point;
}
export interface PathOptions {
labelAnchor?: Point;
}
export interface CircleMarkerOptions {
labelAnchor?: Point;
}
export interface Marker {
showLabel(): Marker;
hideLabel(): Marker;
setLabelNoHide(noHide: boolean): void;
bindLabel(content: string, options?: LabelOptions): Marker;
unbindLabel(): Marker;
updateLabelContent(content: string): void;
getLabel(): Label;
setOpacity(opacity: number, labelHasSemiTransparency: boolean): void;
}
export interface CircleMarker {
showLabel(): CircleMarker;
hideLabel(): CircleMarker;
setLabelNoHide(noHide: boolean): void;
bindLabel(content: string, options?: LabelOptions): CircleMarker;
unbindLabel(): CircleMarker;
updateLabelContent(content: string): void;
getLabel(): Label;
}
export interface FeatureGroup<T extends ILayer> {
clearLayers(): FeatureGroup<T>;
bindLabel(content: string, options?: LabelOptions): FeatureGroup<T>;
unbindLabel(): FeatureGroup<T>;
updateLabelContent(content: string): FeatureGroup<T>;
}
export interface Path {
bindLabel(content: string, options?: LabelOptions): Path;
unbindLabel(): Path;
updateLabelContent(content: string): void;
}
export interface LabelOptions {
className?: string;
clickable?: boolean;
direction?: string; // 'left' | 'right' | 'auto';
pane?: string;
noHide?: boolean;
offset?: Point;
opacity?: number;
zoomAnimation?: boolean;
}
export interface LabelStatic extends ClassStatic {
new(options?: LabelOptions): Label;
}
export var Label: LabelStatic;
export interface Label extends IEventPowered<Label> {
onAdd(map: Map): void;
onRemove(map: Map): void;
setLatLng(latlng: LatLng): Label;
setContent(content: string): Label;
close(): void;
updateZIndex(zIndex: number): void;
setOpacity(opacity: number): void;
}
}