@windycom/plugin-devtools 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/index.mjs +298 -0
- package/package.json +9 -0
- package/publishExamples.sh +19 -0
- package/types/AromeProduct.d.ts +5 -0
- package/types/Bar.d.ts +114 -0
- package/types/BindedBar.d.ts +51 -0
- package/types/BindedCheckbox.d.ts +30 -0
- package/types/BindedSwitch.d.ts +35 -0
- package/types/BottomSlide.d.ts +53 -0
- package/types/BottomTagPlugin.d.ts +8 -0
- package/types/Calendar.d.ts +149 -0
- package/types/ClickHandler.d.ts +19 -0
- package/types/Color.d.ts +175 -0
- package/types/DataTiler.d.ts +41 -0
- package/types/Drag.d.ts +43 -0
- package/types/DraggableDiv.d.ts +21 -0
- package/types/DropDown.d.ts +37 -0
- package/types/EcmwfAnalysisProduct.d.ts +5 -0
- package/types/EcmwfProduct.d.ts +29 -0
- package/types/Evented.d.ts +78 -0
- package/types/ExternalSveltePlugin.d.ts +29 -0
- package/types/Favs.d.ts +83 -0
- package/types/GhostBox.d.ts +17 -0
- package/types/GlObj.d.ts +252 -0
- package/types/HrrrProducts.d.ts +5 -0
- package/types/IconProducts.d.ts +5 -0
- package/types/LabelsLayer.d.ts +2 -0
- package/types/LandMask.d.ts +2 -0
- package/types/Layer.d.ts +137 -0
- package/types/Legend.d.ts +6 -0
- package/types/LongTap.d.ts +21 -0
- package/types/Metric.d.ts +132 -0
- package/types/MetricClasses.d.ts +37 -0
- package/types/MobileCalendar.d.ts +47 -0
- package/types/NamProducts.d.ts +5 -0
- package/types/OfflineMessagesClasses.d.ts +30 -0
- package/types/Overlay.d.ts +150 -0
- package/types/OverlayClasses.d.ts +29 -0
- package/types/Particles.d.ts +111 -0
- package/types/Plugin.d.ts +112 -0
- package/types/Product.d.ts +211 -0
- package/types/ProductSwitch.d.ts +14 -0
- package/types/Renderer.d.ts +69 -0
- package/types/SatelliteProduct.d.ts +19 -0
- package/types/Scrollable.d.ts +14 -0
- package/types/StaticProduct.d.ts +7 -0
- package/types/SveltePanePlugin.d.ts +18 -0
- package/types/SveltePlugin.d.ts +40 -0
- package/types/Swipe.d.ts +34 -0
- package/types/Switch.d.ts +24 -0
- package/types/TagPlugin.d.ts +6 -0
- package/types/TileLayer.d.ts +9 -0
- package/types/TileLayerCanvas.d.ts +2 -0
- package/types/TileLayerMultiPatch.d.ts +2 -0
- package/types/TimestampBar.d.ts +8 -0
- package/types/Webcams.d.ts +66 -0
- package/types/Window.d.ts +107 -0
- package/types/WindowPlugin.d.ts +171 -0
- package/types/baseMap.d.ts +10 -0
- package/types/broadcast.d.ts +14 -0
- package/types/cityLabels.d.ts +2 -0
- package/types/cloudSync.d.ts +12 -0
- package/types/colors.d.ts +4 -0
- package/types/connection.d.ts +4 -0
- package/types/css.d.ts +25 -0
- package/types/dataLoader.d.ts +26 -0
- package/types/dataSpecifications.d.ts +12 -0
- package/types/detectDevice.d.ts +6 -0
- package/types/device.d.ts +19 -0
- package/types/deviceLogging.d.ts +13 -0
- package/types/fetch.d.ts +88 -0
- package/types/format.d.ts +102 -0
- package/types/ga.d.ts +1 -0
- package/types/geolocation.d.ts +30 -0
- package/types/glTileRender.d.ts +178 -0
- package/types/glsl-modules.d.ts +26 -0
- package/types/hp.d.ts +15 -0
- package/types/http.d.ts +62 -0
- package/types/iconfont.d.ts +196 -0
- package/types/index.d.ts +1 -0
- package/types/interfaces.d.ts +1727 -0
- package/types/interpolator.d.ts +19 -0
- package/types/lang-files.d.ts +5116 -0
- package/types/latestBroadcasts.d.ts +14 -0
- package/types/layers.d.ts +78 -0
- package/types/leaflet.d.ts +1919 -0
- package/types/legends.d.ts +6 -0
- package/types/levelUtils.d.ts +2 -0
- package/types/libGuard.d.ts +1 -0
- package/types/location.d.ts +72 -0
- package/types/log.d.ts +2 -0
- package/types/lruCache.d.ts +69 -0
- package/types/map.d.ts +80 -0
- package/types/metrics.d.ts +3 -0
- package/types/mobileUtils.d.ts +7 -0
- package/types/models.d.ts +42 -0
- package/types/node-modules.d.ts +16 -0
- package/types/notifications.d.ts +66 -0
- package/types/offlineController.d.ts +20 -0
- package/types/overlays.d.ts +67 -0
- package/types/particleRenderers.d.ts +4 -0
- package/types/permanentPromos.d.ts +2 -0
- package/types/picker.d.ts +66 -0
- package/types/plugins.d.ts +3 -0
- package/types/pois.d.ts +16 -0
- package/types/products.d.ts +3 -0
- package/types/promo.d.ts +37 -0
- package/types/query.d.ts +19 -0
- package/types/queryString.d.ts +2 -0
- package/types/renderCtrl.d.ts +8 -0
- package/types/renderTile.d.ts +6 -0
- package/types/renderUtils.d.ts +107 -0
- package/types/renderers.d.ts +20 -0
- package/types/reverseName.d.ts +10 -0
- package/types/rhMessage.d.ts +3 -0
- package/types/rootScope.d.ts +152 -0
- package/types/router.d.ts +30 -0
- package/types/seoParser.d.ts +19 -0
- package/types/share.d.ts +1 -0
- package/types/showableErrorsService.d.ts +31 -0
- package/types/singleclick.d.ts +52 -0
- package/types/storage.d.ts +3 -0
- package/types/store.d.ts +148 -0
- package/types/subscription.d.ts +65 -0
- package/types/tileInterpolator.d.ts +27 -0
- package/types/tileLayerInstance.d.ts +2 -0
- package/types/timestampUtils.d.ts +5 -0
- package/types/trans.d.ts +68 -0
- package/types/ts-interfaces.d.ts +66 -0
- package/types/ts-types.d.ts +43 -0
- package/types/types.d.ts +308 -0
- package/types/user.d.ts +54 -0
- package/types/userFavs.d.ts +129 -0
- package/types/utils.d.ts +424 -0
- package/types/variables.d.ts +238 -0
- package/types/windy-modules.d.ts +7 -0
|
@@ -0,0 +1,1919 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
|
|
3
|
+
// IT IS COPY-PASTED AND MODIFIED @types/leflet 1.4.7
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
We use a lot of Leaflet plugins and leaflet private properties. So we need to extend extisting Leaflet,
|
|
7
|
+
but leaflet in its typings exports self as a namespace. And it is impossible to change TS namespace declaration.
|
|
8
|
+
|
|
9
|
+
That is why we modified typings and enhance them with our properties (private variables & plugins)
|
|
10
|
+
|
|
11
|
+
Better solution would be something like:
|
|
12
|
+
```
|
|
13
|
+
import 'leaflet';
|
|
14
|
+
L.GridLayer.options = L.GridLayerOptions & {
|
|
15
|
+
zIndex?: number;
|
|
16
|
+
};
|
|
17
|
+
```
|
|
18
|
+
or if leaflet typings would not export namespace and we could do it our way.
|
|
19
|
+
|
|
20
|
+
But it is impossible, so we have to do this the complicated way :-/
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
type InheritedOptionally<All, Inherited extends keyof All> = Omit<All, Inherited> &
|
|
24
|
+
Partial<Pick<All, Inherited>>;
|
|
25
|
+
|
|
26
|
+
declare namespace L {
|
|
27
|
+
export type CanvasElement = HTMLCanvasElement & { _leaflet_pos: Point };
|
|
28
|
+
export class Class {
|
|
29
|
+
// @ts-expect-error Leaflet typings
|
|
30
|
+
static extend<T extends Class>(prop: InheritedOptionally<T, keyof Class>): typeof T;
|
|
31
|
+
static include(props: any): any & typeof Class;
|
|
32
|
+
static mergeOptions(props: any): any & typeof Class;
|
|
33
|
+
|
|
34
|
+
static addInitHook(initHookFn: () => void): any & typeof Class;
|
|
35
|
+
static addInitHook(methodName: string, ...args: any[]): any & typeof Class;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export class Transformation {
|
|
39
|
+
constructor(a: number, b: number, c: number, d: number);
|
|
40
|
+
transform(point: Point, scale?: number): Point;
|
|
41
|
+
untransform(point: Point, scale?: number): Point;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export namespace LineUtil {
|
|
45
|
+
function simplify(points: Point[], tolerance: number): Point[];
|
|
46
|
+
function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number;
|
|
47
|
+
function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point;
|
|
48
|
+
function isFlat(latlngs: LatLngExpression[]): boolean;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export namespace PolyUtil {
|
|
52
|
+
function clipPolygon(points: Point[], bounds: BoundsExpression, round?: boolean): Point[];
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export namespace DomUtil {
|
|
56
|
+
/**
|
|
57
|
+
* Get Element by its ID or with the given HTML-Element
|
|
58
|
+
*/
|
|
59
|
+
function get(element: string | HTMLElement): HTMLElement | null;
|
|
60
|
+
function getStyle(el: HTMLElement, styleAttrib: string): string | null;
|
|
61
|
+
function create(
|
|
62
|
+
tagName: 'canvas',
|
|
63
|
+
className?: string,
|
|
64
|
+
container?: HTMLElement,
|
|
65
|
+
): HTMLCanvasElement;
|
|
66
|
+
function create(tagName: string, className?: string, container?: HTMLElement): HTMLElement;
|
|
67
|
+
function remove(el: HTMLElement): void;
|
|
68
|
+
function empty(el: HTMLElement): void;
|
|
69
|
+
function toFront(el: HTMLElement): void;
|
|
70
|
+
function toBack(el: HTMLElement): void;
|
|
71
|
+
function hasClass(el: HTMLElement, name: string): boolean;
|
|
72
|
+
function addClass(el: HTMLElement, name: string): void;
|
|
73
|
+
function removeClass(el: HTMLElement, name: string): void;
|
|
74
|
+
function setClass(el: HTMLElement, name: string): void;
|
|
75
|
+
function getClass(el: HTMLElement): string;
|
|
76
|
+
function setOpacity(el: HTMLElement, opacity: number): void;
|
|
77
|
+
function testProp(props: string[]): string | false;
|
|
78
|
+
function setTransform(el: HTMLElement, offset?: Point, scale?: number): void;
|
|
79
|
+
function setPosition(el: HTMLElement, position: Point): void;
|
|
80
|
+
function getPosition(el: HTMLElement): Point;
|
|
81
|
+
function disableTextSelection(): void;
|
|
82
|
+
function enableTextSelection(): void;
|
|
83
|
+
function disableImageDrag(): void;
|
|
84
|
+
function enableImageDrag(): void;
|
|
85
|
+
function preventOutline(el: HTMLElement): void;
|
|
86
|
+
function restoreOutline(): void;
|
|
87
|
+
|
|
88
|
+
let TRANSFORM: keyof CSSStyleDeclaration;
|
|
89
|
+
let TRANSITION: string;
|
|
90
|
+
let TRANSITION_END: string;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface CRS {
|
|
94
|
+
latLngToPoint(latlng: LatLngExpression, zoom: number): Point;
|
|
95
|
+
pointToLatLng(point: PointExpression, zoom: number): LatLng;
|
|
96
|
+
project(latlng: LatLng | LatLngLiteral): Point;
|
|
97
|
+
unproject(point: PointExpression): LatLng;
|
|
98
|
+
scale(zoom: number): number;
|
|
99
|
+
zoom(scale: number): number;
|
|
100
|
+
getProjectedBounds(zoom: number): Bounds;
|
|
101
|
+
distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number;
|
|
102
|
+
wrapLatLng(latlng: LatLng | LatLngLiteral): LatLng;
|
|
103
|
+
|
|
104
|
+
code?: string;
|
|
105
|
+
wrapLng?: [number, number];
|
|
106
|
+
wrapLat?: [number, number];
|
|
107
|
+
infinite: boolean;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export namespace CRS {
|
|
111
|
+
const EPSG3395: CRS;
|
|
112
|
+
const EPSG3857: CRS;
|
|
113
|
+
const EPSG4326: CRS;
|
|
114
|
+
const Earth: CRS;
|
|
115
|
+
const Simple: CRS;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export interface Projection {
|
|
119
|
+
project(latlng: LatLng | LatLngLiteral): Point;
|
|
120
|
+
unproject(point: PointExpression): LatLng;
|
|
121
|
+
|
|
122
|
+
bounds: Bounds;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export namespace Projection {
|
|
126
|
+
const LonLat: Projection;
|
|
127
|
+
const Mercator: Projection;
|
|
128
|
+
const SphericalMercator: Projection;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export class LatLng {
|
|
132
|
+
constructor(latitude: number, longitude: number, altitude?: number);
|
|
133
|
+
equals(otherLatLng: LatLngExpression, maxMargin?: number): boolean;
|
|
134
|
+
toString(): string;
|
|
135
|
+
distanceTo(otherLatLng: LatLngExpression): number;
|
|
136
|
+
wrap(): LatLng;
|
|
137
|
+
toBounds(sizeInMeters: number): LatLngBounds;
|
|
138
|
+
|
|
139
|
+
lat: number;
|
|
140
|
+
lng: number;
|
|
141
|
+
alt?: number;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
export interface LatLngLiteral {
|
|
145
|
+
lat: number;
|
|
146
|
+
lng: number;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export type LatLngTuple = [number, number];
|
|
150
|
+
|
|
151
|
+
export type LatLngExpression = LatLng | LatLngLiteral | LatLngTuple;
|
|
152
|
+
|
|
153
|
+
export function latLng(latitude: number, longitude: number, altitude?: number): LatLng;
|
|
154
|
+
|
|
155
|
+
export function latLng(
|
|
156
|
+
coords:
|
|
157
|
+
| LatLngTuple
|
|
158
|
+
| [number, number, number]
|
|
159
|
+
| LatLngLiteral
|
|
160
|
+
| { lat: number; lng: number; alt?: number },
|
|
161
|
+
): LatLng;
|
|
162
|
+
|
|
163
|
+
export class LatLngBounds {
|
|
164
|
+
constructor(southWest: LatLngExpression, northEast: LatLngExpression);
|
|
165
|
+
constructor(latlngs: LatLngBoundsLiteral);
|
|
166
|
+
extend(latlngOrBounds: LatLngExpression | LatLngBoundsExpression): this;
|
|
167
|
+
pad(bufferRatio: number): LatLngBounds; // does this modify the current instance or does it return a new one?
|
|
168
|
+
getCenter(): LatLng;
|
|
169
|
+
getSouthWest(): LatLng;
|
|
170
|
+
getNorthEast(): LatLng;
|
|
171
|
+
getNorthWest(): LatLng;
|
|
172
|
+
getSouthEast(): LatLng;
|
|
173
|
+
getWest(): number;
|
|
174
|
+
getSouth(): number;
|
|
175
|
+
getEast(): number;
|
|
176
|
+
getNorth(): number;
|
|
177
|
+
contains(otherBoundsOrLatLng: LatLngBoundsExpression | LatLngExpression): boolean;
|
|
178
|
+
intersects(otherBounds: LatLngBoundsExpression): boolean;
|
|
179
|
+
overlaps(otherBounds: BoundsExpression): boolean; // investigate if this is really bounds and not latlngbounds
|
|
180
|
+
toBBoxString(): string;
|
|
181
|
+
equals(otherBounds: LatLngBoundsExpression): boolean;
|
|
182
|
+
isValid(): boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export type LatLngBoundsLiteral = LatLngTuple[]; // Must be [LatLngTuple, LatLngTuple], cant't change because Map.setMaxBounds
|
|
186
|
+
|
|
187
|
+
export type LatLngBoundsExpression = LatLngBounds | LatLngBoundsLiteral;
|
|
188
|
+
|
|
189
|
+
export function latLngBounds(
|
|
190
|
+
southWest: LatLngExpression,
|
|
191
|
+
northEast: LatLngExpression,
|
|
192
|
+
): LatLngBounds;
|
|
193
|
+
|
|
194
|
+
export function latLngBounds(latlngs: LatLngExpression[]): LatLngBounds;
|
|
195
|
+
|
|
196
|
+
export type PointTuple = [number, number];
|
|
197
|
+
|
|
198
|
+
export class Point {
|
|
199
|
+
constructor(x: number, y: number, round?: boolean);
|
|
200
|
+
clone(): Point;
|
|
201
|
+
add(otherPoint: PointExpression): Point; // non-destructive, returns a new point
|
|
202
|
+
subtract(otherPoint: PointExpression): Point;
|
|
203
|
+
divideBy(num: number): Point;
|
|
204
|
+
multiplyBy(num: number): Point;
|
|
205
|
+
scaleBy(scale: PointExpression): Point;
|
|
206
|
+
unscaleBy(scale: PointExpression): Point;
|
|
207
|
+
round(): Point;
|
|
208
|
+
floor(): Point;
|
|
209
|
+
_floor(): Point;
|
|
210
|
+
ceil(): Point;
|
|
211
|
+
distanceTo(otherPoint: PointExpression): number;
|
|
212
|
+
equals(otherPoint: PointExpression): boolean;
|
|
213
|
+
contains(otherPoint: PointExpression): boolean;
|
|
214
|
+
toString(): string;
|
|
215
|
+
x: number;
|
|
216
|
+
y: number;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
export interface Coords extends Point {
|
|
220
|
+
z: number;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export type PointExpression = Point | PointTuple;
|
|
224
|
+
|
|
225
|
+
export function point(x: number, y: number, round?: boolean): Point;
|
|
226
|
+
|
|
227
|
+
export function point(coords: PointTuple | { x: number; y: number }): Point;
|
|
228
|
+
|
|
229
|
+
export type BoundsLiteral = [PointTuple, PointTuple];
|
|
230
|
+
|
|
231
|
+
export class Bounds {
|
|
232
|
+
constructor(topLeft: PointExpression, bottomRight: PointExpression);
|
|
233
|
+
constructor(points: Point[] | BoundsLiteral);
|
|
234
|
+
extend(point: PointExpression): this;
|
|
235
|
+
getCenter(round?: boolean): Point;
|
|
236
|
+
getBottomLeft(): Point;
|
|
237
|
+
getTopRight(): Point;
|
|
238
|
+
getSize(): Point;
|
|
239
|
+
contains(pointOrBounds: BoundsExpression | PointExpression): boolean;
|
|
240
|
+
intersects(otherBounds: BoundsExpression): boolean;
|
|
241
|
+
overlaps(otherBounds: BoundsExpression): boolean;
|
|
242
|
+
|
|
243
|
+
min?: Point;
|
|
244
|
+
max?: Point;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
export type BoundsExpression = Bounds | BoundsLiteral;
|
|
248
|
+
|
|
249
|
+
export function bounds(topLeft: PointExpression, bottomRight: PointExpression): Bounds;
|
|
250
|
+
|
|
251
|
+
export function bounds(points: Point[] | BoundsLiteral): Bounds;
|
|
252
|
+
|
|
253
|
+
export type LeafletEventHandlerFn = (event: LeafletEvent) => void;
|
|
254
|
+
|
|
255
|
+
export interface LeafletEventHandlerFnMap {
|
|
256
|
+
[type: string]: LeafletEventHandlerFn;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* A set of methods shared between event-powered classes (like Map and Marker).
|
|
261
|
+
* Generally, events allow you to execute some function when something happens
|
|
262
|
+
* with an object (e.g. the user clicks on the map, causing the map to fire
|
|
263
|
+
* 'click' event).
|
|
264
|
+
*/
|
|
265
|
+
export abstract class Evented extends Class {
|
|
266
|
+
/**
|
|
267
|
+
* Adds a listener function (fn) to a particular event type of the object.
|
|
268
|
+
* You can optionally specify the context of the listener (object the this
|
|
269
|
+
* keyword will point to). You can also pass several space-separated types
|
|
270
|
+
* (e.g. 'click dblclick').
|
|
271
|
+
*/
|
|
272
|
+
on(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
|
273
|
+
|
|
274
|
+
on(type: 'contextmenu', fn: (event: LeafletMouseEvent) => void, context?: any): this;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
|
|
278
|
+
*/
|
|
279
|
+
on(eventMap: LeafletEventHandlerFnMap): this;
|
|
280
|
+
|
|
281
|
+
/**
|
|
282
|
+
* Removes a previously added listener function. If no function is specified,
|
|
283
|
+
* it will remove all the listeners of that particular event from the object.
|
|
284
|
+
* Note that if you passed a custom context to on, you must pass the same context
|
|
285
|
+
* to off in order to remove the listener.
|
|
286
|
+
*/
|
|
287
|
+
// With an eventMap there are no additional arguments allowed
|
|
288
|
+
// tslint:disable-next-line:unified-signatures
|
|
289
|
+
off(type: string, fn?: LeafletEventHandlerFn, context?: any): this;
|
|
290
|
+
|
|
291
|
+
/**
|
|
292
|
+
* Removes a set of type/listener pairs.
|
|
293
|
+
*/
|
|
294
|
+
// With an eventMap there are no additional arguments allowed
|
|
295
|
+
// tslint:disable-next-line:unified-signatures
|
|
296
|
+
off(eventMap: LeafletEventHandlerFnMap): this;
|
|
297
|
+
/**
|
|
298
|
+
* Removes all listeners to all events on the object.
|
|
299
|
+
*/
|
|
300
|
+
off(): this;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Fires an event of the specified type. You can optionally provide a data
|
|
304
|
+
* object — the first argument of the listener function will contain its properties.
|
|
305
|
+
* The event might can optionally be propagated to event parents.
|
|
306
|
+
*/
|
|
307
|
+
fire(type: string, data?: any, propagate?: boolean): this;
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Returns true if a particular event type has any listeners attached to it.
|
|
311
|
+
*/
|
|
312
|
+
listens(type: string): boolean;
|
|
313
|
+
|
|
314
|
+
/**
|
|
315
|
+
* Behaves as on(...), except the listener will only get fired once and then removed.
|
|
316
|
+
*/
|
|
317
|
+
once(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
|
318
|
+
|
|
319
|
+
/**
|
|
320
|
+
* Behaves as on(...), except the listener will only get fired once and then removed.
|
|
321
|
+
*/
|
|
322
|
+
once(eventMap: LeafletEventHandlerFnMap): this;
|
|
323
|
+
|
|
324
|
+
/**
|
|
325
|
+
* Adds an event parent - an Evented that will receive propagated events
|
|
326
|
+
*/
|
|
327
|
+
addEventParent(obj: Evented): this;
|
|
328
|
+
|
|
329
|
+
/**
|
|
330
|
+
* Removes an event parent, so it will stop receiving propagated events
|
|
331
|
+
*/
|
|
332
|
+
removeEventParent(obj: Evented): this;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Alias for on(...)
|
|
336
|
+
*
|
|
337
|
+
* Adds a listener function (fn) to a particular event type of the object.
|
|
338
|
+
* You can optionally specify the context of the listener (object the this
|
|
339
|
+
* keyword will point to). You can also pass several space-separated types
|
|
340
|
+
* (e.g. 'click dblclick').
|
|
341
|
+
*/
|
|
342
|
+
addEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
|
343
|
+
|
|
344
|
+
/**
|
|
345
|
+
* Alias for on(...)
|
|
346
|
+
*
|
|
347
|
+
* Adds a set of type/listener pairs, e.g. {click: onClick, mousemove: onMouseMove}
|
|
348
|
+
*/
|
|
349
|
+
addEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
|
350
|
+
|
|
351
|
+
/**
|
|
352
|
+
* Alias for off(...)
|
|
353
|
+
*
|
|
354
|
+
* Removes a previously added listener function. If no function is specified,
|
|
355
|
+
* it will remove all the listeners of that particular event from the object.
|
|
356
|
+
* Note that if you passed a custom context to on, you must pass the same context
|
|
357
|
+
* to off in order to remove the listener.
|
|
358
|
+
*/
|
|
359
|
+
removeEventListener(type: string, fn?: LeafletEventHandlerFn, context?: any): this;
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Alias for off(...)
|
|
363
|
+
*
|
|
364
|
+
* Removes a set of type/listener pairs.
|
|
365
|
+
*/
|
|
366
|
+
removeEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
|
367
|
+
|
|
368
|
+
/**
|
|
369
|
+
* Alias for off()
|
|
370
|
+
*
|
|
371
|
+
* Removes all listeners to all events on the object.
|
|
372
|
+
*/
|
|
373
|
+
clearAllEventListeners(): this;
|
|
374
|
+
|
|
375
|
+
/**
|
|
376
|
+
* Alias for once(...)
|
|
377
|
+
*
|
|
378
|
+
* Behaves as on(...), except the listener will only get fired once and then removed.
|
|
379
|
+
*/
|
|
380
|
+
addOneTimeEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
|
381
|
+
|
|
382
|
+
/**
|
|
383
|
+
* Alias for once(...)
|
|
384
|
+
*
|
|
385
|
+
* Behaves as on(...), except the listener will only get fired once and then removed.
|
|
386
|
+
*/
|
|
387
|
+
addOneTimeEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Alias for fire(...)
|
|
391
|
+
*
|
|
392
|
+
* Fires an event of the specified type. You can optionally provide a data
|
|
393
|
+
* object — the first argument of the listener function will contain its properties.
|
|
394
|
+
* The event might can optionally be propagated to event parents.
|
|
395
|
+
*/
|
|
396
|
+
fireEvent(type: string, data?: any, propagate?: boolean): this;
|
|
397
|
+
|
|
398
|
+
/**
|
|
399
|
+
* Alias for listens(...)
|
|
400
|
+
*
|
|
401
|
+
* Returns true if a particular event type has any listeners attached to it.
|
|
402
|
+
*/
|
|
403
|
+
hasEventListeners(type: string): boolean;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* A class for making DOM elements draggable (including touch support).
|
|
408
|
+
* Used internally for map and marker dragging. Only works for elements
|
|
409
|
+
* that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).
|
|
410
|
+
*/
|
|
411
|
+
export class Draggable extends Evented {
|
|
412
|
+
constructor(element: HTMLElement, dragStartTarget?: HTMLElement, preventOutline?: boolean);
|
|
413
|
+
|
|
414
|
+
enable(): void;
|
|
415
|
+
|
|
416
|
+
disable(): void;
|
|
417
|
+
|
|
418
|
+
finishDrag(): void;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
export interface LayerOptions {
|
|
422
|
+
pane?: string;
|
|
423
|
+
attribution?: string;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
export interface InteractiveLayerOptions extends LayerOptions {
|
|
427
|
+
interactive?: boolean;
|
|
428
|
+
bubblingMouseEvents?: boolean;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export class Layer extends Evented {
|
|
432
|
+
_popup?: L.Popup;
|
|
433
|
+
|
|
434
|
+
constructor(options?: LayerOptions);
|
|
435
|
+
// @ts-expect-error Leaflet typings
|
|
436
|
+
static extend<T extends Layer>(prop: InheritedOptionally<T, keyof Layer>): typeof T;
|
|
437
|
+
addTo(map: Map | LayerGroup): this;
|
|
438
|
+
remove(): this;
|
|
439
|
+
removeFrom(map: Map): this;
|
|
440
|
+
getPane(name?: string): HTMLElement | undefined;
|
|
441
|
+
|
|
442
|
+
// Popup methods
|
|
443
|
+
bindPopup(
|
|
444
|
+
content: ((layer: Layer) => Content) | Content | Popup,
|
|
445
|
+
options?: PopupOptions,
|
|
446
|
+
): this;
|
|
447
|
+
unbindPopup(): this;
|
|
448
|
+
openPopup(latlng?: LatLngExpression): this;
|
|
449
|
+
closePopup(): this;
|
|
450
|
+
togglePopup(): this;
|
|
451
|
+
isPopupOpen(): boolean;
|
|
452
|
+
setPopupContent(content: Content | Popup): this;
|
|
453
|
+
getPopup(): Popup | undefined;
|
|
454
|
+
|
|
455
|
+
// Tooltip methods
|
|
456
|
+
bindTooltip(
|
|
457
|
+
content: ((layer: Layer) => Content) | Tooltip | Content,
|
|
458
|
+
options?: TooltipOptions,
|
|
459
|
+
): this;
|
|
460
|
+
unbindTooltip(): this;
|
|
461
|
+
openTooltip(latlng?: LatLngExpression): this;
|
|
462
|
+
closeTooltip(): this;
|
|
463
|
+
toggleTooltip(): this;
|
|
464
|
+
isTooltipOpen(): boolean;
|
|
465
|
+
setTooltipContent(content: Content | Tooltip): this;
|
|
466
|
+
getTooltip(): Tooltip | undefined;
|
|
467
|
+
|
|
468
|
+
// Extension methods
|
|
469
|
+
onAdd(map: Map): this;
|
|
470
|
+
onRemove(map: Map): this;
|
|
471
|
+
getEvents?(): { [name: string]: (event: LeafletEvent) => void };
|
|
472
|
+
getAttribution?(): string | null;
|
|
473
|
+
beforeAdd?(map: Map): this;
|
|
474
|
+
|
|
475
|
+
_removeAllTiles(): void;
|
|
476
|
+
_getTilePos(coords: Coords): Coords;
|
|
477
|
+
|
|
478
|
+
public _map: Map;
|
|
479
|
+
public options: LayerOptions;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export interface GridLayerOptions {
|
|
483
|
+
tileSize?: number | Point;
|
|
484
|
+
opacity?: number;
|
|
485
|
+
updateWhenIdle?: boolean;
|
|
486
|
+
updateWhenZooming?: boolean;
|
|
487
|
+
updateInterval?: number;
|
|
488
|
+
attribution?: string;
|
|
489
|
+
zIndex?: number;
|
|
490
|
+
bounds?: LatLngBoundsExpression;
|
|
491
|
+
minZoom?: number;
|
|
492
|
+
maxZoom?: number;
|
|
493
|
+
noWrap?: boolean;
|
|
494
|
+
pane?: string;
|
|
495
|
+
className?: string;
|
|
496
|
+
keepBuffer?: number;
|
|
497
|
+
disableTransformForTiles?: boolean;
|
|
498
|
+
async?: boolean;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export type DoneCallback = (error?: Error, tile?: HTMLElement) => void;
|
|
502
|
+
|
|
503
|
+
export interface InternalTiles {
|
|
504
|
+
[key: string]: {
|
|
505
|
+
active?: boolean;
|
|
506
|
+
coords: Coords;
|
|
507
|
+
current: boolean;
|
|
508
|
+
el: HTMLDivElement;
|
|
509
|
+
loaded?: Date;
|
|
510
|
+
retain?: boolean;
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
export class GridLayer extends Layer {
|
|
515
|
+
constructor(options?: GridLayerOptions);
|
|
516
|
+
|
|
517
|
+
// @ts-expect-error Leaflet typings
|
|
518
|
+
static extend<T extends GridLayer>(prop: InheritedOptionally<T, keyof GridLayer>): typeof T;
|
|
519
|
+
bringToFront(): this;
|
|
520
|
+
bringToBack(): this;
|
|
521
|
+
getContainer(): HTMLElement | null;
|
|
522
|
+
setOpacity(opacity: number): this;
|
|
523
|
+
setZIndex(zIndex: number): this;
|
|
524
|
+
isLoading(): boolean;
|
|
525
|
+
redraw(): this;
|
|
526
|
+
// @ts-expect-error Leaflet typings
|
|
527
|
+
onAdd(): void;
|
|
528
|
+
getTileSize(): Point;
|
|
529
|
+
|
|
530
|
+
_wrapCoords(coords: Coords): Coords;
|
|
531
|
+
|
|
532
|
+
createTile(coords: Coords, done: DoneCallback): HTMLElement;
|
|
533
|
+
_tileCoordsToKey(coords: Coords): string;
|
|
534
|
+
_initContainer(): void;
|
|
535
|
+
|
|
536
|
+
_loading: boolean;
|
|
537
|
+
|
|
538
|
+
_tiles: InternalTiles;
|
|
539
|
+
_tileZoom?: number;
|
|
540
|
+
public options: GridLayerOptions;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
export function gridLayer(options?: GridLayerOptions): GridLayer;
|
|
544
|
+
|
|
545
|
+
export class LatLngGraticule extends Layer {}
|
|
546
|
+
|
|
547
|
+
export type TileDefPatch = [number, number, number, number, number];
|
|
548
|
+
export type TileDef = {
|
|
549
|
+
url: string;
|
|
550
|
+
subdomains?: string | string[];
|
|
551
|
+
patchUrl?: string;
|
|
552
|
+
patch?: TileDefPatch;
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
export class TileLayerMulti extends TileLayer {
|
|
556
|
+
static extend<T extends TileLayerMulti>(
|
|
557
|
+
prop: InheritedOptionally<T, keyof TileLayerMulti>,
|
|
558
|
+
): // @ts-expect-error Leaflet typings
|
|
559
|
+
typeof T;
|
|
560
|
+
initialize(tileDefs?: Record<number, L.TileDef>, options?: TileLayerOptions): void;
|
|
561
|
+
// @ts-expect-error Leaflet typings
|
|
562
|
+
setUrl(): void;
|
|
563
|
+
getTileUrl(tilePoint: Point): string;
|
|
564
|
+
_fixTileDef(tileDef: TileDef): TileDef;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
export class CanvasLayer extends (await import('@windy/CanvasLayer.d')).CanvasLayer {}
|
|
568
|
+
|
|
569
|
+
export interface TileLayerOptions extends GridLayerOptions {
|
|
570
|
+
minZoom?: number;
|
|
571
|
+
maxZoom?: number;
|
|
572
|
+
maxNativeZoom?: number;
|
|
573
|
+
minNativeZoom?: number;
|
|
574
|
+
subdomains?: string | string[];
|
|
575
|
+
errorTileUrl?: string;
|
|
576
|
+
zoomOffset?: number;
|
|
577
|
+
tms?: boolean;
|
|
578
|
+
zoomReverse?: boolean;
|
|
579
|
+
detectRetina?: boolean;
|
|
580
|
+
crossOrigin?: CrossOrigin;
|
|
581
|
+
// [name: string]: any;
|
|
582
|
+
// You are able add additional properties, but it makes this interface unchackable.
|
|
583
|
+
// See: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/15313
|
|
584
|
+
// Example:
|
|
585
|
+
// tileLayer = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png?{foo}&{bar}&{abc}', {foo: 'bar', bar: (data: any) => 'foo', abc: () => ''});
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
export class TileLayer extends GridLayer {
|
|
589
|
+
constructor(urlTemplate: string, options?: TileLayerOptions);
|
|
590
|
+
initialize(tileDefs?: Record<number, L.TileDef>, options?: TileLayerOptions): void;
|
|
591
|
+
setUrl(url: string, noRedraw?: boolean): this;
|
|
592
|
+
|
|
593
|
+
protected _abortLoading(): void;
|
|
594
|
+
public _getZoomForUrl(): number;
|
|
595
|
+
|
|
596
|
+
options: TileLayerOptions;
|
|
597
|
+
}
|
|
598
|
+
|
|
599
|
+
export function tileLayer(urlTemplate: string, options?: TileLayerOptions): TileLayer;
|
|
600
|
+
|
|
601
|
+
export namespace TileLayer {
|
|
602
|
+
class WMS extends TileLayer {
|
|
603
|
+
constructor(baseUrl: string, options: WMSOptions);
|
|
604
|
+
setParams(params: WMSParams, noRedraw?: boolean): this;
|
|
605
|
+
|
|
606
|
+
wmsParams: WMSParams;
|
|
607
|
+
options: WMSOptions;
|
|
608
|
+
}
|
|
609
|
+
}
|
|
610
|
+
|
|
611
|
+
export interface WMSOptions extends TileLayerOptions {
|
|
612
|
+
layers?: string;
|
|
613
|
+
styles?: string;
|
|
614
|
+
format?: string;
|
|
615
|
+
transparent?: boolean;
|
|
616
|
+
version?: string;
|
|
617
|
+
crs?: CRS;
|
|
618
|
+
uppercase?: boolean;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
export interface WMSParams {
|
|
622
|
+
format?: string;
|
|
623
|
+
layers: string;
|
|
624
|
+
request?: string;
|
|
625
|
+
service?: string;
|
|
626
|
+
styles?: string;
|
|
627
|
+
version?: string;
|
|
628
|
+
transparent?: boolean;
|
|
629
|
+
width?: number;
|
|
630
|
+
height?: number;
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
export namespace tileLayer {
|
|
634
|
+
function wms(baseUrl: string, options?: WMSOptions): TileLayer.WMS;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
export type CrossOrigin = boolean | string;
|
|
638
|
+
|
|
639
|
+
export interface ImageOverlayOptions extends InteractiveLayerOptions {
|
|
640
|
+
opacity?: number;
|
|
641
|
+
alt?: string;
|
|
642
|
+
interactive?: boolean;
|
|
643
|
+
attribution?: string;
|
|
644
|
+
crossOrigin?: CrossOrigin;
|
|
645
|
+
errorOverlayUrl?: string;
|
|
646
|
+
zIndex?: number;
|
|
647
|
+
className?: string;
|
|
648
|
+
angle?: number;
|
|
649
|
+
}
|
|
650
|
+
|
|
651
|
+
export class ImageOverlay extends Layer {
|
|
652
|
+
constructor(
|
|
653
|
+
imageUrl: string,
|
|
654
|
+
bounds: LatLngBoundsExpression,
|
|
655
|
+
options?: ImageOverlayOptions,
|
|
656
|
+
);
|
|
657
|
+
setOpacity(opacity: number): this;
|
|
658
|
+
bringToFront(): this;
|
|
659
|
+
bringToBack(): this;
|
|
660
|
+
setUrl(url: string): this;
|
|
661
|
+
|
|
662
|
+
/** Update the bounds that this ImageOverlay covers */
|
|
663
|
+
setBounds(bounds: LatLngBounds): this;
|
|
664
|
+
|
|
665
|
+
/** Changes the zIndex of the image overlay */
|
|
666
|
+
setZIndex(value: number): this;
|
|
667
|
+
|
|
668
|
+
/** Get the bounds that this ImageOverlay covers */
|
|
669
|
+
getBounds(): LatLngBounds;
|
|
670
|
+
|
|
671
|
+
/** Get the img element that represents the ImageOverlay on the map */
|
|
672
|
+
getElement(): HTMLImageElement | undefined;
|
|
673
|
+
|
|
674
|
+
options: ImageOverlayOptions;
|
|
675
|
+
|
|
676
|
+
_reset(): void;
|
|
677
|
+
_animateZoom(e: HTMLDivElement): void;
|
|
678
|
+
|
|
679
|
+
_image: HTMLImageElement;
|
|
680
|
+
_bounds: LatLngBounds;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export function imageOverlay(
|
|
684
|
+
imageUrl: string,
|
|
685
|
+
bounds: LatLngBoundsExpression,
|
|
686
|
+
options?: ImageOverlayOptions,
|
|
687
|
+
): ImageOverlay;
|
|
688
|
+
|
|
689
|
+
export interface VideoOverlayOptions extends ImageOverlayOptions {
|
|
690
|
+
autoplay?: boolean;
|
|
691
|
+
loop?: boolean;
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export class VideoOverlay extends Layer {
|
|
695
|
+
/** VideoOverlay doesn't extend ImageOverlay because ImageOverlay.getElement returns HTMLImageElement */
|
|
696
|
+
constructor(
|
|
697
|
+
video: string | string[] | HTMLVideoElement,
|
|
698
|
+
bounds: LatLngBoundsExpression,
|
|
699
|
+
options?: VideoOverlayOptions,
|
|
700
|
+
);
|
|
701
|
+
setOpacity(opacity: number): this;
|
|
702
|
+
bringToFront(): this;
|
|
703
|
+
bringToBack(): this;
|
|
704
|
+
setUrl(url: string): this;
|
|
705
|
+
|
|
706
|
+
/** Update the bounds that this VideoOverlay covers */
|
|
707
|
+
setBounds(bounds: LatLngBounds): this;
|
|
708
|
+
|
|
709
|
+
/** Get the bounds that this VideoOverlay covers */
|
|
710
|
+
getBounds(): LatLngBounds;
|
|
711
|
+
|
|
712
|
+
/** Get the video element that represents the VideoOverlay on the map */
|
|
713
|
+
getElement(): HTMLVideoElement | undefined;
|
|
714
|
+
|
|
715
|
+
options: VideoOverlayOptions;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export function videoOverlay(
|
|
719
|
+
video: string | string[] | HTMLVideoElement,
|
|
720
|
+
bounds: LatLngBoundsExpression,
|
|
721
|
+
options?: VideoOverlayOptions,
|
|
722
|
+
): VideoOverlay;
|
|
723
|
+
|
|
724
|
+
export type LineCapShape = 'butt' | 'round' | 'square' | 'inherit';
|
|
725
|
+
|
|
726
|
+
export type LineJoinShape = 'miter' | 'round' | 'bevel' | 'inherit';
|
|
727
|
+
|
|
728
|
+
export type FillRule = 'nonzero' | 'evenodd' | 'inherit';
|
|
729
|
+
|
|
730
|
+
export interface PathOptions extends InteractiveLayerOptions {
|
|
731
|
+
stroke?: boolean;
|
|
732
|
+
color?: string;
|
|
733
|
+
weight?: number;
|
|
734
|
+
opacity?: number;
|
|
735
|
+
lineCap?: LineCapShape;
|
|
736
|
+
lineJoin?: LineJoinShape;
|
|
737
|
+
dashArray?: string | number[];
|
|
738
|
+
dashOffset?: string;
|
|
739
|
+
fill?: boolean;
|
|
740
|
+
fillColor?: string;
|
|
741
|
+
fillOpacity?: number;
|
|
742
|
+
fillRule?: FillRule;
|
|
743
|
+
renderer?: Renderer;
|
|
744
|
+
className?: string;
|
|
745
|
+
}
|
|
746
|
+
|
|
747
|
+
export abstract class Path extends Layer {
|
|
748
|
+
_latlngs: LatLng[];
|
|
749
|
+
redraw(): this;
|
|
750
|
+
setStyle(style: PathOptions): this;
|
|
751
|
+
bringToFront(): this;
|
|
752
|
+
bringToBack(): this;
|
|
753
|
+
getElement(): Element | undefined;
|
|
754
|
+
|
|
755
|
+
options: PathOptions;
|
|
756
|
+
}
|
|
757
|
+
|
|
758
|
+
export interface PolylineOptions extends PathOptions {
|
|
759
|
+
smoothFactor?: number;
|
|
760
|
+
noClip?: boolean;
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
export class Polyline<
|
|
764
|
+
T extends import('geojson').GeometryObject =
|
|
765
|
+
| import('geojson').LineString
|
|
766
|
+
| import('geojson').MultiLineString,
|
|
767
|
+
P = any,
|
|
768
|
+
> extends Path {
|
|
769
|
+
constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions);
|
|
770
|
+
toGeoJSON(): import('geojson').Feature<T, P>;
|
|
771
|
+
getLatLngs(): LatLng[] | LatLng[][] | LatLng[][][];
|
|
772
|
+
setLatLngs(
|
|
773
|
+
latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][],
|
|
774
|
+
): this;
|
|
775
|
+
isEmpty(): boolean;
|
|
776
|
+
getCenter(): LatLng;
|
|
777
|
+
getBounds(): LatLngBounds;
|
|
778
|
+
addLatLng(latlng: LatLngExpression | LatLngExpression[]): this;
|
|
779
|
+
|
|
780
|
+
feature?: import('geojson').Feature<T, P>;
|
|
781
|
+
options: PolylineOptions;
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
export function polyline(
|
|
785
|
+
latlngs: LatLngExpression[] | LatLngExpression[][],
|
|
786
|
+
options?: PolylineOptions,
|
|
787
|
+
): Polyline;
|
|
788
|
+
|
|
789
|
+
export class Polygon<P = any> extends Polyline<
|
|
790
|
+
import('geojson').Polygon | import('geojson').MultiPolygon,
|
|
791
|
+
P
|
|
792
|
+
> {
|
|
793
|
+
constructor(
|
|
794
|
+
latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][],
|
|
795
|
+
options?: PolylineOptions,
|
|
796
|
+
);
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
export function polygon(
|
|
800
|
+
latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][],
|
|
801
|
+
options?: PolylineOptions,
|
|
802
|
+
): Polygon;
|
|
803
|
+
|
|
804
|
+
export class Rectangle<P = any> extends Polygon<P> {
|
|
805
|
+
constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions);
|
|
806
|
+
setBounds(latLngBounds: LatLngBoundsExpression): this;
|
|
807
|
+
}
|
|
808
|
+
|
|
809
|
+
export function rectangle(
|
|
810
|
+
latLngBounds: LatLngBoundsExpression,
|
|
811
|
+
options?: PolylineOptions,
|
|
812
|
+
): Rectangle;
|
|
813
|
+
|
|
814
|
+
export interface CircleMarkerOptions extends PathOptions {
|
|
815
|
+
radius?: number;
|
|
816
|
+
}
|
|
817
|
+
|
|
818
|
+
export class CircleMarker<P = any> extends Path {
|
|
819
|
+
constructor(latlng: LatLngExpression, options?: CircleMarkerOptions);
|
|
820
|
+
toGeoJSON(): import('geojson').Feature<import('geojson').Point, P>;
|
|
821
|
+
setLatLng(latLng: LatLngExpression): this;
|
|
822
|
+
getLatLng(): LatLng;
|
|
823
|
+
setRadius(radius: number): this;
|
|
824
|
+
getRadius(): number;
|
|
825
|
+
|
|
826
|
+
options: CircleMarkerOptions;
|
|
827
|
+
feature?: import('geojson').Feature<import('geojson').Point, P>;
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
export function circleMarker(
|
|
831
|
+
latlng: LatLngExpression,
|
|
832
|
+
options?: CircleMarkerOptions,
|
|
833
|
+
): CircleMarker;
|
|
834
|
+
|
|
835
|
+
export class Circle<P = any> extends CircleMarker<P> {
|
|
836
|
+
constructor(latlng: LatLngExpression, options?: CircleMarkerOptions);
|
|
837
|
+
constructor(latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions); // deprecated!
|
|
838
|
+
getBounds(): LatLngBounds;
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
export function circle(latlng: LatLngExpression, options?: CircleMarkerOptions): Circle;
|
|
842
|
+
export function circle(
|
|
843
|
+
latlng: LatLngExpression,
|
|
844
|
+
radius: number,
|
|
845
|
+
options?: CircleMarkerOptions,
|
|
846
|
+
): Circle; // deprecated!
|
|
847
|
+
|
|
848
|
+
export interface RendererOptions extends LayerOptions {
|
|
849
|
+
padding?: number;
|
|
850
|
+
}
|
|
851
|
+
|
|
852
|
+
export class Renderer extends Layer {
|
|
853
|
+
constructor(options?: RendererOptions);
|
|
854
|
+
|
|
855
|
+
options: RendererOptions;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
export class SVG extends Renderer {}
|
|
859
|
+
|
|
860
|
+
export namespace SVG {
|
|
861
|
+
function create(name: string): SVGElement;
|
|
862
|
+
|
|
863
|
+
function pointsToPath(rings: PointExpression[], close: boolean): string;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
export function svg(options?: RendererOptions): SVG;
|
|
867
|
+
|
|
868
|
+
export class Canvas extends Renderer {}
|
|
869
|
+
|
|
870
|
+
export function canvas(options?: RendererOptions): Canvas;
|
|
871
|
+
|
|
872
|
+
/**
|
|
873
|
+
* Used to group several layers and handle them as one.
|
|
874
|
+
* If you add it to the map, any layers added or removed from the group will be
|
|
875
|
+
* added/removed on the map as well. Extends Layer.
|
|
876
|
+
*/
|
|
877
|
+
export class LayerGroup<P = any> extends Layer {
|
|
878
|
+
constructor(layers?: Layer[], options?: LayerOptions);
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection, GeoJSONFeatureCollection or Multipoint).
|
|
882
|
+
*/
|
|
883
|
+
toGeoJSON():
|
|
884
|
+
| import('geojson').FeatureCollection<import('geojson').GeometryObject, P>
|
|
885
|
+
| import('geojson').Feature<import('geojson').MultiPoint, P>
|
|
886
|
+
| import('geojson').GeometryCollection;
|
|
887
|
+
|
|
888
|
+
/**
|
|
889
|
+
* Adds the given layer to the group.
|
|
890
|
+
*/
|
|
891
|
+
addLayer(layer: Layer): this;
|
|
892
|
+
|
|
893
|
+
/**
|
|
894
|
+
* Removes the layer with the given internal ID or the given layer from the group.
|
|
895
|
+
*/
|
|
896
|
+
removeLayer(layer: number | Layer): this;
|
|
897
|
+
|
|
898
|
+
/**
|
|
899
|
+
* Returns true if the given layer is currently added to the group.
|
|
900
|
+
*/
|
|
901
|
+
hasLayer(layer: Layer): boolean;
|
|
902
|
+
|
|
903
|
+
/**
|
|
904
|
+
* Removes all the layers from the group.
|
|
905
|
+
*/
|
|
906
|
+
clearLayers(): this;
|
|
907
|
+
|
|
908
|
+
/**
|
|
909
|
+
* Calls methodName on every layer contained in this group, passing any additional parameters.
|
|
910
|
+
* Has no effect if the layers contained do not implement methodName.
|
|
911
|
+
*/
|
|
912
|
+
invoke(methodName: string, ...params: any[]): this;
|
|
913
|
+
|
|
914
|
+
/**
|
|
915
|
+
* Iterates over the layers of the group,
|
|
916
|
+
* optionally specifying context of the iterator function.
|
|
917
|
+
*/
|
|
918
|
+
eachLayer(fn: (layer: Layer) => void, context?: any): this;
|
|
919
|
+
|
|
920
|
+
/**
|
|
921
|
+
* Returns the layer with the given internal ID.
|
|
922
|
+
*/
|
|
923
|
+
getLayer(id: number): Layer | undefined;
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Returns an array of all the layers added to the group.
|
|
927
|
+
*/
|
|
928
|
+
getLayers(): Layer[];
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* Calls setZIndex on every layer contained in this group, passing the z-index.
|
|
932
|
+
*/
|
|
933
|
+
setZIndex(zIndex: number): this;
|
|
934
|
+
|
|
935
|
+
/**
|
|
936
|
+
* Returns the internal ID for a layer
|
|
937
|
+
*/
|
|
938
|
+
getLayerId(layer: Layer): number;
|
|
939
|
+
|
|
940
|
+
feature?:
|
|
941
|
+
| import('geojson').FeatureCollection<import('geojson').GeometryObject, P>
|
|
942
|
+
| import('geojson').Feature<import('geojson').MultiPoint, P>
|
|
943
|
+
| import('geojson').GeometryCollection;
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
/**
|
|
947
|
+
* Create a layer group, optionally given an initial set of layers and an `options` object.
|
|
948
|
+
*/
|
|
949
|
+
export function layerGroup(layers?: Layer[], options?: LayerOptions): LayerGroup;
|
|
950
|
+
|
|
951
|
+
/**
|
|
952
|
+
* Extended LayerGroup that also has mouse events (propagated from
|
|
953
|
+
* members of the group) and a shared bindPopup method.
|
|
954
|
+
*/
|
|
955
|
+
export class FeatureGroup<P = any> extends LayerGroup<P> {
|
|
956
|
+
/**
|
|
957
|
+
* Sets the given path options to each layer of the group that has a setStyle method.
|
|
958
|
+
*/
|
|
959
|
+
setStyle(style: PathOptions): this;
|
|
960
|
+
|
|
961
|
+
/**
|
|
962
|
+
* Brings the layer group to the top of all other layers
|
|
963
|
+
*/
|
|
964
|
+
bringToFront(): this;
|
|
965
|
+
|
|
966
|
+
/**
|
|
967
|
+
* Brings the layer group to the top [sic] of all other layers
|
|
968
|
+
*/
|
|
969
|
+
bringToBack(): this;
|
|
970
|
+
|
|
971
|
+
/**
|
|
972
|
+
* Returns the LatLngBounds of the Feature Group (created from
|
|
973
|
+
* bounds and coordinates of its children).
|
|
974
|
+
*/
|
|
975
|
+
getBounds(): LatLngBounds;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
/**
|
|
979
|
+
* Create a feature group, optionally given an initial set of layers.
|
|
980
|
+
*/
|
|
981
|
+
export function featureGroup(layers?: Layer[]): FeatureGroup;
|
|
982
|
+
|
|
983
|
+
export type StyleFunction<P = any> = (
|
|
984
|
+
feature?: import('geojson').Feature<import('geojson').GeometryObject, P>,
|
|
985
|
+
) => PathOptions;
|
|
986
|
+
|
|
987
|
+
export interface GeoJSONOptions<P = any> extends LayerOptions {
|
|
988
|
+
/**
|
|
989
|
+
* A Function defining how GeoJSON points spawn Leaflet layers.
|
|
990
|
+
* It is internally called when data is added, passing the GeoJSON point
|
|
991
|
+
* feature and its LatLng.
|
|
992
|
+
*
|
|
993
|
+
* The default is to spawn a default Marker:
|
|
994
|
+
*
|
|
995
|
+
* ```
|
|
996
|
+
* function(geoJsonPoint, latlng) {
|
|
997
|
+
* return L.marker(latlng);
|
|
998
|
+
* }
|
|
999
|
+
* ```
|
|
1000
|
+
*/
|
|
1001
|
+
pointToLayer?(
|
|
1002
|
+
geoJsonPoint: import('geojson').Feature<import('geojson').Point, P>,
|
|
1003
|
+
latlng: LatLng,
|
|
1004
|
+
): Layer; // should import GeoJSON typings
|
|
1005
|
+
|
|
1006
|
+
/**
|
|
1007
|
+
* PathOptions or a Function defining the Path options for styling GeoJSON lines and polygons,
|
|
1008
|
+
* called internally when data is added.
|
|
1009
|
+
*
|
|
1010
|
+
* The default value is to not override any defaults:
|
|
1011
|
+
*
|
|
1012
|
+
* ```
|
|
1013
|
+
* function (geoJsonFeature) {
|
|
1014
|
+
* return {}
|
|
1015
|
+
* }
|
|
1016
|
+
* ```
|
|
1017
|
+
*/
|
|
1018
|
+
style?: PathOptions | StyleFunction<P>;
|
|
1019
|
+
|
|
1020
|
+
/**
|
|
1021
|
+
* A Function that will be called once for each created Feature, after it
|
|
1022
|
+
* has been created and styled. Useful for attaching events and popups to features.
|
|
1023
|
+
*
|
|
1024
|
+
* The default is to do nothing with the newly created layers:
|
|
1025
|
+
*
|
|
1026
|
+
* ```
|
|
1027
|
+
* function (feature, layer) {}
|
|
1028
|
+
* ```
|
|
1029
|
+
*/
|
|
1030
|
+
onEachFeature?(
|
|
1031
|
+
feature: import('geojson').Feature<import('geojson').GeometryObject, P>,
|
|
1032
|
+
layer: Layer,
|
|
1033
|
+
): void;
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* A Function that will be used to decide whether to show a feature or not.
|
|
1037
|
+
*
|
|
1038
|
+
* The default is to show all features:
|
|
1039
|
+
*
|
|
1040
|
+
* ```
|
|
1041
|
+
* function (geoJsonFeature) {
|
|
1042
|
+
* return true;
|
|
1043
|
+
* }
|
|
1044
|
+
* ```
|
|
1045
|
+
*/
|
|
1046
|
+
filter?(
|
|
1047
|
+
geoJsonFeature: import('geojson').Feature<import('geojson').GeometryObject, P>,
|
|
1048
|
+
): boolean;
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* A Function that will be used for converting GeoJSON coordinates to LatLngs.
|
|
1052
|
+
* The default is the coordsToLatLng static method.
|
|
1053
|
+
*/
|
|
1054
|
+
coordsToLatLng?(coords: [number, number] | [number, number, number]): LatLng; // check if LatLng has an altitude property
|
|
1055
|
+
}
|
|
1056
|
+
|
|
1057
|
+
/**
|
|
1058
|
+
* Represents a GeoJSON object or an array of GeoJSON objects.
|
|
1059
|
+
* Allows you to parse GeoJSON data and display it on the map. Extends FeatureGroup.
|
|
1060
|
+
*/
|
|
1061
|
+
export class GeoJSON<P = any> extends FeatureGroup<P> {
|
|
1062
|
+
/**
|
|
1063
|
+
* Creates a Layer from a given GeoJSON feature. Can use a custom pointToLayer
|
|
1064
|
+
* and/or coordsToLatLng functions if provided as options.
|
|
1065
|
+
*/
|
|
1066
|
+
static geometryToLayer<P = any>(
|
|
1067
|
+
featureData: import('geojson').Feature<import('geojson').GeometryObject, P>,
|
|
1068
|
+
options?: GeoJSONOptions<P>,
|
|
1069
|
+
): Layer;
|
|
1070
|
+
|
|
1071
|
+
/**
|
|
1072
|
+
* Creates a LatLng object from an array of 2 numbers (longitude, latitude) or
|
|
1073
|
+
* 3 numbers (longitude, latitude, altitude) used in GeoJSON for points.
|
|
1074
|
+
*/
|
|
1075
|
+
static coordsToLatLng(coords: [number, number] | [number, number, number]): LatLng;
|
|
1076
|
+
|
|
1077
|
+
/**
|
|
1078
|
+
* Creates a multidimensional array of LatLngs from a GeoJSON coordinates array.
|
|
1079
|
+
* levelsDeep specifies the nesting level (0 is for an array of points, 1 for an array of
|
|
1080
|
+
* arrays of points, etc., 0 by default).
|
|
1081
|
+
* Can use a custom coordsToLatLng function.
|
|
1082
|
+
*/
|
|
1083
|
+
static coordsToLatLngs(
|
|
1084
|
+
coords: any[],
|
|
1085
|
+
levelsDeep?: number,
|
|
1086
|
+
coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng,
|
|
1087
|
+
): any[]; // Using any[] to avoid artificially limiting valid calls
|
|
1088
|
+
|
|
1089
|
+
/**
|
|
1090
|
+
* Reverse of coordsToLatLng
|
|
1091
|
+
*/
|
|
1092
|
+
static latLngToCoords(latlng: LatLng): [number, number] | [number, number, number];
|
|
1093
|
+
|
|
1094
|
+
/**
|
|
1095
|
+
* Reverse of coordsToLatLngs closed determines whether the first point should be
|
|
1096
|
+
* appended to the end of the array to close the feature, only used when levelsDeep is 0.
|
|
1097
|
+
* False by default.
|
|
1098
|
+
*/
|
|
1099
|
+
static latLngsToCoords(latlngs: any[], levelsDeep?: number, closed?: boolean): any[]; // Using any[] to avoid artificially limiting valid calls
|
|
1100
|
+
|
|
1101
|
+
/**
|
|
1102
|
+
* Normalize GeoJSON geometries/features into GeoJSON features.
|
|
1103
|
+
*/
|
|
1104
|
+
static asFeature<P = any>(
|
|
1105
|
+
geojson:
|
|
1106
|
+
| import('geojson').Feature<import('geojson').GeometryObject, P>
|
|
1107
|
+
| import('geojson').GeometryObject,
|
|
1108
|
+
): import('geojson').Feature<import('geojson').GeometryObject, P>;
|
|
1109
|
+
|
|
1110
|
+
constructor(geojson?: import('geojson').GeoJsonObject, options?: GeoJSONOptions<P>);
|
|
1111
|
+
/**
|
|
1112
|
+
* Adds a GeoJSON object to the layer.
|
|
1113
|
+
*/
|
|
1114
|
+
addData(data: import('geojson').GeoJsonObject): Layer;
|
|
1115
|
+
|
|
1116
|
+
/**
|
|
1117
|
+
* Resets the given vector layer's style to the original GeoJSON style,
|
|
1118
|
+
* useful for resetting style after hover events.
|
|
1119
|
+
*/
|
|
1120
|
+
resetStyle(layer: Layer): Layer;
|
|
1121
|
+
|
|
1122
|
+
/**
|
|
1123
|
+
* Same as FeatureGroup's setStyle method, but style-functions are also
|
|
1124
|
+
* allowed here to set the style according to the feature.
|
|
1125
|
+
*/
|
|
1126
|
+
setStyle(style: PathOptions | StyleFunction<P>): this;
|
|
1127
|
+
|
|
1128
|
+
options: GeoJSONOptions<P>;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
/**
|
|
1132
|
+
* Creates a GeoJSON layer.
|
|
1133
|
+
*
|
|
1134
|
+
* Optionally accepts an object in GeoJSON format to display on the
|
|
1135
|
+
* map (you can alternatively add it later with addData method) and
|
|
1136
|
+
* an options object.
|
|
1137
|
+
*/
|
|
1138
|
+
export function geoJSON<P = any>(
|
|
1139
|
+
geojson?: import('geojson').GeoJsonObject,
|
|
1140
|
+
options?: GeoJSONOptions<P>,
|
|
1141
|
+
): GeoJSON<P>;
|
|
1142
|
+
|
|
1143
|
+
export type Zoom = boolean | 'center';
|
|
1144
|
+
|
|
1145
|
+
export interface MapOptions {
|
|
1146
|
+
preferCanvas?: boolean;
|
|
1147
|
+
|
|
1148
|
+
// Control options
|
|
1149
|
+
attributionControl?: boolean;
|
|
1150
|
+
zoomControl?: boolean;
|
|
1151
|
+
|
|
1152
|
+
// Interaction options
|
|
1153
|
+
closePopupOnClick?: boolean;
|
|
1154
|
+
zoomSnap?: number;
|
|
1155
|
+
zoomDelta?: number;
|
|
1156
|
+
trackResize?: boolean;
|
|
1157
|
+
boxZoom?: boolean;
|
|
1158
|
+
doubleClickZoom?: Zoom;
|
|
1159
|
+
dragging?: boolean;
|
|
1160
|
+
|
|
1161
|
+
// Map state options
|
|
1162
|
+
crs?: CRS;
|
|
1163
|
+
center?: LatLngExpression;
|
|
1164
|
+
zoom?: number;
|
|
1165
|
+
minZoom?: number;
|
|
1166
|
+
maxZoom?: number;
|
|
1167
|
+
layers?: Layer[];
|
|
1168
|
+
maxBounds?: LatLngBoundsExpression;
|
|
1169
|
+
renderer?: Renderer;
|
|
1170
|
+
|
|
1171
|
+
// Animation options
|
|
1172
|
+
fadeAnimation?: boolean;
|
|
1173
|
+
markerZoomAnimation?: boolean;
|
|
1174
|
+
transform3DLimit?: number;
|
|
1175
|
+
zoomAnimation?: boolean;
|
|
1176
|
+
zoomAnimationThreshold?: number;
|
|
1177
|
+
|
|
1178
|
+
// Panning inertia options
|
|
1179
|
+
inertia?: boolean;
|
|
1180
|
+
inertiaDeceleration?: number;
|
|
1181
|
+
inertiaMaxSpeed?: number;
|
|
1182
|
+
easeLinearity?: number;
|
|
1183
|
+
worldCopyJump?: boolean;
|
|
1184
|
+
maxBoundsViscosity?: number;
|
|
1185
|
+
|
|
1186
|
+
// Keyboard navigation options
|
|
1187
|
+
keyboard?: boolean;
|
|
1188
|
+
keyboardPanDelta?: number;
|
|
1189
|
+
|
|
1190
|
+
// Mousewheel options
|
|
1191
|
+
scrollWheelZoom?: Zoom;
|
|
1192
|
+
wheelDebounceTime?: number;
|
|
1193
|
+
wheelPxPerZoomLevel?: number;
|
|
1194
|
+
|
|
1195
|
+
// Touch interaction options
|
|
1196
|
+
tap?: boolean;
|
|
1197
|
+
tapTolerance?: number;
|
|
1198
|
+
touchZoom?: Zoom;
|
|
1199
|
+
bounceAtZoomLimits?: boolean;
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
export type ControlPosition = 'topleft' | 'topright' | 'bottomleft' | 'bottomright';
|
|
1203
|
+
|
|
1204
|
+
export interface ControlOptions {
|
|
1205
|
+
position?: ControlPosition;
|
|
1206
|
+
}
|
|
1207
|
+
|
|
1208
|
+
export class Control extends Class {
|
|
1209
|
+
// @ts-expect-error Leaflet typings
|
|
1210
|
+
static extend<T extends Control>(prop: InheritedOptionally<T, keyof Control>): typeof T;
|
|
1211
|
+
constructor(options?: ControlOptions);
|
|
1212
|
+
getPosition(): ControlPosition;
|
|
1213
|
+
setPosition(position: ControlPosition): this;
|
|
1214
|
+
getContainer(): HTMLElement | undefined;
|
|
1215
|
+
addTo(map: Map): this;
|
|
1216
|
+
remove(): this;
|
|
1217
|
+
|
|
1218
|
+
// Extension methods
|
|
1219
|
+
onAdd?(map: Map): HTMLElement;
|
|
1220
|
+
onRemove?(map: Map): void;
|
|
1221
|
+
|
|
1222
|
+
options: ControlOptions;
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
export namespace Control {
|
|
1226
|
+
interface ZoomOptions extends ControlOptions {
|
|
1227
|
+
zoomInText?: string;
|
|
1228
|
+
zoomInTitle?: string;
|
|
1229
|
+
zoomOutText?: string;
|
|
1230
|
+
zoomOutTitle?: string;
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
class Zoom extends Control {
|
|
1234
|
+
constructor(options?: ZoomOptions);
|
|
1235
|
+
options: ZoomOptions;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
interface AttributionOptions extends ControlOptions {
|
|
1239
|
+
prefix?: string | boolean;
|
|
1240
|
+
}
|
|
1241
|
+
|
|
1242
|
+
class Attribution extends Control {
|
|
1243
|
+
constructor(options?: AttributionOptions);
|
|
1244
|
+
setPrefix(prefix: string): this;
|
|
1245
|
+
addAttribution(text: string): this;
|
|
1246
|
+
removeAttribution(text: string): this;
|
|
1247
|
+
options: AttributionOptions;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
interface LayersOptions extends ControlOptions {
|
|
1251
|
+
collapsed?: boolean;
|
|
1252
|
+
autoZIndex?: boolean;
|
|
1253
|
+
hideSingleBase?: boolean;
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
interface LayersObject {
|
|
1257
|
+
[name: string]: Layer;
|
|
1258
|
+
}
|
|
1259
|
+
|
|
1260
|
+
class Layers extends Control {
|
|
1261
|
+
constructor(
|
|
1262
|
+
baseLayers?: LayersObject,
|
|
1263
|
+
overlays?: LayersObject,
|
|
1264
|
+
options?: LayersOptions,
|
|
1265
|
+
);
|
|
1266
|
+
addBaseLayer(layer: Layer, name: string): this;
|
|
1267
|
+
addOverlay(layer: Layer, name: string): this;
|
|
1268
|
+
removeLayer(layer: Layer): this;
|
|
1269
|
+
expand(): this;
|
|
1270
|
+
collapse(): this;
|
|
1271
|
+
options: LayersOptions;
|
|
1272
|
+
}
|
|
1273
|
+
|
|
1274
|
+
interface ScaleOptions extends ControlOptions {
|
|
1275
|
+
maxWidth?: number;
|
|
1276
|
+
metric?: boolean;
|
|
1277
|
+
imperial?: boolean;
|
|
1278
|
+
updateWhenIdle?: boolean;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
class Scale extends Control {
|
|
1282
|
+
constructor(options?: ScaleOptions);
|
|
1283
|
+
options: ScaleOptions;
|
|
1284
|
+
_iScale: boolean;
|
|
1285
|
+
_getRoundNum(this: this, maxFeet: number): number;
|
|
1286
|
+
_updateScales(this: this, maxMeters: number): void;
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
|
|
1290
|
+
export namespace control {
|
|
1291
|
+
function zoom(options?: Control.ZoomOptions): Control.Zoom;
|
|
1292
|
+
|
|
1293
|
+
function attribution(options?: Control.AttributionOptions): Control.Attribution;
|
|
1294
|
+
|
|
1295
|
+
function layers(
|
|
1296
|
+
baseLayers?: Control.LayersObject,
|
|
1297
|
+
overlays?: Control.LayersObject,
|
|
1298
|
+
options?: Control.LayersOptions,
|
|
1299
|
+
): Control.Layers;
|
|
1300
|
+
|
|
1301
|
+
function scale(options?: Control.ScaleOptions): Control.Scale;
|
|
1302
|
+
}
|
|
1303
|
+
|
|
1304
|
+
export interface DivOverlayOptions {
|
|
1305
|
+
offset?: PointExpression;
|
|
1306
|
+
zoomAnimation?: boolean;
|
|
1307
|
+
className?: string;
|
|
1308
|
+
pane?: string;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
export interface PopupOptions extends DivOverlayOptions {
|
|
1312
|
+
maxWidth?: number;
|
|
1313
|
+
minWidth?: number;
|
|
1314
|
+
maxHeight?: number;
|
|
1315
|
+
keepInView?: boolean;
|
|
1316
|
+
closeButton?: boolean;
|
|
1317
|
+
autoPan?: boolean;
|
|
1318
|
+
autoPanPaddingTopLeft?: PointExpression;
|
|
1319
|
+
autoPanPaddingBottomRight?: PointExpression;
|
|
1320
|
+
autoPanPadding?: PointExpression;
|
|
1321
|
+
autoClose?: boolean;
|
|
1322
|
+
closeOnClick?: boolean;
|
|
1323
|
+
closeOnEscapeKey?: boolean;
|
|
1324
|
+
}
|
|
1325
|
+
|
|
1326
|
+
export type Content = string | HTMLElement;
|
|
1327
|
+
|
|
1328
|
+
export class Popup extends Layer {
|
|
1329
|
+
constructor(options?: PopupOptions, source?: Layer);
|
|
1330
|
+
getLatLng(): LatLng | undefined;
|
|
1331
|
+
setLatLng(latlng: LatLngExpression): this;
|
|
1332
|
+
getContent(): Content | ((source: Layer) => Content) | undefined;
|
|
1333
|
+
setContent(htmlContent: ((source: Layer) => Content) | Content): this;
|
|
1334
|
+
getElement(): HTMLElement | undefined;
|
|
1335
|
+
update(): void;
|
|
1336
|
+
isOpen(): boolean;
|
|
1337
|
+
bringToFront(): this;
|
|
1338
|
+
bringToBack(): this;
|
|
1339
|
+
openOn(map: Map): this;
|
|
1340
|
+
|
|
1341
|
+
options: PopupOptions;
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
export function popup(options?: PopupOptions, source?: Layer): Popup;
|
|
1345
|
+
|
|
1346
|
+
export type Direction = 'right' | 'left' | 'top' | 'bottom' | 'center' | 'auto';
|
|
1347
|
+
|
|
1348
|
+
export interface TooltipOptions extends DivOverlayOptions {
|
|
1349
|
+
pane?: string;
|
|
1350
|
+
offset?: PointExpression;
|
|
1351
|
+
direction?: Direction;
|
|
1352
|
+
permanent?: boolean;
|
|
1353
|
+
sticky?: boolean;
|
|
1354
|
+
interactive?: boolean;
|
|
1355
|
+
opacity?: number;
|
|
1356
|
+
}
|
|
1357
|
+
|
|
1358
|
+
export class Tooltip extends Layer {
|
|
1359
|
+
constructor(options?: TooltipOptions, source?: Layer);
|
|
1360
|
+
setOpacity(val: number): void;
|
|
1361
|
+
getLatLng(): LatLng | undefined;
|
|
1362
|
+
setLatLng(latlng: LatLngExpression): this;
|
|
1363
|
+
getContent(): Content | undefined;
|
|
1364
|
+
setContent(htmlContent: ((source: Layer) => Content) | Content): this;
|
|
1365
|
+
getElement(): HTMLElement | undefined;
|
|
1366
|
+
update(): void;
|
|
1367
|
+
isOpen(): boolean;
|
|
1368
|
+
bringToFront(): this;
|
|
1369
|
+
bringToBack(): this;
|
|
1370
|
+
|
|
1371
|
+
options: TooltipOptions;
|
|
1372
|
+
}
|
|
1373
|
+
|
|
1374
|
+
export function tooltip(options?: TooltipOptions, source?: Layer): Tooltip;
|
|
1375
|
+
|
|
1376
|
+
export interface ZoomOptions {
|
|
1377
|
+
animate?: boolean;
|
|
1378
|
+
}
|
|
1379
|
+
|
|
1380
|
+
export interface PanOptions {
|
|
1381
|
+
animate?: boolean;
|
|
1382
|
+
duration?: number;
|
|
1383
|
+
easeLinearity?: number;
|
|
1384
|
+
noMoveStart?: boolean;
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
// This is not empty, it extends two interfaces into one...
|
|
1388
|
+
export interface ZoomPanOptions extends ZoomOptions, PanOptions {}
|
|
1389
|
+
|
|
1390
|
+
export interface FitBoundsOptions extends ZoomOptions, PanOptions {
|
|
1391
|
+
paddingTopLeft?: PointExpression;
|
|
1392
|
+
paddingBottomRight?: PointExpression;
|
|
1393
|
+
padding?: PointExpression;
|
|
1394
|
+
maxZoom?: number;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
export interface PanInsideOptions {
|
|
1398
|
+
paddingTopLeft?: PointExpression;
|
|
1399
|
+
paddingBottomRight?: PointExpression;
|
|
1400
|
+
padding?: PointExpression;
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
export interface LocateOptions {
|
|
1404
|
+
watch?: boolean;
|
|
1405
|
+
setView?: boolean;
|
|
1406
|
+
maxZoom?: number;
|
|
1407
|
+
timeout?: number;
|
|
1408
|
+
maximumAge?: number;
|
|
1409
|
+
enableHighAccuracy?: boolean;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
export class Handler extends Class {
|
|
1413
|
+
constructor(map: Map);
|
|
1414
|
+
enable(): this;
|
|
1415
|
+
disable(): this;
|
|
1416
|
+
enabled(): boolean;
|
|
1417
|
+
|
|
1418
|
+
// Extension methods
|
|
1419
|
+
addHooks?(): void;
|
|
1420
|
+
removeHooks?(): void;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
export interface LeafletEvent {
|
|
1424
|
+
type: string;
|
|
1425
|
+
target: any;
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
export interface LeafletMouseEvent extends LeafletEvent {
|
|
1429
|
+
latlng: LatLng;
|
|
1430
|
+
layerPoint: Point;
|
|
1431
|
+
containerPoint: Point;
|
|
1432
|
+
originalEvent: MouseEvent & {
|
|
1433
|
+
target?: HTMLElement;
|
|
1434
|
+
};
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
export interface LeafletKeyboardEvent extends LeafletEvent {
|
|
1438
|
+
originalEvent: KeyboardEvent;
|
|
1439
|
+
}
|
|
1440
|
+
|
|
1441
|
+
export interface LocationEvent extends LeafletEvent {
|
|
1442
|
+
latlng: LatLng;
|
|
1443
|
+
bounds: LatLngBounds;
|
|
1444
|
+
accuracy: number;
|
|
1445
|
+
altitude: number;
|
|
1446
|
+
altitudeAccuracy: number;
|
|
1447
|
+
heading: number;
|
|
1448
|
+
speed: number;
|
|
1449
|
+
timestamp: number;
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
export interface ErrorEvent extends LeafletEvent {
|
|
1453
|
+
message: string;
|
|
1454
|
+
code: number;
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
export interface LayerEvent extends LeafletEvent {
|
|
1458
|
+
layer: Layer;
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
export interface LayersControlEvent extends LayerEvent {
|
|
1462
|
+
name: string;
|
|
1463
|
+
}
|
|
1464
|
+
|
|
1465
|
+
export interface TileEvent extends LeafletEvent {
|
|
1466
|
+
tile: HTMLImageElement;
|
|
1467
|
+
coords: Point; // apparently not a normal point, since docs say it has z (zoom)
|
|
1468
|
+
}
|
|
1469
|
+
|
|
1470
|
+
export interface TileErrorEvent extends TileEvent {
|
|
1471
|
+
error: Error;
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
export interface ResizeEvent extends LeafletEvent {
|
|
1475
|
+
oldSize: Point;
|
|
1476
|
+
newSize: Point;
|
|
1477
|
+
}
|
|
1478
|
+
|
|
1479
|
+
export interface GeoJSONEvent extends LeafletEvent {
|
|
1480
|
+
layer: Layer;
|
|
1481
|
+
properties: any;
|
|
1482
|
+
geometryType: string;
|
|
1483
|
+
id: string;
|
|
1484
|
+
}
|
|
1485
|
+
|
|
1486
|
+
export interface PopupEvent extends LeafletEvent {
|
|
1487
|
+
popup: Popup;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export interface TooltipEvent extends LeafletEvent {
|
|
1491
|
+
tooltip: Tooltip;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
export interface DragEndEvent extends LeafletEvent {
|
|
1495
|
+
distance: number;
|
|
1496
|
+
}
|
|
1497
|
+
|
|
1498
|
+
export interface ZoomAnimEvent extends LeafletEvent {
|
|
1499
|
+
center: LatLng;
|
|
1500
|
+
zoom: number;
|
|
1501
|
+
noUpdate: boolean;
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1504
|
+
export namespace DomEvent {
|
|
1505
|
+
type EventHandlerFn = (event: Event) => void;
|
|
1506
|
+
|
|
1507
|
+
function on(
|
|
1508
|
+
el: HTMLElement,
|
|
1509
|
+
types: string,
|
|
1510
|
+
fn: EventHandlerFn,
|
|
1511
|
+
context?: any,
|
|
1512
|
+
): typeof DomEvent;
|
|
1513
|
+
|
|
1514
|
+
function on(
|
|
1515
|
+
el: HTMLElement,
|
|
1516
|
+
eventMap: { [eventName: string]: EventHandlerFn },
|
|
1517
|
+
context?: any,
|
|
1518
|
+
): typeof DomEvent;
|
|
1519
|
+
|
|
1520
|
+
function off(
|
|
1521
|
+
el: HTMLElement,
|
|
1522
|
+
types: string,
|
|
1523
|
+
fn: EventHandlerFn,
|
|
1524
|
+
context?: any,
|
|
1525
|
+
): typeof DomEvent;
|
|
1526
|
+
|
|
1527
|
+
function off(
|
|
1528
|
+
el: HTMLElement,
|
|
1529
|
+
eventMap: { [eventName: string]: EventHandlerFn },
|
|
1530
|
+
context?: any,
|
|
1531
|
+
): typeof DomEvent;
|
|
1532
|
+
|
|
1533
|
+
function stopPropagation(ev: Event): typeof DomEvent;
|
|
1534
|
+
|
|
1535
|
+
function disableScrollPropagation(el: HTMLElement): typeof DomEvent;
|
|
1536
|
+
|
|
1537
|
+
function disableClickPropagation(el: HTMLElement): typeof DomEvent;
|
|
1538
|
+
|
|
1539
|
+
function preventDefault(ev: Event): typeof DomEvent;
|
|
1540
|
+
|
|
1541
|
+
function stop(ev: Event): typeof DomEvent;
|
|
1542
|
+
|
|
1543
|
+
function getMousePosition(ev: MouseEvent, container?: HTMLElement): Point;
|
|
1544
|
+
|
|
1545
|
+
function getWheelDelta(ev: Event): number;
|
|
1546
|
+
|
|
1547
|
+
function addListener(
|
|
1548
|
+
el: HTMLElement,
|
|
1549
|
+
types: string,
|
|
1550
|
+
fn: EventHandlerFn,
|
|
1551
|
+
context?: any,
|
|
1552
|
+
): typeof DomEvent;
|
|
1553
|
+
|
|
1554
|
+
function addListener(
|
|
1555
|
+
el: HTMLElement,
|
|
1556
|
+
eventMap: { [eventName: string]: EventHandlerFn },
|
|
1557
|
+
context?: any,
|
|
1558
|
+
): typeof DomEvent;
|
|
1559
|
+
|
|
1560
|
+
function removeListener(
|
|
1561
|
+
el: HTMLElement,
|
|
1562
|
+
types: string,
|
|
1563
|
+
fn: EventHandlerFn,
|
|
1564
|
+
context?: any,
|
|
1565
|
+
): typeof DomEvent;
|
|
1566
|
+
|
|
1567
|
+
function removeListener(
|
|
1568
|
+
el: HTMLElement,
|
|
1569
|
+
eventMap: { [eventName: string]: EventHandlerFn },
|
|
1570
|
+
context?: any,
|
|
1571
|
+
): typeof DomEvent;
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
export interface DefaultMapPanes {
|
|
1575
|
+
mapPane: HTMLElement;
|
|
1576
|
+
tilePane: HTMLElement;
|
|
1577
|
+
overlayPane: HTMLElement;
|
|
1578
|
+
shadowPane: HTMLElement;
|
|
1579
|
+
markerPane: HTMLElement;
|
|
1580
|
+
tooltipPane: HTMLElement;
|
|
1581
|
+
popupPane: HTMLElement;
|
|
1582
|
+
}
|
|
1583
|
+
|
|
1584
|
+
export class Map extends Evented {
|
|
1585
|
+
constructor(element: string | HTMLElement, options?: MapOptions);
|
|
1586
|
+
getRenderer(layer: Path): Renderer;
|
|
1587
|
+
|
|
1588
|
+
// Methods for layers and controls
|
|
1589
|
+
addControl(control: Control): this;
|
|
1590
|
+
removeControl(control: Control): this;
|
|
1591
|
+
addLayer(layer: Layer | GridLayer): this;
|
|
1592
|
+
removeLayer(layer: Layer | GridLayer): this;
|
|
1593
|
+
hasLayer(layer: Layer | GridLayer): boolean;
|
|
1594
|
+
eachLayer(fn: (layer: Layer | GridLayer) => void, context?: any): this;
|
|
1595
|
+
openPopup(popup: Popup): this;
|
|
1596
|
+
openPopup(content: Content, latlng: LatLngExpression, options?: PopupOptions): this;
|
|
1597
|
+
closePopup(popup?: Popup): this;
|
|
1598
|
+
openTooltip(tooltip: Tooltip): this;
|
|
1599
|
+
openTooltip(content: Content, latlng: LatLngExpression, options?: TooltipOptions): this;
|
|
1600
|
+
closeTooltip(tooltip?: Tooltip): this;
|
|
1601
|
+
|
|
1602
|
+
// Methods for modifying map state
|
|
1603
|
+
setView(center: LatLngExpression, zoom: number, options?: ZoomPanOptions): this;
|
|
1604
|
+
setZoom(zoom: number, options?: ZoomPanOptions): this;
|
|
1605
|
+
zoomIn(delta?: number, options?: ZoomOptions): this;
|
|
1606
|
+
zoomOut(delta?: number, options?: ZoomOptions): this;
|
|
1607
|
+
setZoomAround(
|
|
1608
|
+
position: Point | LatLngExpression,
|
|
1609
|
+
zoom: number,
|
|
1610
|
+
options?: ZoomOptions,
|
|
1611
|
+
): this;
|
|
1612
|
+
fitBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this;
|
|
1613
|
+
fitWorld(options?: FitBoundsOptions): this;
|
|
1614
|
+
panTo(latlng: LatLngExpression, options?: PanOptions): this;
|
|
1615
|
+
panBy(offset: PointExpression, options?: PanOptions): this;
|
|
1616
|
+
setMaxBounds(bounds: LatLngBoundsExpression): this;
|
|
1617
|
+
setMinZoom(zoom: number): this;
|
|
1618
|
+
setMaxZoom(zoom: number): this;
|
|
1619
|
+
panInside(latLng: LatLngExpression, options?: PanInsideOptions): this;
|
|
1620
|
+
panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): this;
|
|
1621
|
+
/**
|
|
1622
|
+
* Boolean for animate or advanced ZoomPanOptions
|
|
1623
|
+
*/
|
|
1624
|
+
invalidateSize(options?: boolean | ZoomPanOptions): this;
|
|
1625
|
+
stop(): this;
|
|
1626
|
+
flyTo(latlng: LatLngExpression, zoom?: number, options?: ZoomPanOptions): this;
|
|
1627
|
+
flyToBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this;
|
|
1628
|
+
|
|
1629
|
+
// Other methods
|
|
1630
|
+
addHandler(name: string, HandlerClass: typeof Handler): this; // Alternatively, HandlerClass: new(map: Map) => Handler
|
|
1631
|
+
remove(): this;
|
|
1632
|
+
createPane(name: string, container?: HTMLElement): HTMLElement;
|
|
1633
|
+
/**
|
|
1634
|
+
* Name of the pane or the pane as HTML-Element
|
|
1635
|
+
*/
|
|
1636
|
+
getPane(pane: string | HTMLElement): HTMLElement | undefined;
|
|
1637
|
+
getPanes(): { [name: string]: HTMLElement } & DefaultMapPanes;
|
|
1638
|
+
getContainer(): HTMLElement;
|
|
1639
|
+
whenReady(fn: () => void, context?: any): this;
|
|
1640
|
+
|
|
1641
|
+
// Methods for getting map state
|
|
1642
|
+
getCenter(): LatLng;
|
|
1643
|
+
getZoom(): number;
|
|
1644
|
+
getBounds(): LatLngBounds;
|
|
1645
|
+
getMinZoom(): number;
|
|
1646
|
+
getMaxZoom(): number;
|
|
1647
|
+
getBoundsZoom(bounds: LatLngBoundsExpression, inside?: boolean): number;
|
|
1648
|
+
getSize(): Point;
|
|
1649
|
+
getPixelBounds(): Bounds;
|
|
1650
|
+
getPixelOrigin(): Point;
|
|
1651
|
+
getPixelWorldBounds(zoom?: number): Bounds;
|
|
1652
|
+
|
|
1653
|
+
// Conversion methods
|
|
1654
|
+
getZoomScale(toZoom: number, fromZoom?: number): number;
|
|
1655
|
+
getScaleZoom(scale: number, fromZoom: number): number;
|
|
1656
|
+
project(latlng: LatLngExpression, zoom: number): Point;
|
|
1657
|
+
unproject(point: PointExpression, zoom: number): LatLng;
|
|
1658
|
+
layerPointToLatLng(point: PointExpression): LatLng;
|
|
1659
|
+
latLngToLayerPoint(latlng: LatLngExpression): Point;
|
|
1660
|
+
wrapLatLng(latlng: LatLngExpression): LatLng;
|
|
1661
|
+
wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds;
|
|
1662
|
+
distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number;
|
|
1663
|
+
containerPointToLayerPoint(point: PointExpression): Point;
|
|
1664
|
+
containerPointToLatLng(point: PointExpression): LatLng;
|
|
1665
|
+
layerPointToContainerPoint(point: PointExpression): Point;
|
|
1666
|
+
latLngToContainerPoint(latlng: LatLngExpression): Point;
|
|
1667
|
+
mouseEventToContainerPoint(ev: MouseEvent): Point;
|
|
1668
|
+
mouseEventToLayerPoint(ev: MouseEvent): Point;
|
|
1669
|
+
mouseEventToLatLng(ev: MouseEvent): LatLng;
|
|
1670
|
+
|
|
1671
|
+
// Geolocation methods
|
|
1672
|
+
locate(options?: LocateOptions): this;
|
|
1673
|
+
stopLocate(): this;
|
|
1674
|
+
|
|
1675
|
+
// Properties
|
|
1676
|
+
boxZoom: Handler;
|
|
1677
|
+
doubleClickZoom: Handler;
|
|
1678
|
+
dragging: Handler;
|
|
1679
|
+
keyboard: Handler;
|
|
1680
|
+
scrollWheelZoom: Handler;
|
|
1681
|
+
tap?: Handler;
|
|
1682
|
+
touchZoom: Handler;
|
|
1683
|
+
zoomControl: Control.Zoom;
|
|
1684
|
+
|
|
1685
|
+
options: MapOptions;
|
|
1686
|
+
_zoomCenter?: Point;
|
|
1687
|
+
_latLngBoundsToNewLayerBounds(
|
|
1688
|
+
latLngBounds: LatLngBounds,
|
|
1689
|
+
zoom: number,
|
|
1690
|
+
center: LatLng,
|
|
1691
|
+
): Bounds;
|
|
1692
|
+
// function (latLngBounds, zoom, center) {
|
|
1693
|
+
// var topLeft = this._getNewPixelOrigin(center, zoom);
|
|
1694
|
+
// return toBounds([
|
|
1695
|
+
// this.project(latLngBounds.getSouthWest(), zoom)._subtract(topLeft),
|
|
1696
|
+
// this.project(latLngBounds.getNorthWest(), zoom)._subtract(topLeft),
|
|
1697
|
+
// this.project(latLngBounds.getSouthEast(), zoom)._subtract(topLeft),
|
|
1698
|
+
// this.project(latLngBounds.getNorthEast(), zoom)._subtract(topLeft)
|
|
1699
|
+
// ]);
|
|
1700
|
+
// }
|
|
1701
|
+
|
|
1702
|
+
_removeZoomLimit(instance: unknown): void;
|
|
1703
|
+
|
|
1704
|
+
_getTopLeftPoint(): L.Point;
|
|
1705
|
+
|
|
1706
|
+
_getMapPanePos(): L.Point;
|
|
1707
|
+
}
|
|
1708
|
+
|
|
1709
|
+
/**
|
|
1710
|
+
* ID of a HTML-Element as string or the HTML-ELement itself
|
|
1711
|
+
*/
|
|
1712
|
+
export function map(element: string | HTMLElement, options?: MapOptions): Map;
|
|
1713
|
+
|
|
1714
|
+
export interface BaseIconOptions extends LayerOptions {
|
|
1715
|
+
iconUrl?: string;
|
|
1716
|
+
iconRetinaUrl?: string;
|
|
1717
|
+
iconSize?: PointExpression;
|
|
1718
|
+
iconAnchor?: PointExpression;
|
|
1719
|
+
popupAnchor?: PointExpression;
|
|
1720
|
+
tooltipAnchor?: PointExpression;
|
|
1721
|
+
shadowUrl?: string | null;
|
|
1722
|
+
shadowRetinaUrl?: string;
|
|
1723
|
+
shadowSize?: PointExpression;
|
|
1724
|
+
shadowAnchor?: PointExpression;
|
|
1725
|
+
className?: string;
|
|
1726
|
+
}
|
|
1727
|
+
|
|
1728
|
+
export interface IconOptions extends BaseIconOptions {
|
|
1729
|
+
iconUrl?: string;
|
|
1730
|
+
anchorRef?: { x?: number; y?: number };
|
|
1731
|
+
anchorType?: { x?: 'pixels' | 'fraction'; y?: 'pixels' | 'fraction' };
|
|
1732
|
+
}
|
|
1733
|
+
|
|
1734
|
+
export class Icon<T extends BaseIconOptions = IconOptions> extends Layer {
|
|
1735
|
+
constructor(options: T);
|
|
1736
|
+
createIcon(oldIcon?: HTMLElement): HTMLElement;
|
|
1737
|
+
createShadow(oldIcon?: HTMLElement): HTMLElement;
|
|
1738
|
+
_setIconStyles(img: HTMLImageElement, name: string): void;
|
|
1739
|
+
|
|
1740
|
+
options: T;
|
|
1741
|
+
}
|
|
1742
|
+
|
|
1743
|
+
export namespace Icon {
|
|
1744
|
+
interface DefaultIconOptions extends BaseIconOptions {
|
|
1745
|
+
imagePath?: string;
|
|
1746
|
+
}
|
|
1747
|
+
|
|
1748
|
+
class Default extends Icon<DefaultIconOptions> {
|
|
1749
|
+
static imagePath?: string;
|
|
1750
|
+
constructor(options?: DefaultIconOptions);
|
|
1751
|
+
}
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
export function icon(options: IconOptions): Icon;
|
|
1755
|
+
|
|
1756
|
+
export interface DivIconOptions extends BaseIconOptions {
|
|
1757
|
+
html?: string | HTMLElement | false;
|
|
1758
|
+
bgPos?: PointExpression;
|
|
1759
|
+
iconSize?: PointExpression;
|
|
1760
|
+
iconAnchor?: PointExpression;
|
|
1761
|
+
popupAnchor?: PointExpression;
|
|
1762
|
+
className?: string;
|
|
1763
|
+
}
|
|
1764
|
+
|
|
1765
|
+
export class DivIcon extends Icon<DivIconOptions> {
|
|
1766
|
+
constructor(options?: DivIconOptions);
|
|
1767
|
+
}
|
|
1768
|
+
|
|
1769
|
+
export function divIcon(options?: DivIconOptions): DivIcon;
|
|
1770
|
+
|
|
1771
|
+
export interface MarkerOptions extends InteractiveLayerOptions {
|
|
1772
|
+
icon?: Icon | DivIcon;
|
|
1773
|
+
clickable?: boolean;
|
|
1774
|
+
draggable?: boolean;
|
|
1775
|
+
keyboard?: boolean;
|
|
1776
|
+
title?: string;
|
|
1777
|
+
alt?: string;
|
|
1778
|
+
zIndexOffset?: number;
|
|
1779
|
+
opacity?: number;
|
|
1780
|
+
riseOnHover?: boolean;
|
|
1781
|
+
riseOffset?: number;
|
|
1782
|
+
autoPan?: boolean;
|
|
1783
|
+
autoPanSpeed?: number;
|
|
1784
|
+
autoPanPadding?: PointExpression;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
export class Marker<P = any> extends Layer {
|
|
1788
|
+
constructor(latlng: LatLngExpression, options?: MarkerOptions);
|
|
1789
|
+
toGeoJSON(): import('geojson').Feature<import('geojson').Point, P>;
|
|
1790
|
+
getLatLng(): LatLng;
|
|
1791
|
+
setLatLng(latlng: LatLngExpression): this;
|
|
1792
|
+
setZIndexOffset(offset: number): this;
|
|
1793
|
+
setIcon(icon: Icon | DivIcon): this;
|
|
1794
|
+
setOpacity(opacity: number): this;
|
|
1795
|
+
getElement(): HTMLElement | undefined;
|
|
1796
|
+
|
|
1797
|
+
// Properties
|
|
1798
|
+
options: MarkerOptions;
|
|
1799
|
+
dragging?: Handler;
|
|
1800
|
+
feature?: import('geojson').Feature<import('geojson').Point, P>;
|
|
1801
|
+
_icon: HTMLDivElement;
|
|
1802
|
+
_latlng: LatLng;
|
|
1803
|
+
}
|
|
1804
|
+
|
|
1805
|
+
export function marker(latlng: LatLngExpression, options?: MarkerOptions): Marker;
|
|
1806
|
+
|
|
1807
|
+
export namespace Browser {
|
|
1808
|
+
// sorting according to https://leafletjs.com/reference-1.5.0.html#browser
|
|
1809
|
+
const ie: boolean;
|
|
1810
|
+
const ielt9: boolean;
|
|
1811
|
+
const edge: boolean;
|
|
1812
|
+
const webkit: boolean;
|
|
1813
|
+
const android: boolean;
|
|
1814
|
+
const android23: boolean;
|
|
1815
|
+
const androidStock: boolean;
|
|
1816
|
+
const opera: boolean;
|
|
1817
|
+
const chrome: boolean;
|
|
1818
|
+
const gecko: boolean;
|
|
1819
|
+
const safari: boolean;
|
|
1820
|
+
const opera12: boolean;
|
|
1821
|
+
const win: boolean;
|
|
1822
|
+
const ie3d: boolean;
|
|
1823
|
+
const webkit3d: boolean;
|
|
1824
|
+
const gecko3d: boolean;
|
|
1825
|
+
const any3d: boolean;
|
|
1826
|
+
const mobile: boolean;
|
|
1827
|
+
const mobileWebkit: boolean;
|
|
1828
|
+
const mobileWebkit3d: boolean;
|
|
1829
|
+
const msPointer: boolean;
|
|
1830
|
+
const pointer: boolean;
|
|
1831
|
+
const touch: boolean;
|
|
1832
|
+
const mobileOpera: boolean;
|
|
1833
|
+
const mobileGecko: boolean;
|
|
1834
|
+
const retina: boolean;
|
|
1835
|
+
const canvas: boolean;
|
|
1836
|
+
const svg: boolean;
|
|
1837
|
+
const vml: boolean;
|
|
1838
|
+
}
|
|
1839
|
+
|
|
1840
|
+
export namespace Util {
|
|
1841
|
+
function extend<D extends object, S1 extends object = {}>(dest: D, src?: S1): D & S1;
|
|
1842
|
+
function extend<D extends object, S1 extends object, S2 extends object>(
|
|
1843
|
+
dest: D,
|
|
1844
|
+
src1: S1,
|
|
1845
|
+
src2: S2,
|
|
1846
|
+
): D & S1 & S2;
|
|
1847
|
+
function extend<D extends object, S1 extends object, S2 extends object, S3 extends object>(
|
|
1848
|
+
dest: D,
|
|
1849
|
+
src1: S1,
|
|
1850
|
+
src2: S2,
|
|
1851
|
+
src3: S3,
|
|
1852
|
+
): D & S1 & S2 & S3;
|
|
1853
|
+
function extend(dest: any, ...src: any[]): any;
|
|
1854
|
+
|
|
1855
|
+
function create(proto: object | null, properties?: PropertyDescriptorMap): any;
|
|
1856
|
+
function bind(fn: () => void, ...obj: any[]): () => void;
|
|
1857
|
+
function stamp(obj: any): number;
|
|
1858
|
+
function throttle(fn: () => void, time: number, context: any): () => void;
|
|
1859
|
+
function wrapNum(num: number, range: number[], includeMax?: boolean): number;
|
|
1860
|
+
function falseFn(): false;
|
|
1861
|
+
function formatNum(num: number, digits?: number): number;
|
|
1862
|
+
function trim(str: string): string;
|
|
1863
|
+
function splitWords(str: string): string[];
|
|
1864
|
+
function setOptions(obj: any, options: any): any;
|
|
1865
|
+
function getParamString(obj: any, existingUrl?: string, uppercase?: boolean): string;
|
|
1866
|
+
function template(str: string, data: any): string;
|
|
1867
|
+
function isArray(obj: any): boolean;
|
|
1868
|
+
function indexOf(array: any[], el: any): number;
|
|
1869
|
+
function requestAnimFrame(
|
|
1870
|
+
fn: (timestamp: number) => void,
|
|
1871
|
+
context?: any,
|
|
1872
|
+
immediate?: boolean,
|
|
1873
|
+
): number;
|
|
1874
|
+
function cancelAnimFrame(id: number): void;
|
|
1875
|
+
|
|
1876
|
+
let lastId: number;
|
|
1877
|
+
let emptyImageUrl: string;
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
export function setOptions(thisArgument: any, opts: any): unknown;
|
|
1881
|
+
|
|
1882
|
+
export class GPX extends (await import('@plugins/_shared/upload/leaflet-gpx.d')).GPX {}
|
|
1883
|
+
|
|
1884
|
+
export class KML extends (await import('@plugins/_shared/upload/leaflet-kml.d')).KML {}
|
|
1885
|
+
|
|
1886
|
+
export class KMLIcon extends (await import('@plugins/_shared/upload/leaflet-kml.d')).KMLIcon {}
|
|
1887
|
+
|
|
1888
|
+
export class KMLMarker extends (await import('@plugins/_shared/upload/leaflet-kml.d'))
|
|
1889
|
+
.KMLMarker {}
|
|
1890
|
+
export class RotatedImageOverlay extends (await import('@plugins/_shared/upload/leaflet-kml.d'))
|
|
1891
|
+
.RotatedImageOverlay {}
|
|
1892
|
+
|
|
1893
|
+
export class MultiPolygon extends Polygon {}
|
|
1894
|
+
|
|
1895
|
+
export type DistanceProp = {
|
|
1896
|
+
distance: number;
|
|
1897
|
+
finalBearing: number;
|
|
1898
|
+
initialBearing: number;
|
|
1899
|
+
};
|
|
1900
|
+
|
|
1901
|
+
export class Geodesic extends Polyline {
|
|
1902
|
+
constructor(
|
|
1903
|
+
latlngs: LatLngExpression[] | LatLngExpression[][],
|
|
1904
|
+
options?: PolylineOptions & { steps: number; wrap: boolean },
|
|
1905
|
+
);
|
|
1906
|
+
getLatLngs(): LatLng[][];
|
|
1907
|
+
_vincenty_inverse(p1: LatLng, p2: LatLng): DistanceProp;
|
|
1908
|
+
_rings: L.Point[][];
|
|
1909
|
+
_projectLatlngs(ll: LatLng[], point: L.Point[][], bnds: Bounds): void;
|
|
1910
|
+
_renderer: {
|
|
1911
|
+
_container: SVGSVGElement;
|
|
1912
|
+
};
|
|
1913
|
+
}
|
|
1914
|
+
|
|
1915
|
+
/** A constant that represents the Leaflet version in use. */
|
|
1916
|
+
export const version: string;
|
|
1917
|
+
}
|
|
1918
|
+
|
|
1919
|
+
/* eslint-enable */
|