1 | export as namespace L;
|
2 |
|
3 | import * as geojson from "geojson";
|
4 |
|
5 |
|
6 | export const version: string;
|
7 |
|
8 | export class Class {
|
9 | static extend(props: any): { new(...args: any[]): any } & typeof Class;
|
10 | static include(props: any): any & typeof Class;
|
11 | static mergeOptions(props: any): any & typeof Class;
|
12 |
|
13 | static addInitHook(initHookFn: () => void): any & typeof Class;
|
14 | static addInitHook(methodName: string, ...args: any[]): any & typeof Class;
|
15 |
|
16 | static callInitHooks(): void;
|
17 | }
|
18 |
|
19 | export class Transformation {
|
20 | constructor(a: number, b: number, c: number, d: number);
|
21 | transform(point: Point, scale?: number): Point;
|
22 | untransform(point: Point, scale?: number): Point;
|
23 | }
|
24 |
|
25 | /** Instantiates a Transformation object with the given coefficients. */
|
26 | export function transformation(a: number, b: number, c: number, d: number): Transformation;
|
27 |
|
28 | /** Expects an coefficients array of the form `[a: Number, b: Number, c: Number, d: Number]`. */
|
29 | export function transformation(coefficients: [number, number, number, number]): Transformation;
|
30 |
|
31 | /**
|
32 | * @see https://github.com/Leaflet/Leaflet/blob/bc918d4bdc2ba189807bc207c77080fb41ecc196/src/geometry/LineUtil.js#L118
|
33 | */
|
34 | export namespace LineUtil {
|
35 | function simplify(points: Point[], tolerance: number): Point[];
|
36 | function pointToSegmentDistance(p: Point, p1: Point, p2: Point): number;
|
37 | function closestPointOnSegment(p: Point, p1: Point, p2: Point): Point;
|
38 | function isFlat(latlngs: LatLngExpression[]): boolean;
|
39 | function clipSegment(
|
40 | a: Point,
|
41 | b: Point,
|
42 | bounds: Bounds,
|
43 | useLastCode?: boolean,
|
44 | round?: boolean,
|
45 | ): [Point, Point] | false;
|
46 | function polylineCenter(latlngs: LatLngExpression[], crs: CRS): LatLng;
|
47 | }
|
48 |
|
49 | export namespace PolyUtil {
|
50 | function clipPolygon(points: Point[], bounds: BoundsExpression, round?: boolean): Point[];
|
51 | function polygonCenter(latlngs: LatLngExpression[], crs: CRS): LatLng;
|
52 | }
|
53 |
|
54 | export namespace DomUtil {
|
55 | |
56 |
|
57 |
|
58 | function get(element: string | HTMLElement): HTMLElement | null;
|
59 | function getStyle(el: HTMLElement, styleAttrib: string): string | null;
|
60 | |
61 |
|
62 |
|
63 |
|
64 |
|
65 |
|
66 | function create<T extends keyof HTMLElementTagNameMap>(
|
67 | tagName: T,
|
68 | className?: string,
|
69 | container?: HTMLElement,
|
70 | ): HTMLElementTagNameMap[T];
|
71 | function create(tagName: string, className?: string, container?: HTMLElement): HTMLElement;
|
72 | function remove(el: HTMLElement): void;
|
73 | function empty(el: HTMLElement): void;
|
74 | function toFront(el: HTMLElement): void;
|
75 | function toBack(el: HTMLElement): void;
|
76 | function hasClass(el: HTMLElement, name: string): boolean;
|
77 | function addClass(el: HTMLElement, name: string): void;
|
78 | function removeClass(el: HTMLElement, name: string): void;
|
79 | function setClass(el: HTMLElement, name: string): void;
|
80 | function getClass(el: HTMLElement): string;
|
81 | function setOpacity(el: HTMLElement, opacity: number): void;
|
82 | function testProp(props: string[]): string | false;
|
83 | function setTransform(el: HTMLElement, offset: Point, scale?: number): void;
|
84 | function setPosition(el: HTMLElement, position: Point): void;
|
85 | function getPosition(el: HTMLElement): Point;
|
86 | function getScale(el: HTMLElement): { x: number; y: number; boundingClientRect: DOMRect };
|
87 | function getSizedParentNode(el: HTMLElement): HTMLElement;
|
88 | function disableTextSelection(): void;
|
89 | function enableTextSelection(): void;
|
90 | function disableImageDrag(): void;
|
91 | function enableImageDrag(): void;
|
92 | function preventOutline(el: HTMLElement): void;
|
93 | function restoreOutline(): void;
|
94 |
|
95 | let TRANSFORM: string;
|
96 | let TRANSITION: string;
|
97 | let TRANSITION_END: string;
|
98 | }
|
99 |
|
100 | export class PosAnimation extends Evented {
|
101 | run(el: HTMLElement, newPos: Point, duration?: number, easeLinearity?: number): void;
|
102 | stop(): void;
|
103 | }
|
104 |
|
105 | export interface CRS {
|
106 | latLngToPoint(latlng: LatLngExpression, zoom: number): Point;
|
107 | pointToLatLng(point: PointExpression, zoom: number): LatLng;
|
108 | project(latlng: LatLng | LatLngLiteral): Point;
|
109 | unproject(point: PointExpression): LatLng;
|
110 | scale(zoom: number): number;
|
111 | zoom(scale: number): number;
|
112 | getProjectedBounds(zoom: number): Bounds;
|
113 | distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number;
|
114 | wrapLatLng(latlng: LatLng | LatLngLiteral): LatLng;
|
115 |
|
116 | code?: string | undefined;
|
117 | wrapLng?: [number, number] | undefined;
|
118 | wrapLat?: [number, number] | undefined;
|
119 | infinite: boolean;
|
120 | }
|
121 |
|
122 | export namespace CRS {
|
123 | const EPSG3395: CRS;
|
124 | const EPSG3857: CRS;
|
125 | const EPSG4326: CRS;
|
126 | const EPSG900913: CRS;
|
127 | const Earth: CRS;
|
128 | const Simple: CRS;
|
129 | }
|
130 |
|
131 | export interface Projection {
|
132 | project(latlng: LatLng | LatLngLiteral): Point;
|
133 | unproject(point: PointExpression): LatLng;
|
134 |
|
135 | bounds: Bounds;
|
136 | }
|
137 |
|
138 | export namespace Projection {
|
139 | const LonLat: Projection;
|
140 | const Mercator: Projection;
|
141 | const SphericalMercator: Projection;
|
142 | }
|
143 |
|
144 | export class LatLng {
|
145 | constructor(latitude: number, longitude: number, altitude?: number);
|
146 | equals(otherLatLng: LatLngExpression, maxMargin?: number): boolean;
|
147 | toString(): string;
|
148 | distanceTo(otherLatLng: LatLngExpression): number;
|
149 | wrap(): LatLng;
|
150 | toBounds(sizeInMeters: number): LatLngBounds;
|
151 | clone(): LatLng;
|
152 |
|
153 | lat: number;
|
154 | lng: number;
|
155 | alt?: number | undefined;
|
156 | }
|
157 |
|
158 | export interface LatLngLiteral {
|
159 | lat: number;
|
160 | lng: number;
|
161 | alt?: number;
|
162 | }
|
163 |
|
164 | export type LatLngTuple = [number, number, number?];
|
165 |
|
166 | export type LatLngExpression = LatLng | LatLngLiteral | LatLngTuple;
|
167 |
|
168 | export function latLng(latitude: number, longitude: number, altitude?: number): LatLng;
|
169 |
|
170 | export function latLng(
|
171 | coords: LatLngTuple | [number, number, number] | LatLngLiteral | {
|
172 | lat: number;
|
173 | lng: number;
|
174 | alt?: number | undefined;
|
175 | },
|
176 | ): LatLng;
|
177 |
|
178 | export class LatLngBounds {
|
179 | constructor(southWest: LatLngExpression, northEast: LatLngExpression);
|
180 | constructor(latlngs: LatLngExpression[]);
|
181 | extend(latlngOrBounds: LatLngExpression | LatLngBoundsExpression): this;
|
182 | pad(bufferRatio: number): LatLngBounds; // Returns a new LatLngBounds
|
183 | getCenter(): LatLng;
|
184 | getSouthWest(): LatLng;
|
185 | getNorthEast(): LatLng;
|
186 | getNorthWest(): LatLng;
|
187 | getSouthEast(): LatLng;
|
188 | getWest(): number;
|
189 | getSouth(): number;
|
190 | getEast(): number;
|
191 | getNorth(): number;
|
192 | contains(otherBoundsOrLatLng: LatLngBoundsExpression | LatLngExpression): boolean;
|
193 | intersects(otherBounds: LatLngBoundsExpression): boolean;
|
194 | overlaps(otherBounds: LatLngBoundsExpression): boolean;
|
195 | toBBoxString(): string;
|
196 | equals(otherBounds: LatLngBoundsExpression, maxMargin?: number): boolean;
|
197 | isValid(): boolean;
|
198 | }
|
199 |
|
200 | export type LatLngBoundsLiteral = LatLngTuple[]; // Must be [LatLngTuple, LatLngTuple], cant't change because Map.setMaxBounds
|
201 |
|
202 | export type LatLngBoundsExpression = LatLngBounds | LatLngBoundsLiteral;
|
203 |
|
204 | export function latLngBounds(southWest: LatLngExpression, northEast: LatLngExpression): LatLngBounds;
|
205 |
|
206 | export function latLngBounds(latlngs: LatLngExpression[]): LatLngBounds;
|
207 |
|
208 | export type PointTuple = [number, number];
|
209 |
|
210 | export class Point {
|
211 | constructor(x: number, y: number, round?: boolean);
|
212 | clone(): Point;
|
213 | add(otherPoint: PointExpression): Point; // non-destructive, returns a new point
|
214 | subtract(otherPoint: PointExpression): Point;
|
215 | divideBy(num: number): Point;
|
216 | multiplyBy(num: number): Point;
|
217 | scaleBy(scale: PointExpression): Point;
|
218 | unscaleBy(scale: PointExpression): Point;
|
219 | round(): Point;
|
220 | floor(): Point;
|
221 | ceil(): Point;
|
222 | trunc(): Point;
|
223 | distanceTo(otherPoint: PointExpression): number;
|
224 | equals(otherPoint: PointExpression): boolean;
|
225 | contains(otherPoint: PointExpression): boolean;
|
226 | toString(): string;
|
227 | x: number;
|
228 | y: number;
|
229 | }
|
230 |
|
231 | export interface Coords extends Point {
|
232 | z: number;
|
233 | }
|
234 |
|
235 | export type PointExpression = Point | PointTuple;
|
236 |
|
237 | export function point(x: number, y: number, round?: boolean): Point;
|
238 |
|
239 | export function point(coords: PointTuple | { x: number; y: number }): Point;
|
240 |
|
241 | export type BoundsLiteral = [PointTuple, PointTuple];
|
242 |
|
243 | export class Bounds {
|
244 | constructor(topLeft: PointExpression, bottomRight: PointExpression);
|
245 | constructor(points?: Point[] | BoundsLiteral);
|
246 |
|
247 | // tslint:disable:unified-signatures
|
248 | extend(point: PointExpression): this;
|
249 | extend(otherBounds: BoundsExpression): this;
|
250 | // tslint:enable:unified-signatures
|
251 |
|
252 | getCenter(round?: boolean): Point;
|
253 | getBottomLeft(): Point;
|
254 | getBottomRight(): Point;
|
255 | getTopLeft(): Point;
|
256 | getTopRight(): Point;
|
257 | getSize(): Point;
|
258 | contains(pointOrBounds: BoundsExpression | PointExpression): boolean;
|
259 | intersects(otherBounds: BoundsExpression): boolean;
|
260 | overlaps(otherBounds: BoundsExpression): boolean;
|
261 | isValid(): boolean;
|
262 | pad(bufferRatio: number): Bounds; // Returns a new Bounds
|
263 | equals(otherBounds: BoundsExpression): boolean;
|
264 |
|
265 | min?: Point | undefined;
|
266 | max?: Point | undefined;
|
267 | }
|
268 |
|
269 | export type BoundsExpression = Bounds | BoundsLiteral;
|
270 |
|
271 | export function bounds(topLeft: PointExpression, bottomRight: PointExpression): Bounds;
|
272 |
|
273 | export function bounds(points: Point[] | BoundsLiteral): Bounds;
|
274 |
|
275 | // Event handler types
|
276 |
|
277 | export type LeafletEventHandlerFn = (event: LeafletEvent) => void;
|
278 |
|
279 | export type LayersControlEventHandlerFn = (event: LayersControlEvent) => void;
|
280 |
|
281 | export type LayerEventHandlerFn = (event: LayerEvent) => void;
|
282 |
|
283 | export type ResizeEventHandlerFn = (event: ResizeEvent) => void;
|
284 |
|
285 | export type PopupEventHandlerFn = (event: PopupEvent) => void;
|
286 |
|
287 | export type TooltipEventHandlerFn = (event: TooltipEvent) => void;
|
288 |
|
289 | export type ErrorEventHandlerFn = (event: ErrorEvent) => void;
|
290 |
|
291 | export type LocationEventHandlerFn = (event: LocationEvent) => void;
|
292 |
|
293 | export type LeafletMouseEventHandlerFn = (event: LeafletMouseEvent) => void;
|
294 |
|
295 | export type LeafletKeyboardEventHandlerFn = (event: LeafletKeyboardEvent) => void;
|
296 |
|
297 | export type ZoomAnimEventHandlerFn = (event: ZoomAnimEvent) => void;
|
298 |
|
299 | export type DragEndEventHandlerFn = (event: DragEndEvent) => void;
|
300 |
|
301 | export type TileEventHandlerFn = (event: TileEvent) => void;
|
302 |
|
303 | export type TileErrorEventHandlerFn = (event: TileErrorEvent) => void;
|
304 |
|
305 | export interface LeafletEventHandlerFnMap {
|
306 | baselayerchange?: LayersControlEventHandlerFn | undefined;
|
307 | overlayadd?: LayersControlEventHandlerFn | undefined;
|
308 | overlayremove?: LayersControlEventHandlerFn | undefined;
|
309 |
|
310 | layeradd?: LayerEventHandlerFn | undefined;
|
311 | layerremove?: LayerEventHandlerFn | undefined;
|
312 |
|
313 | zoomlevelschange?: LeafletEventHandlerFn | undefined;
|
314 | unload?: LeafletEventHandlerFn | undefined;
|
315 | viewreset?: LeafletEventHandlerFn | undefined;
|
316 | load?: LeafletEventHandlerFn | undefined;
|
317 | zoomstart?: LeafletEventHandlerFn | undefined;
|
318 | movestart?: LeafletEventHandlerFn | undefined;
|
319 | zoom?: LeafletEventHandlerFn | undefined;
|
320 | move?: LeafletEventHandlerFn | undefined;
|
321 | zoomend?: LeafletEventHandlerFn | undefined;
|
322 | moveend?: LeafletEventHandlerFn | undefined;
|
323 | autopanstart?: LeafletEventHandlerFn | undefined;
|
324 | dragstart?: LeafletEventHandlerFn | undefined;
|
325 | drag?: LeafletEventHandlerFn | undefined;
|
326 | add?: LeafletEventHandlerFn | undefined;
|
327 | remove?: LeafletEventHandlerFn | undefined;
|
328 | loading?: LeafletEventHandlerFn | undefined;
|
329 | error?: LeafletEventHandlerFn | undefined;
|
330 | update?: LeafletEventHandlerFn | undefined;
|
331 | down?: LeafletEventHandlerFn | undefined;
|
332 | predrag?: LeafletEventHandlerFn | undefined;
|
333 |
|
334 | resize?: ResizeEventHandlerFn | undefined;
|
335 |
|
336 | popupopen?: PopupEventHandlerFn | undefined;
|
337 | popupclose?: PopupEventHandlerFn | undefined;
|
338 |
|
339 | tooltipopen?: TooltipEventHandlerFn | undefined;
|
340 | tooltipclose?: TooltipEventHandlerFn | undefined;
|
341 |
|
342 | locationerror?: ErrorEventHandlerFn | undefined;
|
343 |
|
344 | locationfound?: LocationEventHandlerFn | undefined;
|
345 |
|
346 | click?: LeafletMouseEventHandlerFn | undefined;
|
347 | dblclick?: LeafletMouseEventHandlerFn | undefined;
|
348 | mousedown?: LeafletMouseEventHandlerFn | undefined;
|
349 | mouseup?: LeafletMouseEventHandlerFn | undefined;
|
350 | mouseover?: LeafletMouseEventHandlerFn | undefined;
|
351 | mouseout?: LeafletMouseEventHandlerFn | undefined;
|
352 | mousemove?: LeafletMouseEventHandlerFn | undefined;
|
353 | contextmenu?: LeafletMouseEventHandlerFn | undefined;
|
354 | preclick?: LeafletMouseEventHandlerFn | undefined;
|
355 |
|
356 | keypress?: LeafletKeyboardEventHandlerFn | undefined;
|
357 | keydown?: LeafletKeyboardEventHandlerFn | undefined;
|
358 | keyup?: LeafletKeyboardEventHandlerFn | undefined;
|
359 |
|
360 | zoomanim?: ZoomAnimEventHandlerFn | undefined;
|
361 |
|
362 | dragend?: DragEndEventHandlerFn | undefined;
|
363 |
|
364 | tileunload?: TileEventHandlerFn | undefined;
|
365 | tileloadstart?: TileEventHandlerFn | undefined;
|
366 | tileload?: TileEventHandlerFn | undefined;
|
367 | tileabort?: TileEventHandlerFn | undefined;
|
368 |
|
369 | tileerror?: TileErrorEventHandlerFn | undefined;
|
370 |
|
371 | // [name: string]: any;
|
372 | // You are able add additional properties, but it makes this interface uncheckable.
|
373 | }
|
374 |
|
375 | /**
|
376 | * A set of methods shared between event-powered classes (like Map and Marker).
|
377 | * Generally, events allow you to execute some function when something happens
|
378 | * with an object (e.g. the user clicks on the map, causing the map to fire
|
379 | * 'click' event).
|
380 | */
|
381 | // eslint-disable-next-line @definitelytyped/strict-export-declare-modifiers
|
382 | declare class Events {
|
383 | |
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 | on(type: "baselayerchange" | "overlayadd" | "overlayremove", fn: LayersControlEventHandlerFn, context?: any): this;
|
391 | on(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
392 | on(
|
393 | type:
|
394 | | "zoomlevelschange"
|
395 | | "unload"
|
396 | | "viewreset"
|
397 | | "load"
|
398 | | "zoomstart"
|
399 | | "movestart"
|
400 | | "zoom"
|
401 | | "move"
|
402 | | "zoomend"
|
403 | | "moveend"
|
404 | | "autopanstart"
|
405 | | "dragstart"
|
406 | | "drag"
|
407 | | "add"
|
408 | | "remove"
|
409 | | "loading"
|
410 | | "error"
|
411 | | "update"
|
412 | | "down"
|
413 | | "predrag",
|
414 | fn: LeafletEventHandlerFn,
|
415 | context?: any,
|
416 | ): this;
|
417 | on(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
418 | on(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
419 | on(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
420 | on(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
421 | on(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
422 | on(
|
423 | type:
|
424 | | "click"
|
425 | | "dblclick"
|
426 | | "mousedown"
|
427 | | "mouseup"
|
428 | | "mouseover"
|
429 | | "mouseout"
|
430 | | "mousemove"
|
431 | | "contextmenu"
|
432 | | "preclick",
|
433 | fn: LeafletMouseEventHandlerFn,
|
434 | context?: any,
|
435 | ): this;
|
436 | on(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): this;
|
437 | on(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
438 | on(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
439 | on(type: "tileunload" | "tileloadstart" | "tileload" | "tileabort", fn: TileEventHandlerFn, context?: any): this;
|
440 | on(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): this;
|
441 | on(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
442 |
|
443 | |
444 |
|
445 |
|
446 | on(eventMap: LeafletEventHandlerFnMap): this;
|
447 |
|
448 |
|
449 | |
450 |
|
451 |
|
452 |
|
453 |
|
454 |
|
455 |
|
456 | off(
|
457 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
458 | fn?: LayersControlEventHandlerFn,
|
459 | context?: any,
|
460 | ): this;
|
461 | off(type: "layeradd" | "layerremove", fn?: LayerEventHandlerFn, context?: any): this;
|
462 | off(
|
463 | type:
|
464 | | "zoomlevelschange"
|
465 | | "unload"
|
466 | | "viewreset"
|
467 | | "load"
|
468 | | "zoomstart"
|
469 | | "movestart"
|
470 | | "zoom"
|
471 | | "move"
|
472 | | "zoomend"
|
473 | | "moveend"
|
474 | | "autopanstart"
|
475 | | "dragstart"
|
476 | | "drag"
|
477 | | "add"
|
478 | | "remove"
|
479 | | "loading"
|
480 | | "error"
|
481 | | "update"
|
482 | | "down"
|
483 | | "predrag",
|
484 | fn?: LeafletEventHandlerFn,
|
485 | context?: any,
|
486 | ): this;
|
487 | off(type: "resize", fn?: ResizeEventHandlerFn, context?: any): this;
|
488 | off(type: "popupopen" | "popupclose", fn?: PopupEventHandlerFn, context?: any): this;
|
489 | off(type: "tooltipopen" | "tooltipclose", fn?: TooltipEventHandlerFn, context?: any): this;
|
490 | off(type: "locationerror", fn?: ErrorEventHandlerFn, context?: any): this;
|
491 | off(type: "locationfound", fn?: LocationEventHandlerFn, context?: any): this;
|
492 | off(
|
493 | type:
|
494 | | "click"
|
495 | | "dblclick"
|
496 | | "mousedown"
|
497 | | "mouseup"
|
498 | | "mouseover"
|
499 | | "mouseout"
|
500 | | "mousemove"
|
501 | | "contextmenu"
|
502 | | "preclick",
|
503 | fn?: LeafletMouseEventHandlerFn,
|
504 | context?: any,
|
505 | ): this;
|
506 | off(type: "keypress" | "keydown" | "keyup", fn?: LeafletKeyboardEventHandlerFn, context?: any): this;
|
507 | off(type: "zoomanim", fn?: ZoomAnimEventHandlerFn, context?: any): this;
|
508 | off(type: "dragend", fn?: DragEndEventHandlerFn, context?: any): this;
|
509 | off(type: "tileunload" | "tileloadstart" | "tileload" | "tileabort", fn?: TileEventHandlerFn, context?: any): this;
|
510 | off(type: "tileerror", fn?: TileErrorEventHandlerFn, context?: any): this;
|
511 | off(type: string, fn?: LeafletEventHandlerFn, context?: any): this;
|
512 |
|
513 | |
514 |
|
515 |
|
516 |
|
517 | off(eventMap: LeafletEventHandlerFnMap): this;
|
518 |
|
519 | |
520 |
|
521 |
|
522 | off(): this;
|
523 |
|
524 |
|
525 | |
526 |
|
527 |
|
528 |
|
529 |
|
530 | fire(type: string, data?: any, propagate?: boolean): this;
|
531 |
|
532 | |
533 |
|
534 |
|
535 |
|
536 | listens(
|
537 | type:
|
538 | | "baselayerchange"
|
539 | | "overlayadd"
|
540 | | "overlayremove"
|
541 | | "layeradd"
|
542 | | "layerremove"
|
543 | | "zoomlevelschange"
|
544 | | "unload"
|
545 | | "viewreset"
|
546 | | "load"
|
547 | | "zoomstart"
|
548 | | "movestart"
|
549 | | "zoom"
|
550 | | "move"
|
551 | | "zoomend"
|
552 | | "moveend"
|
553 | | "autopanstart"
|
554 | | "dragstart"
|
555 | | "drag"
|
556 | | "add"
|
557 | | "remove"
|
558 | | "loading"
|
559 | | "error"
|
560 | | "update"
|
561 | | "down"
|
562 | | "predrag"
|
563 | | "resize"
|
564 | | "popupopen"
|
565 | | "tooltipopen"
|
566 | | "tooltipclose"
|
567 | | "locationerror"
|
568 | | "locationfound"
|
569 | | "click"
|
570 | | "dblclick"
|
571 | | "mousedown"
|
572 | | "mouseup"
|
573 | | "mouseover"
|
574 | | "mouseout"
|
575 | | "mousemove"
|
576 | | "contextmenu"
|
577 | | "preclick"
|
578 | | "keypress"
|
579 | | "keydown"
|
580 | | "keyup"
|
581 | | "zoomanim"
|
582 | | "dragend"
|
583 | | "tileunload"
|
584 | | "tileloadstart"
|
585 | | "tileload"
|
586 | | "tileabort"
|
587 | | "tileerror",
|
588 | propagate?: boolean,
|
589 | ): boolean;
|
590 |
|
591 | listens(
|
592 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
593 | fn: LayersControlEventHandlerFn,
|
594 | context?: any,
|
595 | propagate?: boolean,
|
596 | ): boolean;
|
597 | listens(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
598 | listens(
|
599 | type:
|
600 | | "zoomlevelschange"
|
601 | | "unload"
|
602 | | "viewreset"
|
603 | | "load"
|
604 | | "zoomstart"
|
605 | | "movestart"
|
606 | | "zoom"
|
607 | | "move"
|
608 | | "zoomend"
|
609 | | "moveend"
|
610 | | "autopanstart"
|
611 | | "dragstart"
|
612 | | "drag"
|
613 | | "add"
|
614 | | "remove"
|
615 | | "loading"
|
616 | | "error"
|
617 | | "update"
|
618 | | "down"
|
619 | | "predrag",
|
620 | fn: LeafletEventHandlerFn,
|
621 | context?: any,
|
622 | propagate?: boolean,
|
623 | ): boolean;
|
624 | listens(type: "resize", fn: ResizeEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
625 | listens(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
626 | listens(
|
627 | type: "tooltipopen" | "tooltipclose",
|
628 | fn: TooltipEventHandlerFn,
|
629 | context?: any,
|
630 | propagate?: boolean,
|
631 | ): boolean;
|
632 | listens(type: "locationerror", fn: ErrorEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
633 | listens(type: "locationfound", fn: LocationEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
634 | listens(
|
635 | type:
|
636 | | "click"
|
637 | | "dblclick"
|
638 | | "mousedown"
|
639 | | "mouseup"
|
640 | | "mouseover"
|
641 | | "mouseout"
|
642 | | "mousemove"
|
643 | | "contextmenu"
|
644 | | "preclick",
|
645 | fn: LeafletMouseEventHandlerFn,
|
646 | context?: any,
|
647 | propagate?: boolean,
|
648 | ): boolean;
|
649 | listens(
|
650 | type: "keypress" | "keydown" | "keyup",
|
651 | fn: LeafletKeyboardEventHandlerFn,
|
652 | context?: any,
|
653 | propagate?: boolean,
|
654 | ): boolean;
|
655 | listens(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
656 | listens(type: "dragend", fn: DragEndEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
657 | listens(
|
658 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
659 | fn: TileEventHandlerFn,
|
660 | context?: any,
|
661 | propagate?: boolean,
|
662 | ): boolean;
|
663 | listens(type: "tileerror", fn: TileEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
664 | listens(type: string, fn: LeafletEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
665 |
|
666 | |
667 |
|
668 |
|
669 |
|
670 | once(
|
671 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
672 | fn: LayersControlEventHandlerFn,
|
673 | context?: any,
|
674 | ): this;
|
675 | once(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
676 | once(
|
677 | type:
|
678 | | "zoomlevelschange"
|
679 | | "unload"
|
680 | | "viewreset"
|
681 | | "load"
|
682 | | "zoomstart"
|
683 | | "movestart"
|
684 | | "zoom"
|
685 | | "move"
|
686 | | "zoomend"
|
687 | | "moveend"
|
688 | | "autopanstart"
|
689 | | "dragstart"
|
690 | | "drag"
|
691 | | "add"
|
692 | | "remove"
|
693 | | "loading"
|
694 | | "error"
|
695 | | "update"
|
696 | | "down"
|
697 | | "predrag",
|
698 | fn: LeafletEventHandlerFn,
|
699 | context?: any,
|
700 | ): this;
|
701 | once(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
702 | once(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
703 | once(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
704 | once(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
705 | once(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
706 | once(
|
707 | type:
|
708 | | "click"
|
709 | | "dblclick"
|
710 | | "mousedown"
|
711 | | "mouseup"
|
712 | | "mouseover"
|
713 | | "mouseout"
|
714 | | "mousemove"
|
715 | | "contextmenu"
|
716 | | "preclick",
|
717 | fn: LeafletMouseEventHandlerFn,
|
718 | context?: any,
|
719 | ): this;
|
720 | once(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): this;
|
721 | once(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
722 | once(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
723 | once(type: "tileunload" | "tileloadstart" | "tileload" | "tileabort", fn: TileEventHandlerFn, context?: any): this;
|
724 | once(type: "tileerror", fn: TileEventHandlerFn, context?: any): this;
|
725 | once(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
726 |
|
727 | |
728 |
|
729 |
|
730 | once(eventMap: LeafletEventHandlerFnMap): this;
|
731 |
|
732 |
|
733 | |
734 |
|
735 |
|
736 | addEventParent(obj: Evented): this;
|
737 |
|
738 | |
739 |
|
740 |
|
741 | removeEventParent(obj: Evented): this;
|
742 |
|
743 | |
744 |
|
745 |
|
746 |
|
747 |
|
748 |
|
749 |
|
750 |
|
751 |
|
752 | addEventListener(
|
753 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
754 | fn: LayersControlEventHandlerFn,
|
755 | context?: any,
|
756 | ): this;
|
757 | addEventListener(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
758 | addEventListener(
|
759 | type:
|
760 | | "zoomlevelschange"
|
761 | | "unload"
|
762 | | "viewreset"
|
763 | | "load"
|
764 | | "zoomstart"
|
765 | | "movestart"
|
766 | | "zoom"
|
767 | | "move"
|
768 | | "zoomend"
|
769 | | "moveend"
|
770 | | "autopanstart"
|
771 | | "dragstart"
|
772 | | "drag"
|
773 | | "add"
|
774 | | "remove"
|
775 | | "loading"
|
776 | | "error"
|
777 | | "update"
|
778 | | "down"
|
779 | | "predrag",
|
780 | fn: LeafletEventHandlerFn,
|
781 | context?: any,
|
782 | ): this;
|
783 | addEventListener(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
784 | addEventListener(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
785 | addEventListener(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
786 | addEventListener(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
787 | addEventListener(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
788 | addEventListener(
|
789 | type:
|
790 | | "click"
|
791 | | "dblclick"
|
792 | | "mousedown"
|
793 | | "mouseup"
|
794 | | "mouseover"
|
795 | | "mouseout"
|
796 | | "mousemove"
|
797 | | "contextmenu"
|
798 | | "preclick",
|
799 | fn: LeafletMouseEventHandlerFn,
|
800 | context?: any,
|
801 | ): this;
|
802 | addEventListener(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): this;
|
803 | addEventListener(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
804 | addEventListener(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
805 | addEventListener(
|
806 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
807 | fn: TileEventHandlerFn,
|
808 | context?: any,
|
809 | ): this;
|
810 | addEventListener(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): this;
|
811 | addEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
812 |
|
813 | |
814 |
|
815 |
|
816 |
|
817 |
|
818 | addEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
819 |
|
820 |
|
821 | |
822 |
|
823 |
|
824 |
|
825 |
|
826 |
|
827 |
|
828 |
|
829 |
|
830 | removeEventListener(
|
831 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
832 | fn?: LayersControlEventHandlerFn,
|
833 | context?: any,
|
834 | ): this;
|
835 | removeEventListener(type: "layeradd" | "layerremove", fn?: LayerEventHandlerFn, context?: any): this;
|
836 | removeEventListener(
|
837 | type:
|
838 | | "zoomlevelschange"
|
839 | | "unload"
|
840 | | "viewreset"
|
841 | | "load"
|
842 | | "zoomstart"
|
843 | | "movestart"
|
844 | | "zoom"
|
845 | | "move"
|
846 | | "zoomend"
|
847 | | "moveend"
|
848 | | "autopanstart"
|
849 | | "dragstart"
|
850 | | "drag"
|
851 | | "add"
|
852 | | "remove"
|
853 | | "loading"
|
854 | | "error"
|
855 | | "update"
|
856 | | "down"
|
857 | | "predrag",
|
858 | fn?: LeafletEventHandlerFn,
|
859 | context?: any,
|
860 | ): this;
|
861 | removeEventListener(type: "resize", fn?: ResizeEventHandlerFn, context?: any): this;
|
862 | removeEventListener(type: "popupopen" | "popupclose", fn?: PopupEventHandlerFn, context?: any): this;
|
863 | removeEventListener(type: "tooltipopen" | "tooltipclose", fn?: TooltipEventHandlerFn, context?: any): this;
|
864 | removeEventListener(type: "locationerror", fn?: ErrorEventHandlerFn, context?: any): this;
|
865 | removeEventListener(type: "locationfound", fn?: LocationEventHandlerFn, context?: any): this;
|
866 | removeEventListener(
|
867 | type:
|
868 | | "click"
|
869 | | "dblclick"
|
870 | | "mousedown"
|
871 | | "mouseup"
|
872 | | "mouseover"
|
873 | | "mouseout"
|
874 | | "mousemove"
|
875 | | "contextmenu"
|
876 | | "preclick",
|
877 | fn?: LeafletMouseEventHandlerFn,
|
878 | context?: any,
|
879 | ): this;
|
880 | removeEventListener(
|
881 | type: "keypress" | "keydown" | "keyup",
|
882 | fn?: LeafletKeyboardEventHandlerFn,
|
883 | context?: any,
|
884 | ): this;
|
885 | removeEventListener(type: "zoomanim", fn?: ZoomAnimEventHandlerFn, context?: any): this;
|
886 | removeEventListener(type: "dragend", fn?: DragEndEventHandlerFn, context?: any): this;
|
887 | removeEventListener(
|
888 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
889 | fn?: TileEventHandlerFn,
|
890 | context?: any,
|
891 | ): this;
|
892 | removeEventListener(type: "tileerror", fn?: TileErrorEventHandlerFn, context?: any): this;
|
893 | removeEventListener(type: string, fn?: LeafletEventHandlerFn, context?: any): this;
|
894 |
|
895 | |
896 |
|
897 |
|
898 |
|
899 |
|
900 | removeEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
901 |
|
902 |
|
903 | |
904 |
|
905 |
|
906 |
|
907 |
|
908 | clearAllEventListeners(): this;
|
909 |
|
910 | |
911 |
|
912 |
|
913 |
|
914 |
|
915 |
|
916 | addOneTimeEventListener(
|
917 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
918 | fn: LayersControlEventHandlerFn,
|
919 | context?: any,
|
920 | ): this;
|
921 | addOneTimeEventListener(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
922 | addOneTimeEventListener(
|
923 | type:
|
924 | | "zoomlevelschange"
|
925 | | "unload"
|
926 | | "viewreset"
|
927 | | "load"
|
928 | | "zoomstart"
|
929 | | "movestart"
|
930 | | "zoom"
|
931 | | "move"
|
932 | | "zoomend"
|
933 | | "moveend"
|
934 | | "autopanstart"
|
935 | | "dragstart"
|
936 | | "drag"
|
937 | | "add"
|
938 | | "remove"
|
939 | | "loading"
|
940 | | "error"
|
941 | | "update"
|
942 | | "down"
|
943 | | "predrag",
|
944 | fn: LeafletEventHandlerFn,
|
945 | context?: any,
|
946 | ): this;
|
947 | addOneTimeEventListener(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
948 | addOneTimeEventListener(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
949 | addOneTimeEventListener(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
950 | addOneTimeEventListener(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
951 | addOneTimeEventListener(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
952 | addOneTimeEventListener(
|
953 | type:
|
954 | | "click"
|
955 | | "dblclick"
|
956 | | "mousedown"
|
957 | | "mouseup"
|
958 | | "mouseover"
|
959 | | "mouseout"
|
960 | | "mousemove"
|
961 | | "contextmenu"
|
962 | | "preclick",
|
963 | fn: LeafletMouseEventHandlerFn,
|
964 | context?: any,
|
965 | ): this;
|
966 | addOneTimeEventListener(
|
967 | type: "keypress" | "keydown" | "keyup",
|
968 | fn: LeafletKeyboardEventHandlerFn,
|
969 | context?: any,
|
970 | ): this;
|
971 | addOneTimeEventListener(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
972 | addOneTimeEventListener(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
973 | addOneTimeEventListener(
|
974 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
975 | fn: TileEventHandlerFn,
|
976 | context?: any,
|
977 | ): this;
|
978 | addOneTimeEventListener(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): this;
|
979 | addOneTimeEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
980 |
|
981 | |
982 |
|
983 |
|
984 |
|
985 |
|
986 | addOneTimeEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
987 |
|
988 |
|
989 | |
990 |
|
991 |
|
992 |
|
993 |
|
994 |
|
995 |
|
996 | fireEvent(type: string, data?: any, propagate?: boolean): this;
|
997 |
|
998 | |
999 |
|
1000 |
|
1001 |
|
1002 |
|
1003 | hasEventListeners(type: string): boolean;
|
1004 | }
|
1005 |
|
1006 |
|
1007 | declare class MixinType {
|
1008 | Events: Events;
|
1009 | }
|
1010 |
|
1011 | export const Mixin: MixinType;
|
1012 |
|
1013 |
|
1014 |
|
1015 |
|
1016 | export abstract class Evented extends Class {
|
1017 | |
1018 |
|
1019 |
|
1020 |
|
1021 |
|
1022 |
|
1023 |
|
1024 | on(type: "baselayerchange" | "overlayadd" | "overlayremove", fn: LayersControlEventHandlerFn, context?: any): this;
|
1025 | on(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
1026 | on(
|
1027 | type:
|
1028 | | "zoomlevelschange"
|
1029 | | "unload"
|
1030 | | "viewreset"
|
1031 | | "load"
|
1032 | | "zoomstart"
|
1033 | | "movestart"
|
1034 | | "zoom"
|
1035 | | "move"
|
1036 | | "zoomend"
|
1037 | | "moveend"
|
1038 | | "autopanstart"
|
1039 | | "dragstart"
|
1040 | | "drag"
|
1041 | | "add"
|
1042 | | "remove"
|
1043 | | "loading"
|
1044 | | "error"
|
1045 | | "update"
|
1046 | | "down"
|
1047 | | "predrag",
|
1048 | fn: LeafletEventHandlerFn,
|
1049 | context?: any,
|
1050 | ): this;
|
1051 | on(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
1052 | on(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
1053 | on(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
1054 | on(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
1055 | on(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
1056 | on(
|
1057 | type:
|
1058 | | "click"
|
1059 | | "dblclick"
|
1060 | | "mousedown"
|
1061 | | "mouseup"
|
1062 | | "mouseover"
|
1063 | | "mouseout"
|
1064 | | "mousemove"
|
1065 | | "contextmenu"
|
1066 | | "preclick",
|
1067 | fn: LeafletMouseEventHandlerFn,
|
1068 | context?: any,
|
1069 | ): this;
|
1070 | on(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): this;
|
1071 | on(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
1072 | on(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
1073 | on(type: "tileunload" | "tileloadstart" | "tileload" | "tileabort", fn: TileEventHandlerFn, context?: any): this;
|
1074 | on(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): this;
|
1075 | on(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
1076 |
|
1077 | |
1078 |
|
1079 |
|
1080 | on(eventMap: LeafletEventHandlerFnMap): this;
|
1081 |
|
1082 |
|
1083 | |
1084 |
|
1085 |
|
1086 |
|
1087 |
|
1088 |
|
1089 |
|
1090 | off(
|
1091 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
1092 | fn?: LayersControlEventHandlerFn,
|
1093 | context?: any,
|
1094 | ): this;
|
1095 | off(type: "layeradd" | "layerremove", fn?: LayerEventHandlerFn, context?: any): this;
|
1096 | off(
|
1097 | type:
|
1098 | | "zoomlevelschange"
|
1099 | | "unload"
|
1100 | | "viewreset"
|
1101 | | "load"
|
1102 | | "zoomstart"
|
1103 | | "movestart"
|
1104 | | "zoom"
|
1105 | | "move"
|
1106 | | "zoomend"
|
1107 | | "moveend"
|
1108 | | "autopanstart"
|
1109 | | "dragstart"
|
1110 | | "drag"
|
1111 | | "add"
|
1112 | | "remove"
|
1113 | | "loading"
|
1114 | | "error"
|
1115 | | "update"
|
1116 | | "down"
|
1117 | | "predrag",
|
1118 | fn?: LeafletEventHandlerFn,
|
1119 | context?: any,
|
1120 | ): this;
|
1121 | off(type: "resize", fn?: ResizeEventHandlerFn, context?: any): this;
|
1122 | off(type: "popupopen" | "popupclose", fn?: PopupEventHandlerFn, context?: any): this;
|
1123 | off(type: "tooltipopen" | "tooltipclose", fn?: TooltipEventHandlerFn, context?: any): this;
|
1124 | off(type: "locationerror", fn?: ErrorEventHandlerFn, context?: any): this;
|
1125 | off(type: "locationfound", fn?: LocationEventHandlerFn, context?: any): this;
|
1126 | off(
|
1127 | type:
|
1128 | | "click"
|
1129 | | "dblclick"
|
1130 | | "mousedown"
|
1131 | | "mouseup"
|
1132 | | "mouseover"
|
1133 | | "mouseout"
|
1134 | | "mousemove"
|
1135 | | "contextmenu"
|
1136 | | "preclick",
|
1137 | fn?: LeafletMouseEventHandlerFn,
|
1138 | context?: any,
|
1139 | ): this;
|
1140 | off(type: "keypress" | "keydown" | "keyup", fn?: LeafletKeyboardEventHandlerFn, context?: any): this;
|
1141 | off(type: "zoomanim", fn?: ZoomAnimEventHandlerFn, context?: any): this;
|
1142 | off(type: "dragend", fn?: DragEndEventHandlerFn, context?: any): this;
|
1143 | off(type: "tileunload" | "tileloadstart" | "tileload" | "tileabort", fn?: TileEventHandlerFn, context?: any): this;
|
1144 | off(type: "tileerror", fn?: TileErrorEventHandlerFn, context?: any): this;
|
1145 | off(type: string, fn?: LeafletEventHandlerFn, context?: any): this;
|
1146 |
|
1147 | |
1148 |
|
1149 |
|
1150 |
|
1151 | off(eventMap: LeafletEventHandlerFnMap): this;
|
1152 |
|
1153 | |
1154 |
|
1155 |
|
1156 | off(): this;
|
1157 |
|
1158 |
|
1159 | |
1160 |
|
1161 |
|
1162 |
|
1163 |
|
1164 | fire(type: string, data?: any, propagate?: boolean): this;
|
1165 |
|
1166 | |
1167 |
|
1168 |
|
1169 |
|
1170 | listens(
|
1171 | type:
|
1172 | | "baselayerchange"
|
1173 | | "overlayadd"
|
1174 | | "overlayremove"
|
1175 | | "layeradd"
|
1176 | | "layerremove"
|
1177 | | "zoomlevelschange"
|
1178 | | "unload"
|
1179 | | "viewreset"
|
1180 | | "load"
|
1181 | | "zoomstart"
|
1182 | | "movestart"
|
1183 | | "zoom"
|
1184 | | "move"
|
1185 | | "zoomend"
|
1186 | | "moveend"
|
1187 | | "autopanstart"
|
1188 | | "dragstart"
|
1189 | | "drag"
|
1190 | | "add"
|
1191 | | "remove"
|
1192 | | "loading"
|
1193 | | "error"
|
1194 | | "update"
|
1195 | | "down"
|
1196 | | "predrag"
|
1197 | | "resize"
|
1198 | | "popupopen"
|
1199 | | "tooltipopen"
|
1200 | | "tooltipclose"
|
1201 | | "locationerror"
|
1202 | | "locationfound"
|
1203 | | "click"
|
1204 | | "dblclick"
|
1205 | | "mousedown"
|
1206 | | "mouseup"
|
1207 | | "mouseover"
|
1208 | | "mouseout"
|
1209 | | "mousemove"
|
1210 | | "contextmenu"
|
1211 | | "preclick"
|
1212 | | "keypress"
|
1213 | | "keydown"
|
1214 | | "keyup"
|
1215 | | "zoomanim"
|
1216 | | "dragend"
|
1217 | | "tileunload"
|
1218 | | "tileloadstart"
|
1219 | | "tileload"
|
1220 | | "tileabort"
|
1221 | | "tileerror",
|
1222 | propagate?: boolean,
|
1223 | ): boolean;
|
1224 |
|
1225 | listens(
|
1226 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
1227 | fn: LayersControlEventHandlerFn,
|
1228 | context?: any,
|
1229 | propagate?: boolean,
|
1230 | ): boolean;
|
1231 | listens(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1232 | listens(
|
1233 | type:
|
1234 | | "zoomlevelschange"
|
1235 | | "unload"
|
1236 | | "viewreset"
|
1237 | | "load"
|
1238 | | "zoomstart"
|
1239 | | "movestart"
|
1240 | | "zoom"
|
1241 | | "move"
|
1242 | | "zoomend"
|
1243 | | "moveend"
|
1244 | | "autopanstart"
|
1245 | | "dragstart"
|
1246 | | "drag"
|
1247 | | "add"
|
1248 | | "remove"
|
1249 | | "loading"
|
1250 | | "error"
|
1251 | | "update"
|
1252 | | "down"
|
1253 | | "predrag",
|
1254 | fn: LeafletEventHandlerFn,
|
1255 | context?: any,
|
1256 | propagate?: boolean,
|
1257 | ): boolean;
|
1258 | listens(type: "resize", fn: ResizeEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1259 | listens(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1260 | listens(
|
1261 | type: "tooltipopen" | "tooltipclose",
|
1262 | fn: TooltipEventHandlerFn,
|
1263 | context?: any,
|
1264 | propagate?: boolean,
|
1265 | ): boolean;
|
1266 | listens(type: "locationerror", fn: ErrorEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1267 | listens(type: "locationfound", fn: LocationEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1268 | listens(
|
1269 | type:
|
1270 | | "click"
|
1271 | | "dblclick"
|
1272 | | "mousedown"
|
1273 | | "mouseup"
|
1274 | | "mouseover"
|
1275 | | "mouseout"
|
1276 | | "mousemove"
|
1277 | | "contextmenu"
|
1278 | | "preclick",
|
1279 | fn: LeafletMouseEventHandlerFn,
|
1280 | context?: any,
|
1281 | propagate?: boolean,
|
1282 | ): boolean;
|
1283 | listens(
|
1284 | type: "keypress" | "keydown" | "keyup",
|
1285 | fn: LeafletKeyboardEventHandlerFn,
|
1286 | context?: any,
|
1287 | propagate?: boolean,
|
1288 | ): boolean;
|
1289 | listens(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1290 | listens(type: "dragend", fn: DragEndEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1291 | listens(
|
1292 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
1293 | fn: TileEventHandlerFn,
|
1294 | context?: any,
|
1295 | propagate?: boolean,
|
1296 | ): boolean;
|
1297 | listens(type: "tileerror", fn: TileEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1298 | listens(type: string, fn: LeafletEventHandlerFn, context?: any, propagate?: boolean): boolean;
|
1299 |
|
1300 | |
1301 |
|
1302 |
|
1303 |
|
1304 | once(
|
1305 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
1306 | fn: LayersControlEventHandlerFn,
|
1307 | context?: any,
|
1308 | ): this;
|
1309 | once(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
1310 | once(
|
1311 | type:
|
1312 | | "zoomlevelschange"
|
1313 | | "unload"
|
1314 | | "viewreset"
|
1315 | | "load"
|
1316 | | "zoomstart"
|
1317 | | "movestart"
|
1318 | | "zoom"
|
1319 | | "move"
|
1320 | | "zoomend"
|
1321 | | "moveend"
|
1322 | | "autopanstart"
|
1323 | | "dragstart"
|
1324 | | "drag"
|
1325 | | "add"
|
1326 | | "remove"
|
1327 | | "loading"
|
1328 | | "error"
|
1329 | | "update"
|
1330 | | "down"
|
1331 | | "predrag",
|
1332 | fn: LeafletEventHandlerFn,
|
1333 | context?: any,
|
1334 | ): this;
|
1335 | once(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
1336 | once(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
1337 | once(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
1338 | once(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
1339 | once(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
1340 | once(
|
1341 | type:
|
1342 | | "click"
|
1343 | | "dblclick"
|
1344 | | "mousedown"
|
1345 | | "mouseup"
|
1346 | | "mouseover"
|
1347 | | "mouseout"
|
1348 | | "mousemove"
|
1349 | | "contextmenu"
|
1350 | | "preclick",
|
1351 | fn: LeafletMouseEventHandlerFn,
|
1352 | context?: any,
|
1353 | ): this;
|
1354 | once(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): this;
|
1355 | once(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
1356 | once(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
1357 | once(type: "tileunload" | "tileloadstart" | "tileload" | "tileabort", fn: TileEventHandlerFn, context?: any): this;
|
1358 | once(type: "tileerror", fn: TileEventHandlerFn, context?: any): this;
|
1359 | once(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
1360 |
|
1361 | |
1362 |
|
1363 |
|
1364 | once(eventMap: LeafletEventHandlerFnMap): this;
|
1365 |
|
1366 |
|
1367 | |
1368 |
|
1369 |
|
1370 | addEventParent(obj: Evented): this;
|
1371 |
|
1372 | |
1373 |
|
1374 |
|
1375 | removeEventParent(obj: Evented): this;
|
1376 |
|
1377 | |
1378 |
|
1379 |
|
1380 |
|
1381 |
|
1382 |
|
1383 |
|
1384 |
|
1385 |
|
1386 | addEventListener(
|
1387 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
1388 | fn: LayersControlEventHandlerFn,
|
1389 | context?: any,
|
1390 | ): this;
|
1391 | addEventListener(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
1392 | addEventListener(
|
1393 | type:
|
1394 | | "zoomlevelschange"
|
1395 | | "unload"
|
1396 | | "viewreset"
|
1397 | | "load"
|
1398 | | "zoomstart"
|
1399 | | "movestart"
|
1400 | | "zoom"
|
1401 | | "move"
|
1402 | | "zoomend"
|
1403 | | "moveend"
|
1404 | | "autopanstart"
|
1405 | | "dragstart"
|
1406 | | "drag"
|
1407 | | "add"
|
1408 | | "remove"
|
1409 | | "loading"
|
1410 | | "error"
|
1411 | | "update"
|
1412 | | "down"
|
1413 | | "predrag",
|
1414 | fn: LeafletEventHandlerFn,
|
1415 | context?: any,
|
1416 | ): this;
|
1417 | addEventListener(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
1418 | addEventListener(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
1419 | addEventListener(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
1420 | addEventListener(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
1421 | addEventListener(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
1422 | addEventListener(
|
1423 | type:
|
1424 | | "click"
|
1425 | | "dblclick"
|
1426 | | "mousedown"
|
1427 | | "mouseup"
|
1428 | | "mouseover"
|
1429 | | "mouseout"
|
1430 | | "mousemove"
|
1431 | | "contextmenu"
|
1432 | | "preclick",
|
1433 | fn: LeafletMouseEventHandlerFn,
|
1434 | context?: any,
|
1435 | ): this;
|
1436 | addEventListener(type: "keypress" | "keydown" | "keyup", fn: LeafletKeyboardEventHandlerFn, context?: any): this;
|
1437 | addEventListener(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
1438 | addEventListener(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
1439 | addEventListener(
|
1440 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
1441 | fn: TileEventHandlerFn,
|
1442 | context?: any,
|
1443 | ): this;
|
1444 | addEventListener(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): this;
|
1445 | addEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
1446 |
|
1447 | |
1448 |
|
1449 |
|
1450 |
|
1451 |
|
1452 | addEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
1453 |
|
1454 |
|
1455 | |
1456 |
|
1457 |
|
1458 |
|
1459 |
|
1460 |
|
1461 |
|
1462 |
|
1463 |
|
1464 | removeEventListener(
|
1465 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
1466 | fn?: LayersControlEventHandlerFn,
|
1467 | context?: any,
|
1468 | ): this;
|
1469 | removeEventListener(type: "layeradd" | "layerremove", fn?: LayerEventHandlerFn, context?: any): this;
|
1470 | removeEventListener(
|
1471 | type:
|
1472 | | "zoomlevelschange"
|
1473 | | "unload"
|
1474 | | "viewreset"
|
1475 | | "load"
|
1476 | | "zoomstart"
|
1477 | | "movestart"
|
1478 | | "zoom"
|
1479 | | "move"
|
1480 | | "zoomend"
|
1481 | | "moveend"
|
1482 | | "autopanstart"
|
1483 | | "dragstart"
|
1484 | | "drag"
|
1485 | | "add"
|
1486 | | "remove"
|
1487 | | "loading"
|
1488 | | "error"
|
1489 | | "update"
|
1490 | | "down"
|
1491 | | "predrag",
|
1492 | fn?: LeafletEventHandlerFn,
|
1493 | context?: any,
|
1494 | ): this;
|
1495 | removeEventListener(type: "resize", fn?: ResizeEventHandlerFn, context?: any): this;
|
1496 | removeEventListener(type: "popupopen" | "popupclose", fn?: PopupEventHandlerFn, context?: any): this;
|
1497 | removeEventListener(type: "tooltipopen" | "tooltipclose", fn?: TooltipEventHandlerFn, context?: any): this;
|
1498 | removeEventListener(type: "locationerror", fn?: ErrorEventHandlerFn, context?: any): this;
|
1499 | removeEventListener(type: "locationfound", fn?: LocationEventHandlerFn, context?: any): this;
|
1500 | removeEventListener(
|
1501 | type:
|
1502 | | "click"
|
1503 | | "dblclick"
|
1504 | | "mousedown"
|
1505 | | "mouseup"
|
1506 | | "mouseover"
|
1507 | | "mouseout"
|
1508 | | "mousemove"
|
1509 | | "contextmenu"
|
1510 | | "preclick",
|
1511 | fn?: LeafletMouseEventHandlerFn,
|
1512 | context?: any,
|
1513 | ): this;
|
1514 | removeEventListener(
|
1515 | type: "keypress" | "keydown" | "keyup",
|
1516 | fn?: LeafletKeyboardEventHandlerFn,
|
1517 | context?: any,
|
1518 | ): this;
|
1519 | removeEventListener(type: "zoomanim", fn?: ZoomAnimEventHandlerFn, context?: any): this;
|
1520 | removeEventListener(type: "dragend", fn?: DragEndEventHandlerFn, context?: any): this;
|
1521 | removeEventListener(
|
1522 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
1523 | fn?: TileEventHandlerFn,
|
1524 | context?: any,
|
1525 | ): this;
|
1526 | removeEventListener(type: "tileerror", fn?: TileErrorEventHandlerFn, context?: any): this;
|
1527 | removeEventListener(type: string, fn?: LeafletEventHandlerFn, context?: any): this;
|
1528 |
|
1529 | |
1530 |
|
1531 |
|
1532 |
|
1533 |
|
1534 | removeEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
1535 |
|
1536 |
|
1537 | |
1538 |
|
1539 |
|
1540 |
|
1541 |
|
1542 | clearAllEventListeners(): this;
|
1543 |
|
1544 | |
1545 |
|
1546 |
|
1547 |
|
1548 |
|
1549 |
|
1550 | addOneTimeEventListener(
|
1551 | type: "baselayerchange" | "overlayadd" | "overlayremove",
|
1552 | fn: LayersControlEventHandlerFn,
|
1553 | context?: any,
|
1554 | ): this;
|
1555 | addOneTimeEventListener(type: "layeradd" | "layerremove", fn: LayerEventHandlerFn, context?: any): this;
|
1556 | addOneTimeEventListener(
|
1557 | type:
|
1558 | | "zoomlevelschange"
|
1559 | | "unload"
|
1560 | | "viewreset"
|
1561 | | "load"
|
1562 | | "zoomstart"
|
1563 | | "movestart"
|
1564 | | "zoom"
|
1565 | | "move"
|
1566 | | "zoomend"
|
1567 | | "moveend"
|
1568 | | "autopanstart"
|
1569 | | "dragstart"
|
1570 | | "drag"
|
1571 | | "add"
|
1572 | | "remove"
|
1573 | | "loading"
|
1574 | | "error"
|
1575 | | "update"
|
1576 | | "down"
|
1577 | | "predrag",
|
1578 | fn: LeafletEventHandlerFn,
|
1579 | context?: any,
|
1580 | ): this;
|
1581 | addOneTimeEventListener(type: "resize", fn: ResizeEventHandlerFn, context?: any): this;
|
1582 | addOneTimeEventListener(type: "popupopen" | "popupclose", fn: PopupEventHandlerFn, context?: any): this;
|
1583 | addOneTimeEventListener(type: "tooltipopen" | "tooltipclose", fn: TooltipEventHandlerFn, context?: any): this;
|
1584 | addOneTimeEventListener(type: "locationerror", fn: ErrorEventHandlerFn, context?: any): this;
|
1585 | addOneTimeEventListener(type: "locationfound", fn: LocationEventHandlerFn, context?: any): this;
|
1586 | addOneTimeEventListener(
|
1587 | type:
|
1588 | | "click"
|
1589 | | "dblclick"
|
1590 | | "mousedown"
|
1591 | | "mouseup"
|
1592 | | "mouseover"
|
1593 | | "mouseout"
|
1594 | | "mousemove"
|
1595 | | "contextmenu"
|
1596 | | "preclick",
|
1597 | fn: LeafletMouseEventHandlerFn,
|
1598 | context?: any,
|
1599 | ): this;
|
1600 | addOneTimeEventListener(
|
1601 | type: "keypress" | "keydown" | "keyup",
|
1602 | fn: LeafletKeyboardEventHandlerFn,
|
1603 | context?: any,
|
1604 | ): this;
|
1605 | addOneTimeEventListener(type: "zoomanim", fn: ZoomAnimEventHandlerFn, context?: any): this;
|
1606 | addOneTimeEventListener(type: "dragend", fn: DragEndEventHandlerFn, context?: any): this;
|
1607 | addOneTimeEventListener(
|
1608 | type: "tileunload" | "tileloadstart" | "tileload" | "tileabort",
|
1609 | fn: TileEventHandlerFn,
|
1610 | context?: any,
|
1611 | ): this;
|
1612 | addOneTimeEventListener(type: "tileerror", fn: TileErrorEventHandlerFn, context?: any): this;
|
1613 | addOneTimeEventListener(type: string, fn: LeafletEventHandlerFn, context?: any): this;
|
1614 |
|
1615 | |
1616 |
|
1617 |
|
1618 |
|
1619 |
|
1620 | addOneTimeEventListener(eventMap: LeafletEventHandlerFnMap): this;
|
1621 |
|
1622 |
|
1623 | |
1624 |
|
1625 |
|
1626 |
|
1627 |
|
1628 |
|
1629 |
|
1630 | fireEvent(type: string, data?: any, propagate?: boolean): this;
|
1631 |
|
1632 | |
1633 |
|
1634 |
|
1635 |
|
1636 |
|
1637 | hasEventListeners(type: string): boolean;
|
1638 | }
|
1639 |
|
1640 | export interface DraggableOptions {
|
1641 | |
1642 |
|
1643 |
|
1644 |
|
1645 | clickTolerance: number;
|
1646 | }
|
1647 |
|
1648 |
|
1649 |
|
1650 |
|
1651 |
|
1652 |
|
1653 | export class Draggable extends Evented {
|
1654 | constructor(
|
1655 | element: HTMLElement,
|
1656 | dragStartTarget?: HTMLElement,
|
1657 | preventOutline?: boolean,
|
1658 | options?: DraggableOptions,
|
1659 | );
|
1660 |
|
1661 | enable(): void;
|
1662 |
|
1663 | disable(): void;
|
1664 |
|
1665 | finishDrag(): void;
|
1666 | }
|
1667 |
|
1668 | export interface LayerOptions {
|
1669 | pane?: string | undefined;
|
1670 | attribution?: string | undefined;
|
1671 | }
|
1672 |
|
1673 | export interface InteractiveLayerOptions extends LayerOptions {
|
1674 | interactive?: boolean | undefined;
|
1675 | bubblingMouseEvents?: boolean | undefined;
|
1676 | }
|
1677 |
|
1678 | export class Layer extends Evented {
|
1679 | constructor(options?: LayerOptions);
|
1680 | addTo(map: Map | LayerGroup): this;
|
1681 | remove(): this;
|
1682 | removeFrom(map: Map): this;
|
1683 | getPane(name?: string): HTMLElement | undefined;
|
1684 |
|
1685 | addInteractiveTarget(targetEl: HTMLElement): this;
|
1686 | removeInteractiveTarget(targetEl: HTMLElement): this;
|
1687 |
|
1688 | // Popup methods
|
1689 | bindPopup(content: ((layer: Layer) => Content) | Content | Popup, options?: PopupOptions): this;
|
1690 | unbindPopup(): this;
|
1691 | openPopup(latlng?: LatLngExpression): this;
|
1692 | closePopup(): this;
|
1693 | togglePopup(): this;
|
1694 | isPopupOpen(): boolean;
|
1695 | setPopupContent(content: Content | Popup): this;
|
1696 | getPopup(): Popup | undefined;
|
1697 |
|
1698 | // Tooltip methods
|
1699 | bindTooltip(content: ((layer: Layer) => Content) | Tooltip | Content, options?: TooltipOptions): this;
|
1700 | unbindTooltip(): this;
|
1701 | openTooltip(latlng?: LatLngExpression): this;
|
1702 | closeTooltip(): this;
|
1703 | toggleTooltip(): this;
|
1704 | isTooltipOpen(): boolean;
|
1705 | setTooltipContent(content: Content | Tooltip): this;
|
1706 | getTooltip(): Tooltip | undefined;
|
1707 |
|
1708 | // Extension methods
|
1709 | onAdd(map: Map): this;
|
1710 | onRemove(map: Map): this;
|
1711 | getEvents?(): { [name: string]: LeafletEventHandlerFn };
|
1712 | getAttribution?(): string | null;
|
1713 | beforeAdd?(map: Map): this;
|
1714 |
|
1715 | protected _map: Map;
|
1716 |
|
1717 | options: LayerOptions;
|
1718 | }
|
1719 |
|
1720 | export interface GridLayerOptions extends LayerOptions {
|
1721 | tileSize?: number | Point | undefined;
|
1722 | opacity?: number | undefined;
|
1723 | updateWhenIdle?: boolean | undefined;
|
1724 | updateWhenZooming?: boolean | undefined;
|
1725 | updateInterval?: number | undefined;
|
1726 | zIndex?: number | undefined;
|
1727 | bounds?: LatLngBoundsExpression | undefined;
|
1728 | minZoom?: number | undefined;
|
1729 | maxZoom?: number | undefined;
|
1730 | |
1731 |
|
1732 |
|
1733 |
|
1734 | maxNativeZoom?: number | undefined;
|
1735 | |
1736 |
|
1737 |
|
1738 |
|
1739 | minNativeZoom?: number | undefined;
|
1740 | noWrap?: boolean | undefined;
|
1741 | pane?: string | undefined;
|
1742 | className?: string | undefined;
|
1743 | keepBuffer?: number | undefined;
|
1744 | }
|
1745 |
|
1746 | export type DoneCallback = (error?: Error, tile?: HTMLElement) => void;
|
1747 |
|
1748 | export interface InternalTiles {
|
1749 | [key: string]: {
|
1750 | active?: boolean | undefined;
|
1751 | coords: Coords;
|
1752 | current: boolean;
|
1753 | el: HTMLElement;
|
1754 | loaded?: Date | undefined;
|
1755 | retain?: boolean | undefined;
|
1756 | };
|
1757 | }
|
1758 |
|
1759 | export class GridLayer extends Layer {
|
1760 | constructor(options?: GridLayerOptions);
|
1761 | bringToFront(): this;
|
1762 | bringToBack(): this;
|
1763 | getContainer(): HTMLElement | null;
|
1764 | setOpacity(opacity: number): this;
|
1765 | setZIndex(zIndex: number): this;
|
1766 | isLoading(): boolean;
|
1767 | redraw(): this;
|
1768 | getTileSize(): Point;
|
1769 |
|
1770 | protected createTile(coords: Coords, done: DoneCallback): HTMLElement;
|
1771 | protected _tileCoordsToKey(coords: Coords): string;
|
1772 | protected _wrapCoords(parameter: Coords): Coords;
|
1773 |
|
1774 | protected _tiles: InternalTiles;
|
1775 | protected _tileZoom?: number | undefined;
|
1776 | }
|
1777 |
|
1778 | export function gridLayer(options?: GridLayerOptions): GridLayer;
|
1779 |
|
1780 | export interface TileLayerOptions extends GridLayerOptions {
|
1781 | id?: string | undefined;
|
1782 | accessToken?: string | undefined;
|
1783 | minZoom?: number | undefined;
|
1784 | maxZoom?: number | undefined;
|
1785 | maxNativeZoom?: number | undefined;
|
1786 | minNativeZoom?: number | undefined;
|
1787 | subdomains?: string | string[] | undefined;
|
1788 | errorTileUrl?: string | undefined;
|
1789 | zoomOffset?: number | undefined;
|
1790 | tms?: boolean | undefined;
|
1791 | zoomReverse?: boolean | undefined;
|
1792 | detectRetina?: boolean | undefined;
|
1793 | crossOrigin?: CrossOrigin | boolean | undefined;
|
1794 | referrerPolicy?: ReferrerPolicy | boolean | undefined;
|
1795 |
|
1796 |
|
1797 |
|
1798 |
|
1799 |
|
1800 | }
|
1801 |
|
1802 | export class TileLayer extends GridLayer {
|
1803 | constructor(urlTemplate: string, options?: TileLayerOptions);
|
1804 | setUrl(url: string, noRedraw?: boolean): this;
|
1805 | getTileUrl(coords: L.Coords): string;
|
1806 |
|
1807 | protected _tileOnLoad(done: L.DoneCallback, tile: HTMLElement): void;
|
1808 | protected _tileOnError(done: L.DoneCallback, tile: HTMLElement, e: Error): void;
|
1809 | protected _abortLoading(): void;
|
1810 | protected _getZoomForUrl(): number;
|
1811 |
|
1812 | options: TileLayerOptions;
|
1813 | }
|
1814 |
|
1815 | export function tileLayer(urlTemplate: string, options?: TileLayerOptions): TileLayer;
|
1816 |
|
1817 | export namespace TileLayer {
|
1818 | class WMS extends TileLayer {
|
1819 | constructor(baseUrl: string, options: WMSOptions);
|
1820 | setParams(params: WMSParams, noRedraw?: boolean): this;
|
1821 |
|
1822 | wmsParams: WMSParams;
|
1823 | options: WMSOptions;
|
1824 | }
|
1825 | }
|
1826 |
|
1827 | export interface WMSOptions extends TileLayerOptions {
|
1828 | layers?: string | undefined;
|
1829 | styles?: string | undefined;
|
1830 | format?: string | undefined;
|
1831 | transparent?: boolean | undefined;
|
1832 | version?: string | undefined;
|
1833 | crs?: CRS | undefined;
|
1834 | uppercase?: boolean | undefined;
|
1835 | }
|
1836 |
|
1837 | export interface WMSParams {
|
1838 | format?: string | undefined;
|
1839 | layers: string;
|
1840 | request?: string | undefined;
|
1841 | service?: string | undefined;
|
1842 | styles?: string | undefined;
|
1843 | version?: string | undefined;
|
1844 | transparent?: boolean | undefined;
|
1845 | width?: number | undefined;
|
1846 | height?: number | undefined;
|
1847 | }
|
1848 |
|
1849 | export namespace tileLayer {
|
1850 | function wms(baseUrl: string, options?: WMSOptions): TileLayer.WMS;
|
1851 | }
|
1852 |
|
1853 | export type CrossOrigin = "anonymous" | "use-credentials" | "";
|
1854 | export type ReferrerPolicy =
|
1855 | | "no-referrer"
|
1856 | | "no-referrer-when-downgrade"
|
1857 | | "origin"
|
1858 | | "origin-when-cross-origin"
|
1859 | | "same-origin"
|
1860 | | "strict-origin"
|
1861 | | "strict-origin-when-cross-origin"
|
1862 | | "unsafe-url";
|
1863 |
|
1864 | export interface ImageOverlayOptions extends InteractiveLayerOptions {
|
1865 | opacity?: number | undefined;
|
1866 | alt?: string | undefined;
|
1867 | interactive?: boolean | undefined;
|
1868 | crossOrigin?: CrossOrigin | boolean | undefined;
|
1869 | errorOverlayUrl?: string | undefined;
|
1870 | zIndex?: number | undefined;
|
1871 | className?: string | undefined;
|
1872 | }
|
1873 |
|
1874 | export interface ImageOverlayStyleOptions {
|
1875 | opacity?: number;
|
1876 | [name: string]: any;
|
1877 | }
|
1878 |
|
1879 | export class ImageOverlay extends Layer {
|
1880 | constructor(imageUrl: string, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions);
|
1881 | bringToFront(): this;
|
1882 | bringToBack(): this;
|
1883 | setUrl(url: string): this;
|
1884 |
|
1885 | /** Update the bounds that this ImageOverlay covers */
|
1886 | setBounds(bounds: LatLngBounds): this;
|
1887 |
|
1888 | /** Changes the zIndex of the image overlay */
|
1889 | setZIndex(value: number): this;
|
1890 |
|
1891 | /** Changes the opacity of the image element */
|
1892 | setOpacity(opacity: number): this;
|
1893 |
|
1894 | /** Changes the style of the image element. As of 1.8, only the opacity is changed */
|
1895 | setStyle(styleOpts: ImageOverlayStyleOptions): this;
|
1896 |
|
1897 | /** Get the bounds that this ImageOverlay covers */
|
1898 | getBounds(): LatLngBounds;
|
1899 |
|
1900 | /** Get the center of the bounds this ImageOverlay covers */
|
1901 | getCenter(): Point;
|
1902 |
|
1903 | /** Get the img element that represents the ImageOverlay on the map */
|
1904 | getElement(): HTMLImageElement | undefined;
|
1905 |
|
1906 | options: ImageOverlayOptions;
|
1907 | }
|
1908 |
|
1909 | export function imageOverlay(
|
1910 | imageUrl: string,
|
1911 | bounds: LatLngBoundsExpression,
|
1912 | options?: ImageOverlayOptions,
|
1913 | ): ImageOverlay;
|
1914 |
|
1915 | export type SVGOverlayStyleOptions = ImageOverlayStyleOptions;
|
1916 |
|
1917 | export class SVGOverlay extends Layer {
|
1918 |
|
1919 |
|
1920 | constructor(svgImage: string | SVGElement, bounds: LatLngBoundsExpression, options?: ImageOverlayOptions);
|
1921 | bringToFront(): this;
|
1922 | bringToBack(): this;
|
1923 | setUrl(url: string): this;
|
1924 |
|
1925 | /** Update the bounds that this SVGOverlay covers */
|
1926 | setBounds(bounds: LatLngBounds): this;
|
1927 |
|
1928 | /** Changes the zIndex of the image overlay */
|
1929 | setZIndex(value: number): this;
|
1930 |
|
1931 | /** Changes the opacity of the image element */
|
1932 | setOpacity(opacity: number): this;
|
1933 |
|
1934 | /** Changes the style of the image element. As of 1.8, only the opacity is changed */
|
1935 | setStyle(styleOpts: SVGOverlayStyleOptions): this;
|
1936 |
|
1937 | /** Get the bounds that this SVGOverlay covers */
|
1938 | getBounds(): LatLngBounds;
|
1939 |
|
1940 | /** Get the center of the bounds this ImageOverlay covers */
|
1941 | getCenter(): Point;
|
1942 |
|
1943 | /** Get the img element that represents the SVGOverlay on the map */
|
1944 | getElement(): SVGElement | undefined;
|
1945 |
|
1946 | options: ImageOverlayOptions;
|
1947 | }
|
1948 |
|
1949 | export function svgOverlay(
|
1950 | svgImage: string | SVGElement,
|
1951 | bounds: LatLngBoundsExpression,
|
1952 | options?: ImageOverlayOptions,
|
1953 | ): SVGOverlay;
|
1954 |
|
1955 | export interface VideoOverlayOptions extends ImageOverlayOptions {
|
1956 |
|
1957 | autoplay?: boolean | undefined;
|
1958 |
|
1959 | loop?: boolean | undefined;
|
1960 | |
1961 |
|
1962 |
|
1963 |
|
1964 | keepAspectRatio?: boolean | undefined;
|
1965 |
|
1966 | muted?: boolean | undefined;
|
1967 | playsInline?: boolean | undefined;
|
1968 | }
|
1969 |
|
1970 | export class VideoOverlay extends Layer {
|
1971 |
|
1972 | constructor(
|
1973 | video: string | string[] | HTMLVideoElement,
|
1974 | bounds: LatLngBoundsExpression,
|
1975 | options?: VideoOverlayOptions,
|
1976 | );
|
1977 | bringToFront(): this;
|
1978 | bringToBack(): this;
|
1979 | setUrl(url: string): this;
|
1980 |
|
1981 | /** Update the bounds that this VideoOverlay covers */
|
1982 | setBounds(bounds: LatLngBounds): this;
|
1983 |
|
1984 | /** Changes the zIndex of the image overlay */
|
1985 | setZIndex(value: number): this;
|
1986 |
|
1987 | /** Changes the opacity of the image element */
|
1988 | setOpacity(opacity: number): this;
|
1989 |
|
1990 | /** Changes the style of the image element. As of 1.8, only the opacity is changed */
|
1991 | setStyle(styleOpts: SVGOverlayStyleOptions): this;
|
1992 |
|
1993 | /** Get the bounds that this VideoOverlay covers */
|
1994 | getBounds(): LatLngBounds;
|
1995 |
|
1996 | /** Get the center of the bounds this ImageOverlay covers */
|
1997 | getCenter(): Point;
|
1998 |
|
1999 | /** Get the video element that represents the VideoOverlay on the map */
|
2000 | getElement(): HTMLVideoElement | undefined;
|
2001 |
|
2002 | options: VideoOverlayOptions;
|
2003 | }
|
2004 |
|
2005 | export function videoOverlay(
|
2006 | video: string | string[] | HTMLVideoElement,
|
2007 | bounds: LatLngBoundsExpression,
|
2008 | options?: VideoOverlayOptions,
|
2009 | ): VideoOverlay;
|
2010 |
|
2011 | export type LineCapShape = "butt" | "round" | "square" | "inherit";
|
2012 |
|
2013 | export type LineJoinShape = "miter" | "round" | "bevel" | "inherit";
|
2014 |
|
2015 | export type FillRule = "nonzero" | "evenodd" | "inherit";
|
2016 |
|
2017 | export interface PathOptions extends InteractiveLayerOptions {
|
2018 | stroke?: boolean | undefined;
|
2019 | color?: string | undefined;
|
2020 | weight?: number | undefined;
|
2021 | opacity?: number | undefined;
|
2022 | lineCap?: LineCapShape | undefined;
|
2023 | lineJoin?: LineJoinShape | undefined;
|
2024 | dashArray?: string | number[] | undefined;
|
2025 | dashOffset?: string | undefined;
|
2026 | fill?: boolean | undefined;
|
2027 | fillColor?: string | undefined;
|
2028 | fillOpacity?: number | undefined;
|
2029 | fillRule?: FillRule | undefined;
|
2030 | renderer?: Renderer | undefined;
|
2031 | className?: string | undefined;
|
2032 | }
|
2033 |
|
2034 | export abstract class Path extends Layer {
|
2035 | redraw(): this;
|
2036 | setStyle(style: PathOptions): this;
|
2037 | bringToFront(): this;
|
2038 | bringToBack(): this;
|
2039 | getElement(): Element | undefined;
|
2040 |
|
2041 | options: PathOptions;
|
2042 | }
|
2043 |
|
2044 | export interface PolylineOptions extends PathOptions {
|
2045 | smoothFactor?: number | undefined;
|
2046 | noClip?: boolean | undefined;
|
2047 | }
|
2048 |
|
2049 | export class Polyline<T extends geojson.GeometryObject = geojson.LineString | geojson.MultiLineString, P = any>
|
2050 | extends Path
|
2051 | {
|
2052 | constructor(latlngs: LatLngExpression[] | LatLngExpression[][], options?: PolylineOptions);
|
2053 | toGeoJSON(precision?: number | false): geojson.Feature<T, P>;
|
2054 | getLatLngs(): LatLng[] | LatLng[][] | LatLng[][][];
|
2055 | setLatLngs(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][]): this;
|
2056 | isEmpty(): boolean;
|
2057 | getCenter(): LatLng;
|
2058 | getBounds(): LatLngBounds;
|
2059 | addLatLng(latlng: LatLngExpression | LatLngExpression[], latlngs?: LatLng[]): this;
|
2060 | closestLayerPoint(p: Point): Point;
|
2061 |
|
2062 | feature?: geojson.Feature<T, P> | undefined;
|
2063 | options: PolylineOptions;
|
2064 | }
|
2065 |
|
2066 | export function polyline<T extends geojson.GeometryObject = geojson.LineString | geojson.MultiLineString, P = any>(
|
2067 | latlngs: LatLngExpression[] | LatLngExpression[][],
|
2068 | options?: PolylineOptions,
|
2069 | ): Polyline<T, P>;
|
2070 |
|
2071 | export class Polygon<P = any> extends Polyline<geojson.Polygon | geojson.MultiPolygon, P> {
|
2072 | constructor(latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][], options?: PolylineOptions);
|
2073 | }
|
2074 |
|
2075 | export function polygon<P = any>(
|
2076 | latlngs: LatLngExpression[] | LatLngExpression[][] | LatLngExpression[][][],
|
2077 | options?: PolylineOptions,
|
2078 | ): Polygon<P>;
|
2079 |
|
2080 | export class Rectangle<P = any> extends Polygon<P> {
|
2081 | constructor(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions);
|
2082 | setBounds(latLngBounds: LatLngBoundsExpression): this;
|
2083 | }
|
2084 |
|
2085 | export function rectangle<P = any>(latLngBounds: LatLngBoundsExpression, options?: PolylineOptions): Rectangle<P>;
|
2086 |
|
2087 | export interface CircleMarkerOptions extends PathOptions {
|
2088 | radius: number;
|
2089 | }
|
2090 |
|
2091 | export class CircleMarker<P = any> extends Path {
|
2092 | constructor(latlng: LatLngExpression, options: CircleMarkerOptions);
|
2093 | toGeoJSON(precision?: number | false): geojson.Feature<geojson.Point, P>;
|
2094 | setLatLng(latLng: LatLngExpression): this;
|
2095 | getLatLng(): LatLng;
|
2096 | setRadius(radius: number): this;
|
2097 | getRadius(): number;
|
2098 | setStyle(options: Partial<CircleMarkerOptions>): this;
|
2099 |
|
2100 | options: CircleMarkerOptions;
|
2101 | feature?: geojson.Feature<geojson.Point, P> | undefined;
|
2102 | }
|
2103 |
|
2104 | export function circleMarker<P = any>(latlng: LatLngExpression, options?: CircleMarkerOptions): CircleMarker<P>;
|
2105 |
|
2106 | export type CircleOptions = CircleMarkerOptions;
|
2107 |
|
2108 | export class Circle<P = any> extends CircleMarker<P> {
|
2109 | constructor(latlng: LatLngExpression, options: CircleOptions);
|
2110 | constructor(latlng: LatLngExpression, radius: number, options?: CircleOptions); // deprecated!
|
2111 | toGeoJSON(precision?: number | false): any;
|
2112 | getBounds(): LatLngBounds;
|
2113 | setRadius(radius: number): this;
|
2114 | getRadius(): number;
|
2115 | setStyle(style: PathOptions): this;
|
2116 | }
|
2117 |
|
2118 | export function circle<P = any>(latlng: LatLngExpression, options: CircleMarkerOptions): Circle<P>;
|
2119 | /**
|
2120 | * @deprecated Passing the radius outside the options is deperecated. Use {@link circle:1} instead.
|
2121 | */
|
2122 | export function circle<P = any>(latlng: LatLngExpression, radius: number, options?: CircleMarkerOptions): Circle<P>;
|
2123 |
|
2124 | export interface RendererOptions extends LayerOptions {
|
2125 | padding?: number | undefined;
|
2126 | tolerance?: number | undefined;
|
2127 | }
|
2128 |
|
2129 | export class Renderer extends Layer {
|
2130 | constructor(options?: RendererOptions);
|
2131 |
|
2132 | options: RendererOptions;
|
2133 | }
|
2134 |
|
2135 | export class SVG extends Renderer {}
|
2136 |
|
2137 | export namespace SVG {
|
2138 | function create<K extends keyof SVGElementTagNameMap>(name: K): SVGElementTagNameMap[K];
|
2139 | function create(name: string): SVGElement;
|
2140 |
|
2141 | function pointsToPath(rings: PointExpression[], closed: boolean): string;
|
2142 | }
|
2143 |
|
2144 | export function svg(options?: RendererOptions): SVG;
|
2145 |
|
2146 | export class Canvas extends Renderer {}
|
2147 |
|
2148 | export function canvas(options?: RendererOptions): Canvas;
|
2149 |
|
2150 |
|
2151 |
|
2152 |
|
2153 |
|
2154 |
|
2155 | export class LayerGroup<P = any> extends Layer {
|
2156 | constructor(layers?: Layer[], options?: LayerOptions);
|
2157 |
|
2158 | toMultiPoint(precision?: number): geojson.Feature<geojson.MultiPoint, P>;
|
2159 |
|
2160 | /**
|
2161 | * Returns a GeoJSON representation of the layer group (as a GeoJSON GeometryCollection, GeoJSONFeatureCollection or Multipoint).
|
2162 | */
|
2163 | toGeoJSON(
|
2164 | precision?: number | false,
|
2165 | ):
|
2166 | | geojson.FeatureCollection<geojson.GeometryObject, P>
|
2167 | | geojson.Feature<geojson.MultiPoint, P>
|
2168 | | geojson.GeometryCollection;
|
2169 |
|
2170 | /**
|
2171 | * Adds the given layer to the group.
|
2172 | */
|
2173 | addLayer(layer: Layer): this;
|
2174 |
|
2175 | /**
|
2176 | * Removes the layer with the given internal ID or the given layer from the group.
|
2177 | */
|
2178 | removeLayer(layer: number | Layer): this;
|
2179 |
|
2180 | /**
|
2181 | * Returns true if the given layer is currently added to the group.
|
2182 | */
|
2183 | hasLayer(layer: Layer): boolean;
|
2184 |
|
2185 | /**
|
2186 | * Removes all the layers from the group.
|
2187 | */
|
2188 | clearLayers(): this;
|
2189 |
|
2190 | /**
|
2191 | * Calls methodName on every layer contained in this group, passing any additional parameters.
|
2192 | * Has no effect if the layers contained do not implement methodName.
|
2193 | */
|
2194 | invoke(methodName: string, ...params: any[]): this;
|
2195 |
|
2196 | /**
|
2197 | * Iterates over the layers of the group,
|
2198 | * optionally specifying context of the iterator function.
|
2199 | */
|
2200 | eachLayer(fn: (layer: Layer) => void, context?: any): this;
|
2201 |
|
2202 | /**
|
2203 | * Returns the layer with the given internal ID.
|
2204 | */
|
2205 | getLayer(id: number): Layer | undefined;
|
2206 |
|
2207 | /**
|
2208 | * Returns an array of all the layers added to the group.
|
2209 | */
|
2210 | getLayers(): Layer[];
|
2211 |
|
2212 | /**
|
2213 | * Calls setZIndex on every layer contained in this group, passing the z-index.
|
2214 | */
|
2215 | setZIndex(zIndex: number): this;
|
2216 |
|
2217 | /**
|
2218 | * Returns the internal ID for a layer
|
2219 | */
|
2220 | getLayerId(layer: Layer): number;
|
2221 |
|
2222 | feature?:
|
2223 | | geojson.FeatureCollection<geojson.GeometryObject, P>
|
2224 | | geojson.Feature<geojson.MultiPoint, P>
|
2225 | | geojson.GeometryCollection
|
2226 | | undefined;
|
2227 | }
|
2228 |
|
2229 | /**
|
2230 | * Create a layer group, optionally given an initial set of layers and an `options` object.
|
2231 | */
|
2232 | export function layerGroup<P = any>(layers?: Layer[], options?: LayerOptions): LayerGroup<P>;
|
2233 |
|
2234 | /**
|
2235 | * Extended LayerGroup that also has mouse events (propagated from
|
2236 | * members of the group) and a shared bindPopup method.
|
2237 | */
|
2238 | export class FeatureGroup<P = any> extends LayerGroup<P> {
|
2239 | |
2240 |
|
2241 |
|
2242 | addLayer(layer: Layer): this;
|
2243 |
|
2244 | |
2245 |
|
2246 |
|
2247 | removeLayer(layer: number | Layer): this;
|
2248 |
|
2249 | |
2250 |
|
2251 |
|
2252 | setStyle(style: PathOptions): this;
|
2253 |
|
2254 | |
2255 |
|
2256 |
|
2257 | bringToFront(): this;
|
2258 |
|
2259 | |
2260 |
|
2261 |
|
2262 | bringToBack(): this;
|
2263 |
|
2264 | |
2265 |
|
2266 |
|
2267 |
|
2268 | getBounds(): LatLngBounds;
|
2269 | }
|
2270 |
|
2271 |
|
2272 |
|
2273 |
|
2274 | export function featureGroup<P = any>(layers?: Layer[], options?: LayerOptions): FeatureGroup<P>;
|
2275 |
|
2276 | export type StyleFunction<P = any> = (feature?: geojson.Feature<geojson.GeometryObject, P>) => PathOptions;
|
2277 |
|
2278 | export interface GeoJSONOptions<P = any, G extends geojson.GeometryObject = geojson.GeometryObject>
|
2279 | extends InteractiveLayerOptions
|
2280 | {
|
2281 | |
2282 |
|
2283 |
|
2284 |
|
2285 |
|
2286 |
|
2287 |
|
2288 |
|
2289 |
|
2290 |
|
2291 |
|
2292 |
|
2293 |
|
2294 | pointToLayer?(geoJsonPoint: geojson.Feature<geojson.Point, P>, latlng: LatLng): Layer;
|
2295 |
|
2296 | |
2297 |
|
2298 |
|
2299 |
|
2300 |
|
2301 |
|
2302 |
|
2303 |
|
2304 |
|
2305 |
|
2306 |
|
2307 |
|
2308 | style?: PathOptions | StyleFunction<P> | undefined;
|
2309 |
|
2310 | |
2311 |
|
2312 |
|
2313 |
|
2314 |
|
2315 |
|
2316 |
|
2317 |
|
2318 |
|
2319 |
|
2320 | onEachFeature?(feature: geojson.Feature<G, P>, layer: Layer): void;
|
2321 |
|
2322 | |
2323 |
|
2324 |
|
2325 |
|
2326 |
|
2327 |
|
2328 |
|
2329 |
|
2330 |
|
2331 |
|
2332 |
|
2333 | filter?(geoJsonFeature: geojson.Feature<G, P>): boolean;
|
2334 |
|
2335 | |
2336 |
|
2337 |
|
2338 |
|
2339 | coordsToLatLng?(coords: [number, number] | [number, number, number]): LatLng;
|
2340 |
|
2341 |
|
2342 | markersInheritOptions?: boolean | undefined;
|
2343 | }
|
2344 |
|
2345 |
|
2346 |
|
2347 |
|
2348 |
|
2349 | export class GeoJSON<P = any, G extends geojson.GeometryObject = geojson.GeometryObject> extends FeatureGroup<P> {
|
2350 | |
2351 |
|
2352 |
|
2353 | static getFeature<P = any, G extends geojson.GeometryObject = geojson.GeometryObject>(
|
2354 | layer: Layer,
|
2355 | newGeometry: geojson.Feature<G, P> | G,
|
2356 | ): geojson.Feature<G, P>;
|
2357 |
|
2358 | |
2359 |
|
2360 |
|
2361 |
|
2362 | static geometryToLayer<P = any, G extends geojson.GeometryObject = geojson.GeometryObject>(
|
2363 | featureData: geojson.Feature<G, P>,
|
2364 | options?: GeoJSONOptions<P, G>,
|
2365 | ): Layer;
|
2366 |
|
2367 | |
2368 |
|
2369 |
|
2370 |
|
2371 | static coordsToLatLng(coords: [number, number] | [number, number, number]): LatLng;
|
2372 |
|
2373 | |
2374 |
|
2375 |
|
2376 |
|
2377 |
|
2378 |
|
2379 | static coordsToLatLngs(
|
2380 | coords: any[],
|
2381 | levelsDeep?: number,
|
2382 | coordsToLatLng?: (coords: [number, number] | [number, number, number]) => LatLng,
|
2383 | ): any[];
|
2384 |
|
2385 | |
2386 |
|
2387 |
|
2388 | static latLngToCoords(latlng: LatLng): [number, number] | [number, number, number];
|
2389 |
|
2390 | |
2391 |
|
2392 |
|
2393 |
|
2394 |
|
2395 | static latLngsToCoords(latlngs: any[], levelsDeep?: number, closed?: boolean): any[];
|
2396 |
|
2397 | |
2398 |
|
2399 |
|
2400 | static asFeature<P = any, G extends geojson.GeometryObject = geojson.GeometryObject>(
|
2401 | geojson: geojson.Feature<G, P> | G,
|
2402 | ): geojson.Feature<G, P>;
|
2403 |
|
2404 | constructor(geojson?: geojson.GeoJsonObject | null, options?: GeoJSONOptions<P, G> | null);
|
2405 | /**
|
2406 | * Adds a GeoJSON object to the layer.
|
2407 | */
|
2408 | addData(data: geojson.GeoJsonObject): this;
|
2409 |
|
2410 | /**
|
2411 | * Resets the given vector layer's style to the original GeoJSON style,
|
2412 | * useful for resetting style after hover events.
|
2413 | */
|
2414 | resetStyle(layer?: Layer): this;
|
2415 |
|
2416 | /**
|
2417 | * Same as FeatureGroup's setStyle method, but style-functions are also
|
2418 | * allowed here to set the style according to the feature.
|
2419 | */
|
2420 | setStyle(style: PathOptions | StyleFunction<P>): this;
|
2421 |
|
2422 | options: GeoJSONOptions<P, G>;
|
2423 | }
|
2424 |
|
2425 | /**
|
2426 | * Creates a GeoJSON layer.
|
2427 | *
|
2428 | * Optionally accepts an object in GeoJSON format to display on the
|
2429 | * map (you can alternatively add it later with addData method) and
|
2430 | * an options object.
|
2431 | */
|
2432 | export function geoJSON<P = any, G extends geojson.GeometryObject = geojson.GeometryObject>(
|
2433 | geojson?: geojson.GeoJsonObject | geojson.GeoJsonObject[] | null,
|
2434 | options?: GeoJSONOptions<P, G> | null,
|
2435 | ): GeoJSON<P, G>;
|
2436 | export function geoJson<P = any, G extends geojson.GeometryObject = geojson.GeometryObject>(
|
2437 | geojson?: geojson.GeoJsonObject | geojson.GeoJsonObject[] | null,
|
2438 | options?: GeoJSONOptions<P, G> | null,
|
2439 | ): GeoJSON<P, G>;
|
2440 |
|
2441 | export type Zoom = boolean | "center";
|
2442 |
|
2443 | export interface MapOptions {
|
2444 | preferCanvas?: boolean | undefined;
|
2445 |
|
2446 |
|
2447 | attributionControl?: boolean | undefined;
|
2448 | zoomControl?: boolean | undefined;
|
2449 |
|
2450 |
|
2451 | closePopupOnClick?: boolean | undefined;
|
2452 | zoomSnap?: number | undefined;
|
2453 | zoomDelta?: number | undefined;
|
2454 | trackResize?: boolean | undefined;
|
2455 | boxZoom?: boolean | undefined;
|
2456 | doubleClickZoom?: Zoom | undefined;
|
2457 | dragging?: boolean | undefined;
|
2458 |
|
2459 |
|
2460 | crs?: CRS | undefined;
|
2461 | center?: LatLngExpression | undefined;
|
2462 | zoom?: number | undefined;
|
2463 | minZoom?: number | undefined;
|
2464 | maxZoom?: number | undefined;
|
2465 | layers?: Layer[] | undefined;
|
2466 | maxBounds?: LatLngBoundsExpression | undefined;
|
2467 | renderer?: Renderer | undefined;
|
2468 |
|
2469 |
|
2470 | fadeAnimation?: boolean | undefined;
|
2471 | markerZoomAnimation?: boolean | undefined;
|
2472 | transform3DLimit?: number | undefined;
|
2473 | zoomAnimation?: boolean | undefined;
|
2474 | zoomAnimationThreshold?: number | undefined;
|
2475 |
|
2476 |
|
2477 | inertia?: boolean | undefined;
|
2478 | inertiaDeceleration?: number | undefined;
|
2479 | inertiaMaxSpeed?: number | undefined;
|
2480 | easeLinearity?: number | undefined;
|
2481 | worldCopyJump?: boolean | undefined;
|
2482 | maxBoundsViscosity?: number | undefined;
|
2483 |
|
2484 |
|
2485 | keyboard?: boolean | undefined;
|
2486 | keyboardPanDelta?: number | undefined;
|
2487 |
|
2488 |
|
2489 | scrollWheelZoom?: Zoom | undefined;
|
2490 | wheelDebounceTime?: number | undefined;
|
2491 | wheelPxPerZoomLevel?: number | undefined;
|
2492 |
|
2493 |
|
2494 | tapHold?: boolean | undefined;
|
2495 | tapTolerance?: number | undefined;
|
2496 | touchZoom?: Zoom | undefined;
|
2497 | bounceAtZoomLimits?: boolean | undefined;
|
2498 | }
|
2499 |
|
2500 | export type ControlPosition = "topleft" | "topright" | "bottomleft" | "bottomright";
|
2501 |
|
2502 | export interface ControlOptions {
|
2503 | position?: ControlPosition | undefined;
|
2504 | }
|
2505 |
|
2506 | export class Control<Options extends ControlOptions = ControlOptions> extends Class {
|
2507 | static extend<T extends object, Options extends ControlOptions = ControlOptions>(
|
2508 | props: T,
|
2509 | ): { new(...args: any[]): T } & typeof Control<Options>;
|
2510 | constructor(options?: Options);
|
2511 | getPosition(): ControlPosition;
|
2512 | setPosition(position: ControlPosition): this;
|
2513 | getContainer(): HTMLElement | undefined;
|
2514 | addTo(map: Map): this;
|
2515 | remove(): this;
|
2516 |
|
2517 | // Extension methods
|
2518 | onAdd?(map: Map): HTMLElement;
|
2519 | onRemove?(map: Map): void;
|
2520 |
|
2521 | options: Options;
|
2522 | }
|
2523 |
|
2524 | export namespace Control {
|
2525 | interface ZoomOptions extends ControlOptions {
|
2526 | zoomInText?: string | undefined;
|
2527 | zoomInTitle?: string | undefined;
|
2528 | zoomOutText?: string | undefined;
|
2529 | zoomOutTitle?: string | undefined;
|
2530 | }
|
2531 |
|
2532 | class Zoom extends Control {
|
2533 | constructor(options?: ZoomOptions);
|
2534 | options: ZoomOptions;
|
2535 | }
|
2536 |
|
2537 | interface AttributionOptions extends ControlOptions {
|
2538 | prefix?: string | boolean | undefined;
|
2539 | }
|
2540 |
|
2541 | class Attribution extends Control {
|
2542 | constructor(options?: AttributionOptions);
|
2543 | setPrefix(prefix: string | false): this;
|
2544 | addAttribution(text: string): this;
|
2545 | removeAttribution(text: string): this;
|
2546 | options: AttributionOptions;
|
2547 | }
|
2548 |
|
2549 | interface LayersOptions extends ControlOptions {
|
2550 | collapsed?: boolean | undefined;
|
2551 | autoZIndex?: boolean | undefined;
|
2552 | hideSingleBase?: boolean | undefined;
|
2553 | |
2554 |
|
2555 |
|
2556 | sortLayers?: boolean | undefined;
|
2557 | |
2558 |
|
2559 |
|
2560 |
|
2561 |
|
2562 |
|
2563 | sortFunction?: ((layerA: Layer, layerB: Layer, nameA: string, nameB: string) => number) | undefined;
|
2564 | }
|
2565 |
|
2566 | interface LayersObject {
|
2567 | [name: string]: Layer;
|
2568 | }
|
2569 |
|
2570 | class Layers extends Control {
|
2571 | constructor(baseLayers?: LayersObject, overlays?: LayersObject, options?: LayersOptions);
|
2572 | addBaseLayer(layer: Layer, name: string): this;
|
2573 | addOverlay(layer: Layer, name: string): this;
|
2574 | removeLayer(layer: Layer): this;
|
2575 | expand(): this;
|
2576 | collapse(): this;
|
2577 | options: LayersOptions;
|
2578 | }
|
2579 |
|
2580 | interface ScaleOptions extends ControlOptions {
|
2581 | maxWidth?: number | undefined;
|
2582 | metric?: boolean | undefined;
|
2583 | imperial?: boolean | undefined;
|
2584 | updateWhenIdle?: boolean | undefined;
|
2585 | }
|
2586 |
|
2587 | class Scale extends Control {
|
2588 | constructor(options?: ScaleOptions);
|
2589 | options: ScaleOptions;
|
2590 | }
|
2591 | }
|
2592 |
|
2593 | export namespace control {
|
2594 | function zoom(options?: Control.ZoomOptions): Control.Zoom;
|
2595 |
|
2596 | function attribution(options?: Control.AttributionOptions): Control.Attribution;
|
2597 |
|
2598 | function layers(
|
2599 | baseLayers?: Control.LayersObject,
|
2600 | overlays?: Control.LayersObject,
|
2601 | options?: Control.LayersOptions,
|
2602 | ): Control.Layers;
|
2603 |
|
2604 | function scale(options?: Control.ScaleOptions): Control.Scale;
|
2605 | }
|
2606 |
|
2607 | export interface DivOverlayOptions {
|
2608 | offset?: PointExpression | undefined;
|
2609 | className?: string | undefined;
|
2610 | pane?: string | undefined;
|
2611 | interactive?: boolean | undefined;
|
2612 | content?: string | HTMLElement | ((layer: Layer) => string) | ((layer: Layer) => HTMLElement);
|
2613 | }
|
2614 |
|
2615 | export abstract class DivOverlay extends Layer {
|
2616 | constructor(latlng: LatLngExpression, options?: TooltipOptions);
|
2617 | constructor(options?: DivOverlayOptions, source?: Layer);
|
2618 | getLatLng(): LatLng | undefined;
|
2619 | setLatLng(latlng: LatLngExpression): this;
|
2620 | getContent(): Content | ((source: Layer) => Content) | undefined;
|
2621 | setContent(htmlContent: ((source: Layer) => Content) | Content): this;
|
2622 | getElement(): HTMLElement | undefined;
|
2623 | update(): void;
|
2624 | isOpen(): boolean;
|
2625 | bringToFront(): this;
|
2626 | bringToBack(): this;
|
2627 | openOn(map: Map): this;
|
2628 | toggle(layer?: Layer): this;
|
2629 | close(): this;
|
2630 |
|
2631 | options: DivOverlayOptions;
|
2632 | }
|
2633 |
|
2634 | export interface PopupOptions extends DivOverlayOptions {
|
2635 | maxWidth?: number | undefined;
|
2636 | minWidth?: number | undefined;
|
2637 | maxHeight?: number | undefined;
|
2638 | keepInView?: boolean | undefined;
|
2639 | closeButton?: boolean | undefined;
|
2640 | autoPan?: boolean | undefined;
|
2641 | autoPanPaddingTopLeft?: PointExpression | undefined;
|
2642 | autoPanPaddingBottomRight?: PointExpression | undefined;
|
2643 | autoPanPadding?: PointExpression | undefined;
|
2644 | autoClose?: boolean | undefined;
|
2645 | closeOnClick?: boolean | undefined;
|
2646 | closeOnEscapeKey?: boolean | undefined;
|
2647 | }
|
2648 |
|
2649 | export type Content = string | HTMLElement;
|
2650 |
|
2651 | export class Popup extends DivOverlay {
|
2652 | constructor(latlng: LatLngExpression, options?: TooltipOptions);
|
2653 | constructor(options?: PopupOptions, source?: Layer);
|
2654 | openOn(map: Map): this;
|
2655 |
|
2656 | options: PopupOptions;
|
2657 | }
|
2658 |
|
2659 | export function popup(options?: PopupOptions, source?: Layer): Popup;
|
2660 |
|
2661 | export type Direction = "right" | "left" | "top" | "bottom" | "center" | "auto";
|
2662 |
|
2663 | export interface TooltipOptions extends DivOverlayOptions {
|
2664 | pane?: string | undefined;
|
2665 | offset?: PointExpression | undefined;
|
2666 | direction?: Direction | undefined;
|
2667 | permanent?: boolean | undefined;
|
2668 | sticky?: boolean | undefined;
|
2669 | opacity?: number | undefined;
|
2670 | }
|
2671 |
|
2672 | export class Tooltip extends DivOverlay {
|
2673 | constructor(latlng: LatLngExpression, options?: TooltipOptions);
|
2674 | constructor(options?: TooltipOptions, source?: Layer);
|
2675 | setOpacity(val: number): void;
|
2676 |
|
2677 | options: TooltipOptions;
|
2678 | }
|
2679 |
|
2680 | export function tooltip(options?: TooltipOptions, source?: Layer): Tooltip;
|
2681 |
|
2682 | export interface ZoomOptions {
|
2683 | animate?: boolean | undefined;
|
2684 | }
|
2685 |
|
2686 | export interface PanOptions {
|
2687 | animate?: boolean | undefined;
|
2688 | duration?: number | undefined;
|
2689 | easeLinearity?: number | undefined;
|
2690 | noMoveStart?: boolean | undefined;
|
2691 | }
|
2692 |
|
2693 | // This is not empty, it extends two interfaces into one...
|
2694 | export interface ZoomPanOptions extends ZoomOptions, PanOptions {}
|
2695 |
|
2696 | export interface InvalidateSizeOptions extends ZoomPanOptions {
|
2697 | debounceMoveend?: boolean | undefined;
|
2698 | pan?: boolean | undefined;
|
2699 | }
|
2700 |
|
2701 | export interface FitBoundsOptions extends ZoomOptions, PanOptions {
|
2702 | paddingTopLeft?: PointExpression | undefined;
|
2703 | paddingBottomRight?: PointExpression | undefined;
|
2704 | padding?: PointExpression | undefined;
|
2705 | maxZoom?: number | undefined;
|
2706 | }
|
2707 |
|
2708 | export interface PanInsideOptions extends PanOptions {
|
2709 | paddingTopLeft?: PointExpression | undefined;
|
2710 | paddingBottomRight?: PointExpression | undefined;
|
2711 | padding?: PointExpression | undefined;
|
2712 | }
|
2713 |
|
2714 | export interface LocateOptions {
|
2715 | watch?: boolean | undefined;
|
2716 | setView?: boolean | undefined;
|
2717 | maxZoom?: number | undefined;
|
2718 | timeout?: number | undefined;
|
2719 | maximumAge?: number | undefined;
|
2720 | enableHighAccuracy?: boolean | undefined;
|
2721 | }
|
2722 |
|
2723 | export class Handler extends Class {
|
2724 | constructor(map: Map);
|
2725 | enable(): this;
|
2726 | disable(): this;
|
2727 | enabled(): boolean;
|
2728 |
|
2729 | // Extension methods
|
2730 | addHooks?(): void;
|
2731 | removeHooks?(): void;
|
2732 | }
|
2733 |
|
2734 | export interface LeafletEvent {
|
2735 | type: string;
|
2736 | popup: any;
|
2737 | target: any;
|
2738 | sourceTarget: any;
|
2739 | propagatedFrom: any;
|
2740 | /**
|
2741 | * @deprecated The same as {@link LeafletEvent.propagatedFrom propagatedFrom}.
|
2742 | */
|
2743 | layer: any;
|
2744 | }
|
2745 |
|
2746 | export interface LeafletMouseEvent extends LeafletEvent {
|
2747 | latlng: LatLng;
|
2748 | layerPoint: Point;
|
2749 | containerPoint: Point;
|
2750 | originalEvent: MouseEvent;
|
2751 | }
|
2752 |
|
2753 | export interface LeafletKeyboardEvent extends LeafletEvent {
|
2754 | originalEvent: KeyboardEvent;
|
2755 | }
|
2756 |
|
2757 | export interface LocationEvent extends LeafletEvent {
|
2758 | latlng: LatLng;
|
2759 | bounds: LatLngBounds;
|
2760 | accuracy: number;
|
2761 | altitude: number;
|
2762 | altitudeAccuracy: number;
|
2763 | heading: number;
|
2764 | speed: number;
|
2765 | timestamp: number;
|
2766 | }
|
2767 |
|
2768 | export interface ErrorEvent extends LeafletEvent {
|
2769 | message: string;
|
2770 | code: number;
|
2771 | }
|
2772 |
|
2773 | export interface LayerEvent extends LeafletEvent {
|
2774 | layer: Layer;
|
2775 | }
|
2776 |
|
2777 | export interface LayersControlEvent extends LayerEvent {
|
2778 | name: string;
|
2779 | }
|
2780 |
|
2781 | export interface TileEvent extends LeafletEvent {
|
2782 | tile: HTMLImageElement;
|
2783 | coords: Coords;
|
2784 | }
|
2785 |
|
2786 | export interface TileErrorEvent extends TileEvent {
|
2787 | error: Error;
|
2788 | }
|
2789 |
|
2790 | export interface ResizeEvent extends LeafletEvent {
|
2791 | oldSize: Point;
|
2792 | newSize: Point;
|
2793 | }
|
2794 |
|
2795 | export interface GeoJSONEvent extends LeafletEvent {
|
2796 | layer: Layer;
|
2797 | properties: any;
|
2798 | geometryType: string;
|
2799 | id: string;
|
2800 | }
|
2801 |
|
2802 | export interface PopupEvent extends LeafletEvent {
|
2803 | popup: Popup;
|
2804 | }
|
2805 |
|
2806 | export interface TooltipEvent extends LeafletEvent {
|
2807 | tooltip: Tooltip;
|
2808 | }
|
2809 |
|
2810 | export interface DragEndEvent extends LeafletEvent {
|
2811 | distance: number;
|
2812 | }
|
2813 |
|
2814 | export interface ZoomAnimEvent extends LeafletEvent {
|
2815 | center: LatLng;
|
2816 | zoom: number;
|
2817 | noUpdate: boolean;
|
2818 | }
|
2819 |
|
2820 | export namespace DomEvent {
|
2821 | type EventHandlerFn = (event: Event) => void;
|
2822 |
|
2823 | type PropagableEvent = LeafletMouseEvent | LeafletKeyboardEvent | LeafletEvent | Event;
|
2824 |
|
2825 | function on(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
|
2826 |
|
2827 | function on(el: HTMLElement, eventMap: { [eventName: string]: EventHandlerFn }, context?: any): typeof DomEvent;
|
2828 |
|
2829 |
|
2830 | function off(el: HTMLElement): typeof DomEvent;
|
2831 |
|
2832 | function off(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
|
2833 |
|
2834 | function off(el: HTMLElement, eventMap: { [eventName: string]: EventHandlerFn }, context?: any): typeof DomEvent;
|
2835 |
|
2836 |
|
2837 | function stopPropagation(ev: PropagableEvent): typeof DomEvent;
|
2838 |
|
2839 | function disableScrollPropagation(el: HTMLElement): typeof DomEvent;
|
2840 |
|
2841 | function disableClickPropagation(el: HTMLElement): typeof DomEvent;
|
2842 |
|
2843 | function preventDefault(ev: Event): typeof DomEvent;
|
2844 |
|
2845 | function stop(ev: PropagableEvent): typeof DomEvent;
|
2846 |
|
2847 | function getMousePosition(ev: MouseEvent, container?: HTMLElement): Point;
|
2848 |
|
2849 | function getWheelDelta(ev: Event): number;
|
2850 |
|
2851 | function addListener(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
|
2852 |
|
2853 | function addListener(
|
2854 | el: HTMLElement,
|
2855 | eventMap: { [eventName: string]: EventHandlerFn },
|
2856 | context?: any,
|
2857 | ): typeof DomEvent;
|
2858 |
|
2859 | function removeListener(el: HTMLElement, types: string, fn: EventHandlerFn, context?: any): typeof DomEvent;
|
2860 |
|
2861 | function removeListener(
|
2862 | el: HTMLElement,
|
2863 | eventMap: { [eventName: string]: EventHandlerFn },
|
2864 | context?: any,
|
2865 | ): typeof DomEvent;
|
2866 |
|
2867 | function getPropagationPath(ev: Event): HTMLElement[];
|
2868 | }
|
2869 |
|
2870 | export interface DefaultMapPanes {
|
2871 | mapPane: HTMLElement;
|
2872 | tilePane: HTMLElement;
|
2873 | overlayPane: HTMLElement;
|
2874 | shadowPane: HTMLElement;
|
2875 | markerPane: HTMLElement;
|
2876 | tooltipPane: HTMLElement;
|
2877 | popupPane: HTMLElement;
|
2878 | }
|
2879 |
|
2880 | export class Map extends Evented {
|
2881 | constructor(element: string | HTMLElement, options?: MapOptions);
|
2882 | getRenderer(layer: Path): Renderer;
|
2883 |
|
2884 | // Methods for layers and controls
|
2885 | addControl(control: Control): this;
|
2886 | removeControl(control: Control): this;
|
2887 | addLayer(layer: Layer): this;
|
2888 | removeLayer(layer: Layer): this;
|
2889 | hasLayer(layer: Layer): boolean;
|
2890 | eachLayer(fn: (layer: Layer) => void, context?: any): this;
|
2891 | openPopup(popup: Popup): this;
|
2892 | openPopup(content: Content, latlng: LatLngExpression, options?: PopupOptions): this;
|
2893 | closePopup(popup?: Popup): this;
|
2894 | openTooltip(tooltip: Tooltip): this;
|
2895 | openTooltip(content: Content, latlng: LatLngExpression, options?: TooltipOptions): this;
|
2896 | closeTooltip(tooltip?: Tooltip): this;
|
2897 |
|
2898 | // Methods for modifying map state
|
2899 | setView(center: LatLngExpression, zoom?: number, options?: ZoomPanOptions): this;
|
2900 | setZoom(zoom: number, options?: ZoomPanOptions): this;
|
2901 | zoomIn(delta?: number, options?: ZoomOptions): this;
|
2902 | zoomOut(delta?: number, options?: ZoomOptions): this;
|
2903 | setZoomAround(position: Point | LatLngExpression, zoom: number, options?: ZoomOptions): this;
|
2904 | fitBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this;
|
2905 | fitWorld(options?: FitBoundsOptions): this;
|
2906 | panTo(latlng: LatLngExpression, options?: PanOptions): this;
|
2907 | panBy(offset: PointExpression, options?: PanOptions): this;
|
2908 | setMaxBounds(bounds?: LatLngBoundsExpression): this;
|
2909 | setMinZoom(zoom: number): this;
|
2910 | setMaxZoom(zoom: number): this;
|
2911 | panInside(latLng: LatLngExpression, options?: PanInsideOptions): this;
|
2912 | panInsideBounds(bounds: LatLngBoundsExpression, options?: PanOptions): this;
|
2913 | /**
|
2914 | * Boolean for animate or advanced ZoomPanOptions
|
2915 | */
|
2916 | invalidateSize(options?: boolean | InvalidateSizeOptions): this;
|
2917 | stop(): this;
|
2918 | flyTo(latlng: LatLngExpression, zoom?: number, options?: ZoomPanOptions): this;
|
2919 | flyToBounds(bounds: LatLngBoundsExpression, options?: FitBoundsOptions): this;
|
2920 |
|
2921 | // Other methods
|
2922 | addHandler(name: string, HandlerClass: typeof Handler): this; // Alternatively, HandlerClass: new(map: Map) => Handler
|
2923 | remove(): this;
|
2924 | createPane(name: string, container?: HTMLElement): HTMLElement;
|
2925 | /**
|
2926 | * Name of the pane or the pane as HTML-Element
|
2927 | */
|
2928 | getPane(pane: string | HTMLElement): HTMLElement | undefined;
|
2929 | getPanes(): { [name: string]: HTMLElement } & DefaultMapPanes;
|
2930 | getContainer(): HTMLElement;
|
2931 | whenReady(fn: () => void, context?: any): this;
|
2932 |
|
2933 |
|
2934 | getCenter(): LatLng;
|
2935 | getZoom(): number;
|
2936 | getBounds(): LatLngBounds;
|
2937 | getMinZoom(): number;
|
2938 | getMaxZoom(): number;
|
2939 | getBoundsZoom(bounds: LatLngBoundsExpression, inside?: boolean, padding?: Point): number;
|
2940 | getSize(): Point;
|
2941 | getPixelBounds(): Bounds;
|
2942 | getPixelOrigin(): Point;
|
2943 | getPixelWorldBounds(zoom?: number): Bounds;
|
2944 |
|
2945 |
|
2946 | getZoomScale(toZoom: number, fromZoom?: number): number;
|
2947 | getScaleZoom(scale: number, fromZoom?: number): number;
|
2948 | project(latlng: LatLngExpression, zoom?: number): Point;
|
2949 | unproject(point: PointExpression, zoom?: number): LatLng;
|
2950 | layerPointToLatLng(point: PointExpression): LatLng;
|
2951 | latLngToLayerPoint(latlng: LatLngExpression): Point;
|
2952 | wrapLatLng(latlng: LatLngExpression): LatLng;
|
2953 | wrapLatLngBounds(bounds: LatLngBounds): LatLngBounds;
|
2954 | distance(latlng1: LatLngExpression, latlng2: LatLngExpression): number;
|
2955 | containerPointToLayerPoint(point: PointExpression): Point;
|
2956 | containerPointToLatLng(point: PointExpression): LatLng;
|
2957 | layerPointToContainerPoint(point: PointExpression): Point;
|
2958 | latLngToContainerPoint(latlng: LatLngExpression): Point;
|
2959 | mouseEventToContainerPoint(ev: MouseEvent): Point;
|
2960 | mouseEventToLayerPoint(ev: MouseEvent): Point;
|
2961 | mouseEventToLatLng(ev: MouseEvent): LatLng;
|
2962 |
|
2963 |
|
2964 | locate(options?: LocateOptions): this;
|
2965 | stopLocate(): this;
|
2966 |
|
2967 |
|
2968 | attributionControl: L.Control.Attribution;
|
2969 | boxZoom: Handler;
|
2970 | doubleClickZoom: Handler;
|
2971 | dragging: Handler;
|
2972 | keyboard: Handler;
|
2973 | scrollWheelZoom: Handler;
|
2974 | tapHold?: Handler | undefined;
|
2975 | touchZoom: Handler;
|
2976 | zoomControl: Control.Zoom;
|
2977 |
|
2978 | options: MapOptions;
|
2979 | }
|
2980 |
|
2981 |
|
2982 |
|
2983 |
|
2984 | export function map(element: string | HTMLElement, options?: MapOptions): Map;
|
2985 |
|
2986 | export interface BaseIconOptions extends LayerOptions {
|
2987 | iconUrl?: string | undefined;
|
2988 | iconRetinaUrl?: string | undefined;
|
2989 | iconSize?: PointExpression | undefined;
|
2990 | iconAnchor?: PointExpression | undefined;
|
2991 | popupAnchor?: PointExpression | undefined;
|
2992 | tooltipAnchor?: PointExpression | undefined;
|
2993 | shadowUrl?: string | undefined;
|
2994 | shadowRetinaUrl?: string | undefined;
|
2995 | shadowSize?: PointExpression | undefined;
|
2996 | shadowAnchor?: PointExpression | undefined;
|
2997 | className?: string | undefined;
|
2998 | }
|
2999 |
|
3000 | export interface IconOptions extends BaseIconOptions {
|
3001 | iconUrl: string;
|
3002 | crossOrigin?: CrossOrigin | boolean | undefined;
|
3003 | }
|
3004 |
|
3005 | export class Icon<T extends BaseIconOptions = IconOptions> extends Layer {
|
3006 | constructor(options: T);
|
3007 | createIcon(oldIcon?: HTMLElement): HTMLElement;
|
3008 | createShadow(oldIcon?: HTMLElement): HTMLElement;
|
3009 |
|
3010 | options: T;
|
3011 | }
|
3012 |
|
3013 | export namespace Icon {
|
3014 | interface DefaultIconOptions extends BaseIconOptions {
|
3015 | imagePath?: string | undefined;
|
3016 | }
|
3017 |
|
3018 | class Default extends Icon<DefaultIconOptions> {
|
3019 | static imagePath?: string | undefined;
|
3020 | constructor(options?: DefaultIconOptions);
|
3021 | }
|
3022 | }
|
3023 |
|
3024 | export function icon(options: IconOptions): Icon;
|
3025 |
|
3026 | export interface DivIconOptions extends BaseIconOptions {
|
3027 | html?: string | HTMLElement | false | undefined;
|
3028 | bgPos?: PointExpression | undefined;
|
3029 | iconSize?: PointExpression | undefined;
|
3030 | iconAnchor?: PointExpression | undefined;
|
3031 | popupAnchor?: PointExpression | undefined;
|
3032 | className?: string | undefined;
|
3033 | }
|
3034 |
|
3035 | export class DivIcon extends Icon<DivIconOptions> {
|
3036 | constructor(options?: DivIconOptions);
|
3037 | }
|
3038 |
|
3039 | export function divIcon(options?: DivIconOptions): DivIcon;
|
3040 |
|
3041 | export interface MarkerOptions extends InteractiveLayerOptions {
|
3042 | icon?: Icon | DivIcon | undefined;
|
3043 |
|
3044 | draggable?: boolean | undefined;
|
3045 |
|
3046 | keyboard?: boolean | undefined;
|
3047 |
|
3048 | title?: string | undefined;
|
3049 |
|
3050 | alt?: string | undefined;
|
3051 |
|
3052 | zIndexOffset?: number | undefined;
|
3053 |
|
3054 | opacity?: number | undefined;
|
3055 |
|
3056 | riseOnHover?: boolean | undefined;
|
3057 |
|
3058 | riseOffset?: number | undefined;
|
3059 |
|
3060 | shadowPane?: string | undefined;
|
3061 |
|
3062 | autoPan?: boolean | undefined;
|
3063 |
|
3064 | autoPanPadding?: PointExpression | undefined;
|
3065 |
|
3066 | autoPanSpeed?: number | undefined;
|
3067 | autoPanOnFocus?: boolean | undefined;
|
3068 | }
|
3069 |
|
3070 | export class Marker<P = any> extends Layer {
|
3071 | constructor(latlng: LatLngExpression, options?: MarkerOptions);
|
3072 | toGeoJSON(precision?: number | false): geojson.Feature<geojson.Point, P>;
|
3073 | getLatLng(): LatLng;
|
3074 | setLatLng(latlng: LatLngExpression): this;
|
3075 | setZIndexOffset(offset: number): this;
|
3076 | getIcon(): Icon | DivIcon;
|
3077 | setIcon(icon: Icon | DivIcon): this;
|
3078 | setOpacity(opacity: number): this;
|
3079 | getElement(): HTMLElement | undefined;
|
3080 |
|
3081 | // Properties
|
3082 | options: MarkerOptions;
|
3083 | dragging?: Handler | undefined;
|
3084 | feature?: geojson.Feature<geojson.Point, P> | undefined;
|
3085 |
|
3086 | protected _shadow: HTMLElement | undefined;
|
3087 | }
|
3088 |
|
3089 | export function marker<P = any>(latlng: LatLngExpression, options?: MarkerOptions): Marker<P>;
|
3090 |
|
3091 | export namespace Browser {
|
3092 |
|
3093 | const ie: boolean;
|
3094 | const ielt9: boolean;
|
3095 | const edge: boolean;
|
3096 | const webkit: boolean;
|
3097 | const android: boolean;
|
3098 | const android23: boolean;
|
3099 | const androidStock: boolean;
|
3100 | const opera: boolean;
|
3101 | const chrome: boolean;
|
3102 | const gecko: boolean;
|
3103 | const safari: boolean;
|
3104 | const opera12: boolean;
|
3105 | const win: boolean;
|
3106 | const ie3d: boolean;
|
3107 | const webkit3d: boolean;
|
3108 | const gecko3d: boolean;
|
3109 | const any3d: boolean;
|
3110 | const mobile: boolean;
|
3111 | const mobileWebkit: boolean;
|
3112 | const mobileWebkit3d: boolean;
|
3113 | const msPointer: boolean;
|
3114 | const pointer: boolean;
|
3115 | const touch: boolean;
|
3116 | const mobileOpera: boolean;
|
3117 | const mobileGecko: boolean;
|
3118 | const retina: boolean;
|
3119 | const canvas: boolean;
|
3120 | const svg: boolean;
|
3121 | const vml: boolean;
|
3122 | }
|
3123 |
|
3124 | export namespace Util {
|
3125 | function extend<D extends object, S1 extends object = {}>(dest: D, src?: S1): D & S1;
|
3126 | function extend<D extends object, S1 extends object, S2 extends object>(dest: D, src1: S1, src2: S2): D & S1 & S2;
|
3127 | function extend<D extends object, S1 extends object, S2 extends object, S3 extends object>(
|
3128 | dest: D,
|
3129 | src1: S1,
|
3130 | src2: S2,
|
3131 | src3: S3,
|
3132 | ): D & S1 & S2 & S3;
|
3133 | function extend(dest: any, ...src: any[]): any;
|
3134 |
|
3135 | function create(proto: object | null, properties?: PropertyDescriptorMap): any;
|
3136 | function bind(fn: (...args: any[]) => void, ...obj: any[]): () => void;
|
3137 | function stamp(obj: any): number;
|
3138 | function throttle(fn: () => void, time: number, context: any): () => void;
|
3139 | function wrapNum(num: number, range: number[], includeMax?: boolean): number;
|
3140 | function falseFn(): false;
|
3141 | function formatNum(num: number, digits?: number | false): number;
|
3142 | function trim(str: string): string;
|
3143 | function splitWords(str: string): string[];
|
3144 | function setOptions(obj: any, options: any): any;
|
3145 | function getParamString(obj: any, existingUrl?: string, uppercase?: boolean): string;
|
3146 | function template(str: string, data: any): string;
|
3147 | function isArray(obj: any): boolean;
|
3148 | function indexOf(array: any[], el: any): number;
|
3149 | function requestAnimFrame(fn: (timestamp: number) => void, context?: any, immediate?: boolean): number;
|
3150 | function cancelAnimFrame(id: number): void;
|
3151 |
|
3152 | let lastId: number;
|
3153 | let emptyImageUrl: string;
|
3154 | }
|
3155 |
|
3156 | export const extend: typeof Util["extend"];
|
3157 | export const bind: typeof Util["bind"];
|
3158 | export const stamp: typeof Util["stamp"];
|
3159 | export const setOptions: typeof Util["setOptions"];
|
3160 |
|
3161 | export function noConflict(): any;
|