1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 | export = mapboxgl;
|
17 | export as namespace mapboxgl;
|
18 |
|
19 | declare namespace mapboxgl {
|
20 | let accessToken: string;
|
21 | let version: string;
|
22 | let baseApiUrl: string;
|
23 |
|
24 | |
25 |
|
26 |
|
27 |
|
28 | let workerCount: number;
|
29 |
|
30 | |
31 |
|
32 |
|
33 |
|
34 | let maxParallelImageRequests: number;
|
35 |
|
36 | export function supported(options?: { failIfMajorPerformanceCaveat?: boolean | undefined }): boolean;
|
37 |
|
38 | |
39 |
|
40 |
|
41 |
|
42 | export function clearStorage(callback?: (err?: Error) => void): void;
|
43 |
|
44 | export function setRTLTextPlugin(pluginURL: string, callback: (error: Error) => void, deferred?: boolean): void;
|
45 | export function getRTLTextPluginStatus(): PluginStatus;
|
46 |
|
47 | |
48 |
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 |
|
56 |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 |
|
62 |
|
63 |
|
64 | export function prewarm(): void;
|
65 |
|
66 | |
67 |
|
68 |
|
69 |
|
70 |
|
71 |
|
72 | export function clearPrewarmedResources(): void;
|
73 |
|
74 | type PluginStatus = 'unavailable' | 'loading' | 'loaded' | 'error';
|
75 |
|
76 | type LngLatLike = [number, number] | LngLat | { lng: number; lat: number } | { lon: number; lat: number };
|
77 |
|
78 | type LngLatBoundsLike = LngLatBounds | [LngLatLike, LngLatLike] | [number, number, number, number] | LngLatLike;
|
79 | type PointLike = Point | [number, number];
|
80 | type Offset = number | PointLike | { [_: string]: PointLike };
|
81 |
|
82 | type ExpressionName =
|
83 |
|
84 | | 'array'
|
85 | | 'boolean'
|
86 | | 'collator'
|
87 | | 'format'
|
88 | | 'literal'
|
89 | | 'number'
|
90 | | 'number-format'
|
91 | | 'object'
|
92 | | 'string'
|
93 | | 'image'
|
94 | | 'to-boolean'
|
95 | | 'to-color'
|
96 | | 'to-number'
|
97 | | 'to-string'
|
98 | | 'typeof'
|
99 |
|
100 | | 'feature-state'
|
101 | | 'geometry-type'
|
102 | | 'id'
|
103 | | 'line-progress'
|
104 | | 'properties'
|
105 |
|
106 | | 'at'
|
107 | | 'get'
|
108 | | 'has'
|
109 | | 'in'
|
110 | | 'index-of'
|
111 | | 'length'
|
112 | | 'slice'
|
113 |
|
114 | | '!'
|
115 | | '!='
|
116 | | '<'
|
117 | | '<='
|
118 | | '=='
|
119 | | '>'
|
120 | | '>='
|
121 | | 'all'
|
122 | | 'any'
|
123 | | 'case'
|
124 | | 'match'
|
125 | | 'coalesce'
|
126 | | 'within'
|
127 |
|
128 | | 'interpolate'
|
129 | | 'interpolate-hcl'
|
130 | | 'interpolate-lab'
|
131 | | 'step'
|
132 |
|
133 | | 'let'
|
134 | | 'var'
|
135 |
|
136 | | 'concat'
|
137 | | 'downcase'
|
138 | | 'is-supported-script'
|
139 | | 'resolved-locale'
|
140 | | 'upcase'
|
141 |
|
142 | | 'rgb'
|
143 | | 'rgba'
|
144 | | 'to-rgba'
|
145 |
|
146 | | '-'
|
147 | | '*'
|
148 | | '/'
|
149 | | '%'
|
150 | | '^'
|
151 | | '+'
|
152 | | 'abs'
|
153 | | 'acos'
|
154 | | 'asin'
|
155 | | 'atan'
|
156 | | 'ceil'
|
157 | | 'cos'
|
158 | | 'e'
|
159 | | 'floor'
|
160 | | 'ln'
|
161 | | 'ln2'
|
162 | | 'log10'
|
163 | | 'log2'
|
164 | | 'max'
|
165 | | 'min'
|
166 | | 'pi'
|
167 | | 'round'
|
168 | | 'sin'
|
169 | | 'sqrt'
|
170 | | 'tan'
|
171 |
|
172 | | 'zoom'
|
173 | | 'heatmap-density';
|
174 |
|
175 | type Expression = [ExpressionName, ...any[]];
|
176 |
|
177 | type Anchor =
|
178 | | 'center'
|
179 | | 'left'
|
180 | | 'right'
|
181 | | 'top'
|
182 | | 'bottom'
|
183 | | 'top-left'
|
184 | | 'top-right'
|
185 | | 'bottom-left'
|
186 | | 'bottom-right';
|
187 |
|
188 | type DragPanOptions = {
|
189 | linearity?: number;
|
190 | easing?: (t: number) => number;
|
191 | deceleration?: number;
|
192 | maxSpeed?: number;
|
193 | };
|
194 |
|
195 | type InteractiveOptions = { around?: 'center' };
|
196 |
|
197 | |
198 |
|
199 |
|
200 | export class Map extends Evented {
|
201 | constructor(options?: MapboxOptions);
|
202 |
|
203 | addControl(
|
204 | control: Control | IControl,
|
205 | position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left',
|
206 | ): this;
|
207 |
|
208 | removeControl(control: Control | IControl): this;
|
209 |
|
210 | /**
|
211 | * Checks if a control exists on the map.
|
212 | *
|
213 | * @param {IControl} control The {@link IControl} to check.
|
214 | * @returns {boolean} True if map contains control.
|
215 | * @example
|
216 | */
|
217 | hasControl(control: IControl): boolean;
|
218 |
|
219 | resize(eventData?: EventData): this;
|
220 |
|
221 | getBounds(): LngLatBounds;
|
222 |
|
223 | getMaxBounds(): LngLatBounds | null;
|
224 |
|
225 | setMaxBounds(lnglatbounds?: LngLatBoundsLike): this;
|
226 |
|
227 | setMinZoom(minZoom?: number | null): this;
|
228 |
|
229 | getMinZoom(): number;
|
230 |
|
231 | setMaxZoom(maxZoom?: number | null): this;
|
232 |
|
233 | getMaxZoom(): number;
|
234 |
|
235 | setMinPitch(minPitch?: number | null): this;
|
236 |
|
237 | getMinPitch(): number;
|
238 |
|
239 | setMaxPitch(maxPitch?: number | null): this;
|
240 |
|
241 | getMaxPitch(): number;
|
242 |
|
243 | getRenderWorldCopies(): boolean;
|
244 |
|
245 | setRenderWorldCopies(renderWorldCopies?: boolean): this;
|
246 |
|
247 | project(lnglat: LngLatLike): mapboxgl.Point;
|
248 |
|
249 | unproject(point: PointLike): mapboxgl.LngLat;
|
250 |
|
251 | isMoving(): boolean;
|
252 |
|
253 | isZooming(): boolean;
|
254 |
|
255 | isRotating(): boolean;
|
256 |
|
257 | |
258 |
|
259 |
|
260 |
|
261 |
|
262 |
|
263 |
|
264 |
|
265 |
|
266 |
|
267 |
|
268 |
|
269 |
|
270 |
|
271 |
|
272 |
|
273 |
|
274 |
|
275 |
|
276 |
|
277 |
|
278 |
|
279 | queryRenderedFeatures(
|
280 | pointOrBox?: PointLike | [PointLike, PointLike],
|
281 | options?: { layers?: string[] | undefined; filter?: any[] | undefined } & FilterOptions,
|
282 | ): MapboxGeoJSONFeature[];
|
283 |
|
284 | |
285 |
|
286 |
|
287 |
|
288 |
|
289 |
|
290 |
|
291 |
|
292 |
|
293 |
|
294 | querySourceFeatures(
|
295 | sourceID: string,
|
296 | parameters?: {
|
297 | sourceLayer?: string | undefined;
|
298 | filter?: any[] | undefined;
|
299 | } & FilterOptions,
|
300 | ): MapboxGeoJSONFeature[];
|
301 |
|
302 | setStyle(
|
303 | style: mapboxgl.Style | string,
|
304 | options?: { diff?: boolean | undefined; localIdeographFontFamily?: string | undefined },
|
305 | ): this;
|
306 |
|
307 | getStyle(): mapboxgl.Style;
|
308 |
|
309 | isStyleLoaded(): boolean;
|
310 |
|
311 | addSource(id: string, source: AnySourceData): this;
|
312 |
|
313 | isSourceLoaded(id: string): boolean;
|
314 |
|
315 | areTilesLoaded(): boolean;
|
316 |
|
317 | removeSource(id: string): this;
|
318 |
|
319 | getSource(id: string): AnySourceImpl;
|
320 |
|
321 | addImage(
|
322 | name: string,
|
323 | image:
|
324 | | HTMLImageElement
|
325 | | ArrayBufferView
|
326 | | { width: number; height: number; data: Uint8Array | Uint8ClampedArray }
|
327 | | ImageData
|
328 | | ImageBitmap,
|
329 | options?: { pixelRatio?: number | undefined; sdf?: boolean | undefined },
|
330 | ): void;
|
331 |
|
332 | updateImage(
|
333 | name: string,
|
334 | image:
|
335 | | HTMLImageElement
|
336 | | ArrayBufferView
|
337 | | { width: number; height: number; data: Uint8Array | Uint8ClampedArray }
|
338 | | ImageData
|
339 | | ImageBitmap,
|
340 | ): void;
|
341 |
|
342 | hasImage(name: string): boolean;
|
343 |
|
344 | removeImage(name: string): void;
|
345 |
|
346 | loadImage(url: string, callback: (error?: Error, result?: HTMLImageElement | ImageBitmap) => void): void;
|
347 |
|
348 | listImages(): string[];
|
349 |
|
350 | addLayer(layer: mapboxgl.AnyLayer, before?: string): this;
|
351 |
|
352 | moveLayer(id: string, beforeId?: string): this;
|
353 |
|
354 | removeLayer(id: string): this;
|
355 |
|
356 | getLayer(id: string): mapboxgl.AnyLayer;
|
357 |
|
358 | setFilter(layer: string, filter?: any[] | boolean | null, options?: FilterOptions | null): this;
|
359 |
|
360 | setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
|
361 |
|
362 | getFilter(layer: string): any[];
|
363 |
|
364 | setPaintProperty(layer: string, name: string, value: any, klass?: string): this;
|
365 |
|
366 | getPaintProperty(layer: string, name: string): any;
|
367 |
|
368 | setLayoutProperty(layer: string, name: string, value: any): this;
|
369 |
|
370 | getLayoutProperty(layer: string, name: string): any;
|
371 |
|
372 | setLight(options: mapboxgl.Light, lightOptions?: any): this;
|
373 |
|
374 | getLight(): mapboxgl.Light;
|
375 |
|
376 | |
377 |
|
378 |
|
379 |
|
380 |
|
381 |
|
382 |
|
383 |
|
384 |
|
385 |
|
386 |
|
387 |
|
388 |
|
389 |
|
390 |
|
391 |
|
392 | setTerrain(terrain?: TerrainSpecification | null): this;
|
393 |
|
394 | getTerrain(): TerrainSpecification | null;
|
395 |
|
396 | showTerrainWireframe: boolean;
|
397 |
|
398 | |
399 |
|
400 |
|
401 |
|
402 |
|
403 |
|
404 | queryTerrainElevation(lngLat: mapboxgl.LngLatLike, options?: ElevationQueryOptions): number | null;
|
405 |
|
406 | setFeatureState(
|
407 | feature: FeatureIdentifier | mapboxgl.MapboxGeoJSONFeature,
|
408 | state: { [key: string]: any },
|
409 | ): void;
|
410 |
|
411 | getFeatureState(feature: FeatureIdentifier | mapboxgl.MapboxGeoJSONFeature): { [key: string]: any };
|
412 |
|
413 | removeFeatureState(target: FeatureIdentifier | mapboxgl.MapboxGeoJSONFeature, key?: string): void;
|
414 |
|
415 | getContainer(): HTMLElement;
|
416 |
|
417 | getCanvasContainer(): HTMLElement;
|
418 |
|
419 | getCanvas(): HTMLCanvasElement;
|
420 |
|
421 | loaded(): boolean;
|
422 |
|
423 | remove(): void;
|
424 |
|
425 | triggerRepaint(): void;
|
426 |
|
427 | showTileBoundaries: boolean;
|
428 |
|
429 | showCollisionBoxes: boolean;
|
430 |
|
431 | |
432 |
|
433 |
|
434 |
|
435 |
|
436 |
|
437 |
|
438 |
|
439 |
|
440 | showPadding: boolean;
|
441 |
|
442 | repaint: boolean;
|
443 |
|
444 | getCenter(): mapboxgl.LngLat;
|
445 |
|
446 | setCenter(center: LngLatLike, eventData?: mapboxgl.EventData): this;
|
447 |
|
448 | panBy(offset: PointLike, options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
|
449 |
|
450 | panTo(lnglat: LngLatLike, options?: mapboxgl.AnimationOptions, eventdata?: mapboxgl.EventData): this;
|
451 |
|
452 | getZoom(): number;
|
453 |
|
454 | setZoom(zoom: number, eventData?: mapboxgl.EventData): this;
|
455 |
|
456 | zoomTo(zoom: number, options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
|
457 |
|
458 | zoomIn(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
|
459 |
|
460 | zoomOut(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
|
461 |
|
462 | getBearing(): number;
|
463 |
|
464 | setBearing(bearing: number, eventData?: mapboxgl.EventData): this;
|
465 |
|
466 | |
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 | getPadding(): PaddingOptions;
|
473 |
|
474 | |
475 |
|
476 |
|
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 |
|
485 |
|
486 |
|
487 |
|
488 |
|
489 | setPadding(padding: PaddingOptions, eventData?: EventData): this;
|
490 |
|
491 | rotateTo(bearing: number, options?: mapboxgl.AnimationOptions, eventData?: EventData): this;
|
492 |
|
493 | resetNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
|
494 |
|
495 | resetNorthPitch(options?: mapboxgl.AnimationOptions | null, eventData?: mapboxgl.EventData | null): this;
|
496 |
|
497 | snapToNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
|
498 |
|
499 | getPitch(): number;
|
500 |
|
501 | setPitch(pitch: number, eventData?: EventData): this;
|
502 |
|
503 | cameraForBounds(bounds: LngLatBoundsLike, options?: CameraForBoundsOptions): CameraForBoundsResult | undefined;
|
504 |
|
505 | fitBounds(bounds: LngLatBoundsLike, options?: mapboxgl.FitBoundsOptions, eventData?: mapboxgl.EventData): this;
|
506 |
|
507 | fitScreenCoordinates(
|
508 | p0: PointLike,
|
509 | p1: PointLike,
|
510 | bearing: number,
|
511 | options?: AnimationOptions & CameraOptions,
|
512 | eventData?: EventData,
|
513 | ): this;
|
514 |
|
515 | jumpTo(options: mapboxgl.CameraOptions, eventData?: mapboxgl.EventData): this;
|
516 |
|
517 | |
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 | getFreeCameraOptions(): FreeCameraOptions;
|
524 |
|
525 | |
526 |
|
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 |
|
534 |
|
535 |
|
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 |
|
543 |
|
544 |
|
545 |
|
546 |
|
547 |
|
548 | setFreeCameraOptions(options: FreeCameraOptions, eventData?: Object): this;
|
549 |
|
550 | easeTo(options: mapboxgl.EaseToOptions, eventData?: mapboxgl.EventData): this;
|
551 |
|
552 | flyTo(options: mapboxgl.FlyToOptions, eventData?: mapboxgl.EventData): this;
|
553 |
|
554 | isEasing(): boolean;
|
555 |
|
556 | stop(): this;
|
557 |
|
558 | on<T extends keyof MapLayerEventType>(
|
559 | type: T,
|
560 | layer: string | ReadonlyArray<string>,
|
561 | listener: (ev: MapLayerEventType[T] & EventData) => void,
|
562 | ): this;
|
563 | on<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & EventData) => void): this;
|
564 | on(type: string, listener: (ev: any) => void): this;
|
565 |
|
566 | once<T extends keyof MapLayerEventType>(
|
567 | type: T,
|
568 | layer: string,
|
569 | listener: (ev: MapLayerEventType[T] & EventData) => void,
|
570 | ): this;
|
571 | once<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & EventData) => void): this;
|
572 | once(type: string, listener: (ev: any) => void): this;
|
573 | once<T extends keyof MapEventType>(type: T): Promise<MapEventType[T]>;
|
574 |
|
575 | off<T extends keyof MapLayerEventType>(
|
576 | type: T,
|
577 | layer: string,
|
578 | listener: (ev: MapLayerEventType[T] & EventData) => void,
|
579 | ): this;
|
580 | off<T extends keyof MapEventType>(type: T, listener: (ev: MapEventType[T] & EventData) => void): this;
|
581 | off(type: string, listener: (ev: any) => void): this;
|
582 |
|
583 | scrollZoom: ScrollZoomHandler;
|
584 |
|
585 | boxZoom: BoxZoomHandler;
|
586 |
|
587 | dragRotate: DragRotateHandler;
|
588 |
|
589 | dragPan: DragPanHandler;
|
590 |
|
591 | keyboard: KeyboardHandler;
|
592 |
|
593 | doubleClickZoom: DoubleClickZoomHandler;
|
594 |
|
595 | touchZoomRotate: TouchZoomRotateHandler;
|
596 |
|
597 | touchPitch: TouchPitchHandler;
|
598 |
|
599 | getFog(): Fog | null;
|
600 | setFog(fog: Fog): this;
|
601 | }
|
602 |
|
603 | export interface MapboxOptions {
|
604 | /**
|
605 | * If true, the gl context will be created with MSA antialiasing, which can be useful for antialiasing custom layers.
|
606 | * This is false by default as a performance optimization.
|
607 | */
|
608 | antialias?: boolean | undefined;
|
609 |
|
610 | /** If true, an attribution control will be added to the map. */
|
611 | attributionControl?: boolean | undefined;
|
612 |
|
613 | bearing?: number | undefined;
|
614 |
|
615 | /** Snap to north threshold in degrees. */
|
616 | bearingSnap?: number | undefined;
|
617 |
|
618 | /** The initial bounds of the map. If bounds is specified, it overrides center and zoom constructor options. */
|
619 | bounds?: LngLatBoundsLike | undefined;
|
620 |
|
621 | /** If true, enable the "box zoom" interaction (see BoxZoomHandler) */
|
622 | boxZoom?: boolean | undefined;
|
623 |
|
624 | /** initial map center */
|
625 | center?: LngLatLike | undefined;
|
626 |
|
627 | /**
|
628 | * The max number of pixels a user can shift the mouse pointer during a click for it to be
|
629 | * considered a valid click (as opposed to a mouse drag).
|
630 | *
|
631 | * @default 3
|
632 | */
|
633 | clickTolerance?: number | undefined;
|
634 |
|
635 | /**
|
636 | * If `true`, Resource Timing API information will be collected for requests made by GeoJSON
|
637 | * and Vector Tile web workers (this information is normally inaccessible from the main
|
638 | * Javascript thread). Information will be returned in a `resourceTiming` property of
|
639 | * relevant `data` events.
|
640 | *
|
641 | * @default false
|
642 | */
|
643 | collectResourceTiming?: boolean | undefined;
|
644 |
|
645 | /**
|
646 | * If `true`, symbols from multiple sources can collide with each other during collision
|
647 | * detection. If `false`, collision detection is run separately for the symbols in each source.
|
648 | *
|
649 | * @default true
|
650 | */
|
651 | crossSourceCollisions?: boolean | undefined;
|
652 |
|
653 | /** ID of the container element */
|
654 | container: string | HTMLElement;
|
655 |
|
656 | /**
|
657 | * If `true` , scroll zoom will require pressing the ctrl or ⌘ key while scrolling to zoom map,
|
658 | * and touch pan will require using two fingers while panning to move the map.
|
659 | * Touch pitch will require three fingers to activate if enabled.
|
660 | */
|
661 | cooperativeGestures?: boolean;
|
662 |
|
663 | /** String or strings to show in an AttributionControl.
|
664 | * Only applicable if options.attributionControl is `true`. */
|
665 | customAttribution?: string | string[] | undefined;
|
666 |
|
667 | /**
|
668 | * If `true`, the "drag to pan" interaction is enabled.
|
669 | * An `Object` value is passed as options to {@link DragPanHandler#enable}.
|
670 | */
|
671 | dragPan?: boolean | DragPanOptions | undefined;
|
672 |
|
673 | /** If true, enable the "drag to rotate" interaction (see DragRotateHandler). */
|
674 | dragRotate?: boolean | undefined;
|
675 |
|
676 | /** If true, enable the "double click to zoom" interaction (see DoubleClickZoomHandler). */
|
677 | doubleClickZoom?: boolean | undefined;
|
678 |
|
679 | /** If `true`, the map's position (zoom, center latitude, center longitude, bearing, and pitch) will be synced with the hash fragment of the page's URL.
|
680 | * For example, `http://path/to/my/page.html#2.59/39.26/53.07/-24.1/60`.
|
681 | * An additional string may optionally be provided to indicate a parameter-styled hash,
|
682 | * e.g. http://path/to/my/page.html#map=2.59/39.26/53.07/-24.1/60&foo=bar, where foo
|
683 | * is a custom parameter and bar is an arbitrary hash distinct from the map hash.
|
684 | * */
|
685 | hash?: boolean | string | undefined;
|
686 |
|
687 | /**
|
688 | * Controls the duration of the fade-in/fade-out animation for label collisions, in milliseconds.
|
689 | * This setting affects all symbol layers. This setting does not affect the duration of runtime
|
690 | * styling transitions or raster tile cross-fading.
|
691 | *
|
692 | * @default 300
|
693 | */
|
694 | fadeDuration?: number | undefined;
|
695 |
|
696 | /** If true, map creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than expected. */
|
697 | failIfMajorPerformanceCaveat?: boolean | undefined;
|
698 |
|
699 | /** A fitBounds options object to use only when setting the bounds option. */
|
700 | fitBoundsOptions?: FitBoundsOptions | undefined;
|
701 |
|
702 | /** If false, no mouse, touch, or keyboard listeners are attached to the map, so it will not respond to input */
|
703 | interactive?: boolean | undefined;
|
704 |
|
705 | /** If true, enable keyboard shortcuts (see KeyboardHandler). */
|
706 | keyboard?: boolean | undefined;
|
707 |
|
708 | /** A patch to apply to the default localization table for UI strings, e.g. control tooltips.
|
709 | * The `locale` object maps namespaced UI string IDs to translated strings in the target language;
|
710 | * see `src/ui/default_locale.js` for an example with all supported string IDs.
|
711 | * The object may specify all UI strings (thereby adding support for a new translation) or
|
712 | * only a subset of strings (thereby patching the default translation table).
|
713 | */
|
714 | locale?: { [key: string]: string } | undefined;
|
715 |
|
716 | /**
|
717 | * Overrides the generation of all glyphs and font settings except font-weight keywords
|
718 | * Also overrides localIdeographFontFamily
|
719 | * @default null
|
720 | */
|
721 | localFontFamily?: string | undefined;
|
722 |
|
723 | /**
|
724 | * If specified, defines a CSS font-family for locally overriding generation of glyphs in the
|
725 | * 'CJK Unified Ideographs' and 'Hangul Syllables' ranges. In these ranges, font settings from
|
726 | * the map's style will be ignored, except for font-weight keywords (light/regular/medium/bold).
|
727 | * The purpose of this option is to avoid bandwidth-intensive glyph server requests.
|
728 | *
|
729 | * @default null
|
730 | */
|
731 | localIdeographFontFamily?: string | undefined;
|
732 |
|
733 | /**
|
734 | * A string representing the position of the Mapbox wordmark on the map.
|
735 | *
|
736 | * @default "bottom-left"
|
737 | */
|
738 | logoPosition?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | undefined;
|
739 |
|
740 | /** If set, the map is constrained to the given bounds. */
|
741 | maxBounds?: LngLatBoundsLike | undefined;
|
742 |
|
743 | /** Maximum pitch of the map. */
|
744 | maxPitch?: number | undefined;
|
745 |
|
746 | /** Maximum zoom of the map. */
|
747 | maxZoom?: number | undefined;
|
748 |
|
749 | /** Minimum pitch of the map. */
|
750 | minPitch?: number | undefined;
|
751 |
|
752 | /** Minimum zoom of the map. */
|
753 | minZoom?: number | undefined;
|
754 |
|
755 | /**
|
756 | * If true, map will prioritize rendering for performance by reordering layers
|
757 | * If false, layers will always be drawn in the specified order
|
758 | *
|
759 | * @default true
|
760 | */
|
761 | optimizeForTerrain?: boolean | undefined;
|
762 |
|
763 | /** If true, The maps canvas can be exported to a PNG using map.getCanvas().toDataURL();. This is false by default as a performance optimization. */
|
764 | preserveDrawingBuffer?: boolean | undefined;
|
765 |
|
766 | /**
|
767 | * The initial pitch (tilt) of the map, measured in degrees away from the plane of the
|
768 | * screen (0-60).
|
769 | *
|
770 | * @default 0
|
771 | */
|
772 | pitch?: number | undefined;
|
773 |
|
774 | /**
|
775 | * If `false`, the map's pitch (tilt) control with "drag to rotate" interaction will be disabled.
|
776 | *
|
777 | * @default true
|
778 | */
|
779 | pitchWithRotate?: boolean | undefined;
|
780 |
|
781 | /**
|
782 | * If `false`, the map won't attempt to re-request tiles once they expire per their HTTP
|
783 | * `cacheControl`/`expires` headers.
|
784 | *
|
785 | * @default true
|
786 | */
|
787 | refreshExpiredTiles?: boolean | undefined;
|
788 |
|
789 | /**
|
790 | * If `true`, multiple copies of the world will be rendered, when zoomed out.
|
791 | *
|
792 | * @default true
|
793 | */
|
794 | renderWorldCopies?: boolean | undefined;
|
795 |
|
796 | /**
|
797 | * If `true`, the "scroll to zoom" interaction is enabled.
|
798 | * An `Object` value is passed as options to {@link ScrollZoomHandler#enable}.
|
799 | */
|
800 | scrollZoom?: boolean | InteractiveOptions | undefined;
|
801 |
|
802 | /** stylesheet location */
|
803 | style?: mapboxgl.Style | string | undefined;
|
804 |
|
805 | /** If true, the map will automatically resize when the browser window resizes */
|
806 | trackResize?: boolean | undefined;
|
807 |
|
808 | /**
|
809 | * A callback run before the Map makes a request for an external URL. The callback can be
|
810 | * used to modify the url, set headers, or set the credentials property for cross-origin requests.
|
811 | *
|
812 | * @default null
|
813 | */
|
814 | transformRequest?: TransformRequestFunction | undefined;
|
815 |
|
816 | /**
|
817 | * If `true`, the "pinch to rotate and zoom" interaction is enabled.
|
818 | * An `Object` value is passed as options to {@link TouchZoomRotateHandler#enable}.
|
819 | */
|
820 | touchZoomRotate?: boolean | InteractiveOptions | undefined;
|
821 |
|
822 | /**
|
823 | * If `true`, the "drag to pitch" interaction is enabled.
|
824 | * An `Object` value is passed as options to {@link TouchPitchHandler#enable}.
|
825 | */
|
826 | touchPitch?: boolean | InteractiveOptions | undefined;
|
827 |
|
828 | /** Initial zoom level */
|
829 | zoom?: number | undefined;
|
830 |
|
831 | /**
|
832 | * The maximum number of tiles stored in the tile cache for a given source. If omitted, the
|
833 | * cache will be dynamically sized based on the current viewport.
|
834 | *
|
835 | * @default null
|
836 | */
|
837 | maxTileCacheSize?: number | undefined;
|
838 |
|
839 | /**
|
840 | * If specified, map will use this token instead of the one defined in mapboxgl.accessToken.
|
841 | *
|
842 | * @default null
|
843 | */
|
844 | accessToken?: string | undefined;
|
845 |
|
846 | /**
|
847 | * Allows for the usage of the map in automated tests without an accessToken with custom self-hosted test fixtures.
|
848 | *
|
849 | * @default null
|
850 | */
|
851 | testMode?: boolean | undefined;
|
852 | }
|
853 |
|
854 | type quat = number[];
|
855 | type vec3 = number[];
|
856 |
|
857 | /**
|
858 | * Various options for accessing physical properties of the underlying camera entity.
|
859 | * A direct access to these properties allows more flexible and precise controlling of the camera
|
860 | * while also being fully compatible and interchangeable with CameraOptions. All fields are optional.
|
861 | * See {@Link Camera#setFreeCameraOptions} and {@Link Camera#getFreeCameraOptions}
|
862 | *
|
863 | * @param {MercatorCoordinate} position Position of the camera in slightly modified web mercator coordinates
|
864 | - The size of 1 unit is the width of the projected world instead of the "mercator meter".
|
865 | Coordinate [0, 0, 0] is the north-west corner and [1, 1, 0] is the south-east corner.
|
866 | - Z coordinate is conformal and must respect minimum and maximum zoom values.
|
867 | - Zoom is automatically computed from the altitude (z)
|
868 | * @param {quat} orientation Orientation of the camera represented as a unit quaternion [x, y, z, w]
|
869 | in a left-handed coordinate space. Direction of the rotation is clockwise around the respective axis.
|
870 | The default pose of the camera is such that the forward vector is looking up the -Z axis and
|
871 | the up vector is aligned with north orientation of the map:
|
872 | forward: [0, 0, -1]
|
873 | up: [0, -1, 0]
|
874 | right [1, 0, 0]
|
875 | Orientation can be set freely but certain constraints still apply
|
876 | - Orientation must be representable with only pitch and bearing.
|
877 | - Pitch has an upper limit
|
878 | */
|
879 | export class FreeCameraOptions {
|
880 | constructor(position?: MercatorCoordinate, orientation?: quat);
|
881 |
|
882 | position: MercatorCoordinate | undefined;
|
883 |
|
884 | /**
|
885 | * Helper function for setting orientation of the camera by defining a focus point
|
886 | * on the map.
|
887 | *
|
888 | * @param {LngLatLike} location Location of the focus point on the map
|
889 | * @param {vec3} up Up vector of the camera is required in certain scenarios where bearing can't be deduced
|
890 | * from the viewing direction.
|
891 | */
|
892 | lookAtPoint(location: LngLatLike, up?: vec3): void;
|
893 |
|
894 | /**
|
895 | * Helper function for setting the orientation of the camera as a pitch and a bearing.
|
896 | *
|
897 | * @param {number} pitch Pitch angle in degrees
|
898 | * @param {number} bearing Bearing angle in degrees
|
899 | */
|
900 | setPitchBearing(pitch: number, bearing: number): void;
|
901 | }
|
902 |
|
903 | export type ResourceType =
|
904 | | 'Unknown'
|
905 | | 'Style'
|
906 | | 'Source'
|
907 | | 'Tile'
|
908 | | 'Glyphs'
|
909 | | 'SpriteImage'
|
910 | | 'SpriteJSON'
|
911 | | 'Image';
|
912 |
|
913 | export interface RequestParameters {
|
914 | /**
|
915 | * The URL to be requested.
|
916 | */
|
917 | url: string;
|
918 |
|
919 | /**
|
920 | * Use `'include'` to send cookies with cross-origin requests.
|
921 | */
|
922 | credentials?: 'same-origin' | 'include' | undefined;
|
923 |
|
924 | /**
|
925 | * The headers to be sent with the request.
|
926 | */
|
927 | headers?: { [header: string]: any } | undefined;
|
928 |
|
929 | method?: 'GET' | 'POST' | 'PUT' | undefined;
|
930 |
|
931 | collectResourceTiming?: boolean | undefined;
|
932 | }
|
933 |
|
934 | export type TransformRequestFunction = (url: string, resourceType: ResourceType) => RequestParameters;
|
935 |
|
936 | export interface PaddingOptions {
|
937 | top: number;
|
938 | bottom: number;
|
939 | left: number;
|
940 | right: number;
|
941 | }
|
942 |
|
943 | export interface FeatureIdentifier {
|
944 | id?: string | number | undefined;
|
945 | source: string;
|
946 | sourceLayer?: string | undefined;
|
947 | }
|
948 |
|
949 | |
950 |
|
951 |
|
952 | export class BoxZoomHandler {
|
953 | constructor(map: mapboxgl.Map);
|
954 |
|
955 | isEnabled(): boolean;
|
956 |
|
957 | isActive(): boolean;
|
958 |
|
959 | enable(): void;
|
960 |
|
961 | disable(): void;
|
962 | }
|
963 |
|
964 | /**
|
965 | * ScrollZoomHandler
|
966 | */
|
967 | export class ScrollZoomHandler {
|
968 | constructor(map: mapboxgl.Map);
|
969 |
|
970 | isEnabled(): boolean;
|
971 |
|
972 | enable(options?: InteractiveOptions): void;
|
973 |
|
974 | disable(): void;
|
975 |
|
976 | setZoomRate(zoomRate: number): void;
|
977 |
|
978 | setWheelZoomRate(wheelZoomRate: number): void;
|
979 | }
|
980 |
|
981 | /**
|
982 | * DragPenHandler
|
983 | */
|
984 | export class DragPanHandler {
|
985 | constructor(map: mapboxgl.Map);
|
986 |
|
987 | isEnabled(): boolean;
|
988 |
|
989 | isActive(): boolean;
|
990 |
|
991 | enable(options?: DragPanOptions): void;
|
992 |
|
993 | disable(): void;
|
994 | }
|
995 |
|
996 | /**
|
997 | * DragRotateHandler
|
998 | */
|
999 | export class DragRotateHandler {
|
1000 | constructor(
|
1001 | map: mapboxgl.Map,
|
1002 | options?: { bearingSnap?: number | undefined; pitchWithRotate?: boolean | undefined },
|
1003 | );
|
1004 |
|
1005 | isEnabled(): boolean;
|
1006 |
|
1007 | isActive(): boolean;
|
1008 |
|
1009 | enable(): void;
|
1010 |
|
1011 | disable(): void;
|
1012 | }
|
1013 |
|
1014 | /**
|
1015 | * KeyboardHandler
|
1016 | */
|
1017 | export class KeyboardHandler {
|
1018 | constructor(map: mapboxgl.Map);
|
1019 |
|
1020 | isEnabled(): boolean;
|
1021 |
|
1022 | enable(): void;
|
1023 |
|
1024 | disable(): void;
|
1025 |
|
1026 | /**
|
1027 | * Returns true if the handler is enabled and has detected the start of a
|
1028 | * zoom/rotate gesture.
|
1029 | *
|
1030 | * @returns {boolean} `true` if the handler is enabled and has detected the
|
1031 | * start of a zoom/rotate gesture.
|
1032 | */
|
1033 | isActive(): boolean;
|
1034 |
|
1035 | |
1036 |
|
1037 |
|
1038 |
|
1039 |
|
1040 |
|
1041 |
|
1042 | disableRotation(): void;
|
1043 |
|
1044 | |
1045 |
|
1046 |
|
1047 |
|
1048 |
|
1049 |
|
1050 |
|
1051 | enableRotation(): void;
|
1052 | }
|
1053 |
|
1054 | |
1055 |
|
1056 |
|
1057 | export class DoubleClickZoomHandler {
|
1058 | constructor(map: mapboxgl.Map);
|
1059 |
|
1060 | isEnabled(): boolean;
|
1061 |
|
1062 | enable(): void;
|
1063 |
|
1064 | disable(): void;
|
1065 | }
|
1066 |
|
1067 | /**
|
1068 | * TouchZoomRotateHandler
|
1069 | */
|
1070 | export class TouchZoomRotateHandler {
|
1071 | constructor(map: mapboxgl.Map);
|
1072 |
|
1073 | isEnabled(): boolean;
|
1074 |
|
1075 | enable(options?: InteractiveOptions): void;
|
1076 |
|
1077 | disable(): void;
|
1078 |
|
1079 | disableRotation(): void;
|
1080 |
|
1081 | enableRotation(): void;
|
1082 | }
|
1083 |
|
1084 | export class TouchPitchHandler {
|
1085 | constructor(map: mapboxgl.Map);
|
1086 |
|
1087 | enable(options?: InteractiveOptions): void;
|
1088 |
|
1089 | isActive(): boolean;
|
1090 |
|
1091 | isEnabled(): boolean;
|
1092 |
|
1093 | disable(): void;
|
1094 | }
|
1095 |
|
1096 | export interface IControl {
|
1097 | onAdd(map: Map): HTMLElement;
|
1098 |
|
1099 | onRemove(map: Map): void;
|
1100 |
|
1101 | getDefaultPosition?: (() => string) | undefined;
|
1102 | }
|
1103 |
|
1104 | /**
|
1105 | * Control
|
1106 | */
|
1107 | export class Control extends Evented implements IControl {
|
1108 | onAdd(map: Map): HTMLElement;
|
1109 | onRemove(map: Map): void;
|
1110 | getDefaultPosition?: (() => string) | undefined;
|
1111 | }
|
1112 |
|
1113 | /**
|
1114 | * Navigation
|
1115 | */
|
1116 | export class NavigationControl extends Control {
|
1117 | constructor(options?: {
|
1118 | showCompass?: boolean | undefined;
|
1119 | showZoom?: boolean | undefined;
|
1120 | visualizePitch?: boolean | undefined;
|
1121 | });
|
1122 | }
|
1123 |
|
1124 | export class PositionOptions {
|
1125 | enableHighAccuracy?: boolean | undefined;
|
1126 | timeout?: number | undefined;
|
1127 | maximumAge?: number | undefined;
|
1128 | }
|
1129 |
|
1130 | /**
|
1131 | * Geolocate
|
1132 | */
|
1133 | export class GeolocateControl extends Control {
|
1134 | constructor(options?: {
|
1135 | positionOptions?: PositionOptions | undefined;
|
1136 | fitBoundsOptions?: FitBoundsOptions | undefined;
|
1137 | trackUserLocation?: boolean | undefined;
|
1138 | showAccuracyCircle?: boolean | undefined;
|
1139 | showUserLocation?: boolean | undefined;
|
1140 | showUserHeading?: boolean | undefined;
|
1141 | });
|
1142 | trigger(): boolean;
|
1143 | }
|
1144 |
|
1145 | /**
|
1146 | * Attribution
|
1147 | */
|
1148 | export class AttributionControl extends Control {
|
1149 | constructor(options?: { compact?: boolean | undefined; customAttribution?: string | string[] | undefined });
|
1150 | }
|
1151 |
|
1152 | /**
|
1153 | * Scale
|
1154 | */
|
1155 | export class ScaleControl extends Control {
|
1156 | constructor(options?: { maxWidth?: number | undefined; unit?: string | undefined });
|
1157 |
|
1158 | setUnit(unit: 'imperial' | 'metric' | 'nautical'): void;
|
1159 | }
|
1160 |
|
1161 | /**
|
1162 | * FullscreenControl
|
1163 | */
|
1164 | export class FullscreenControl extends Control {
|
1165 | constructor(options?: FullscreenControlOptions | null);
|
1166 | }
|
1167 |
|
1168 | export interface FullscreenControlOptions {
|
1169 | /**
|
1170 | * A compatible DOM element which should be made full screen.
|
1171 | * By default, the map container element will be made full screen.
|
1172 | */
|
1173 | container?: HTMLElement | null | undefined;
|
1174 | }
|
1175 |
|
1176 | /**
|
1177 | * Popup
|
1178 | */
|
1179 | export class Popup extends Evented {
|
1180 | constructor(options?: mapboxgl.PopupOptions);
|
1181 |
|
1182 | addTo(map: mapboxgl.Map): this;
|
1183 |
|
1184 | isOpen(): boolean;
|
1185 |
|
1186 | remove(): this;
|
1187 |
|
1188 | getLngLat(): mapboxgl.LngLat;
|
1189 |
|
1190 | /**
|
1191 | * Sets the geographical location of the popup's anchor, and moves the popup to it. Replaces trackPointer() behavior.
|
1192 | *
|
1193 | * @param lnglat The geographical location to set as the popup's anchor.
|
1194 | */
|
1195 | setLngLat(lnglat: LngLatLike): this;
|
1196 |
|
1197 | /**
|
1198 | * Tracks the popup anchor to the cursor position, on screens with a pointer device (will be hidden on touchscreens). Replaces the setLngLat behavior.
|
1199 | * For most use cases, `closeOnClick` and `closeButton` should also be set to `false` here.
|
1200 | */
|
1201 | trackPointer(): this;
|
1202 |
|
1203 | /** Returns the `Popup`'s HTML element. */
|
1204 | getElement(): HTMLElement;
|
1205 |
|
1206 | setText(text: string): this;
|
1207 |
|
1208 | setHTML(html: string): this;
|
1209 |
|
1210 | setDOMContent(htmlNode: Node): this;
|
1211 |
|
1212 | getMaxWidth(): string;
|
1213 |
|
1214 | setMaxWidth(maxWidth: string): this;
|
1215 |
|
1216 | /**
|
1217 | * Adds a CSS class to the popup container element.
|
1218 | *
|
1219 | * @param {string} className Non-empty string with CSS class name to add to popup container
|
1220 | *
|
1221 | * @example
|
1222 | * let popup = new mapboxgl.Popup()
|
1223 | * popup.addClassName('some-class')
|
1224 | */
|
1225 | addClassName(className: string): void;
|
1226 |
|
1227 | /**
|
1228 | * Removes a CSS class from the popup container element.
|
1229 | *
|
1230 | * @param {string} className Non-empty string with CSS class name to remove from popup container
|
1231 | *
|
1232 | * @example
|
1233 | * let popup = new mapboxgl.Popup()
|
1234 | * popup.removeClassName('some-class')
|
1235 | */
|
1236 | removeClassName(className: string): void;
|
1237 |
|
1238 | /**
|
1239 | * Sets the popup's offset.
|
1240 | *
|
1241 | * @param offset Sets the popup's offset.
|
1242 | * @returns {Popup} `this`
|
1243 | */
|
1244 | setOffset(offset?: Offset | null): this;
|
1245 |
|
1246 | /**
|
1247 | * Add or remove the given CSS class on the popup container, depending on whether the container currently has that class.
|
1248 | *
|
1249 | * @param {string} className Non-empty string with CSS class name to add/remove
|
1250 | *
|
1251 | * @returns {boolean} if the class was removed return false, if class was added, then return true
|
1252 | *
|
1253 | * @example
|
1254 | * let popup = new mapboxgl.Popup()
|
1255 | * popup.toggleClassName('toggleClass')
|
1256 | */
|
1257 | toggleClassName(className: string): void;
|
1258 | }
|
1259 |
|
1260 | export interface PopupOptions {
|
1261 | closeButton?: boolean | undefined;
|
1262 |
|
1263 | closeOnClick?: boolean | undefined;
|
1264 |
|
1265 | /**
|
1266 | * @param {boolean} [options.closeOnMove=false] If `true`, the popup will closed when the map moves.
|
1267 | */
|
1268 | closeOnMove?: boolean | undefined;
|
1269 |
|
1270 | /**
|
1271 | * @param {boolean} [options.focusAfterOpen=true] If `true`, the popup will try to focus the
|
1272 | * first focusable element inside the popup.
|
1273 | */
|
1274 | focusAfterOpen?: boolean | null | undefined;
|
1275 |
|
1276 | anchor?: Anchor | undefined;
|
1277 |
|
1278 | offset?: Offset | null | undefined;
|
1279 |
|
1280 | className?: string | undefined;
|
1281 |
|
1282 | maxWidth?: string | undefined;
|
1283 | }
|
1284 |
|
1285 | export interface Style {
|
1286 | layers: AnyLayer[];
|
1287 | sources: Sources;
|
1288 |
|
1289 | bearing?: number | undefined;
|
1290 | center?: number[] | undefined;
|
1291 | fog?: Fog | undefined;
|
1292 | glyphs?: string | undefined;
|
1293 | metadata?: any;
|
1294 | name?: string | undefined;
|
1295 | pitch?: number | undefined;
|
1296 | light?: Light | undefined;
|
1297 | sprite?: string | undefined;
|
1298 | terrain?: TerrainSpecification | undefined;
|
1299 | transition?: Transition | undefined;
|
1300 | version: number;
|
1301 | zoom?: number | undefined;
|
1302 | }
|
1303 |
|
1304 | export interface Transition {
|
1305 | delay?: number | undefined;
|
1306 | duration?: number | undefined;
|
1307 | }
|
1308 |
|
1309 | export interface Light {
|
1310 | anchor?: 'map' | 'viewport' | undefined;
|
1311 | position?: number[] | undefined;
|
1312 | 'position-transition'?: Transition | undefined;
|
1313 | color?: string | undefined;
|
1314 | 'color-transition'?: Transition | undefined;
|
1315 | intensity?: number | undefined;
|
1316 | 'intensity-transition'?: Transition | undefined;
|
1317 | }
|
1318 |
|
1319 | export interface Fog {
|
1320 | color?: string | Expression | undefined;
|
1321 | 'horizon-blend'?: number | Expression | undefined;
|
1322 | range?: number[] | Expression | undefined;
|
1323 | }
|
1324 |
|
1325 | export interface Sources {
|
1326 | [sourceName: string]: AnySourceData;
|
1327 | }
|
1328 |
|
1329 | export type PromoteIdSpecification = { [key: string]: string } | string;
|
1330 |
|
1331 | export type AnySourceData =
|
1332 | | GeoJSONSourceRaw
|
1333 | | VideoSourceRaw
|
1334 | | ImageSourceRaw
|
1335 | | CanvasSourceRaw
|
1336 | | VectorSource
|
1337 | | RasterSource
|
1338 | | RasterDemSource;
|
1339 |
|
1340 | interface VectorSourceImpl extends VectorSource {
|
1341 | /**
|
1342 | * Sets the source `tiles` property and re-renders the map.
|
1343 | *
|
1344 | * @param {string[]} tiles An array of one or more tile source URLs, as in the TileJSON spec.
|
1345 | * @returns {VectorTileSource} this
|
1346 | */
|
1347 | setTiles(tiles: ReadonlyArray<string>): VectorSourceImpl;
|
1348 |
|
1349 | /**
|
1350 | * Sets the source `url` property and re-renders the map.
|
1351 | *
|
1352 | * @param {string} url A URL to a TileJSON resource. Supported protocols are `http:`, `https:`, and `mapbox://<Tileset ID>`.
|
1353 | * @returns {VectorTileSource} this
|
1354 | */
|
1355 | setUrl(url: string): VectorSourceImpl;
|
1356 | }
|
1357 |
|
1358 | export type AnySourceImpl =
|
1359 | | GeoJSONSource
|
1360 | | VideoSource
|
1361 | | ImageSource
|
1362 | | CanvasSource
|
1363 | | VectorSourceImpl
|
1364 | | RasterSource
|
1365 | | RasterDemSource;
|
1366 |
|
1367 | export interface Source {
|
1368 | type: 'vector' | 'raster' | 'raster-dem' | 'geojson' | 'image' | 'video' | 'canvas';
|
1369 | }
|
1370 |
|
1371 | /**
|
1372 | * GeoJSONSource
|
1373 | */
|
1374 |
|
1375 | export interface GeoJSONSourceRaw extends Source, GeoJSONSourceOptions {
|
1376 | type: 'geojson';
|
1377 | }
|
1378 |
|
1379 | export class GeoJSONSource implements GeoJSONSourceRaw {
|
1380 | type: 'geojson';
|
1381 |
|
1382 | constructor(options?: mapboxgl.GeoJSONSourceOptions);
|
1383 |
|
1384 | setData(data: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry> | String): this;
|
1385 |
|
1386 | getClusterExpansionZoom(clusterId: number, callback: (error: any, zoom: number) => void): this;
|
1387 |
|
1388 | getClusterChildren(
|
1389 | clusterId: number,
|
1390 | callback: (error: any, features: GeoJSON.Feature<GeoJSON.Geometry>[]) => void,
|
1391 | ): this;
|
1392 |
|
1393 | getClusterLeaves(
|
1394 | cluserId: number,
|
1395 | limit: number,
|
1396 | offset: number,
|
1397 | callback: (error: any, features: GeoJSON.Feature<GeoJSON.Geometry>[]) => void,
|
1398 | ): this;
|
1399 | }
|
1400 |
|
1401 | export interface GeoJSONSourceOptions {
|
1402 | data?: GeoJSON.Feature<GeoJSON.Geometry> | GeoJSON.FeatureCollection<GeoJSON.Geometry> | string | undefined;
|
1403 |
|
1404 | maxzoom?: number | undefined;
|
1405 |
|
1406 | attribution?: string | undefined;
|
1407 |
|
1408 | buffer?: number | undefined;
|
1409 |
|
1410 | tolerance?: number | undefined;
|
1411 |
|
1412 | cluster?: number | boolean | undefined;
|
1413 |
|
1414 | clusterRadius?: number | undefined;
|
1415 |
|
1416 | clusterMaxZoom?: number | undefined;
|
1417 |
|
1418 | /**
|
1419 | * Minimum number of points necessary to form a cluster if clustering is enabled. Defaults to `2`.
|
1420 | */
|
1421 | clusterMinPoints?: number | undefined;
|
1422 |
|
1423 | clusterProperties?: object | undefined;
|
1424 |
|
1425 | lineMetrics?: boolean | undefined;
|
1426 |
|
1427 | generateId?: boolean | undefined;
|
1428 |
|
1429 | promoteId?: PromoteIdSpecification | undefined;
|
1430 |
|
1431 | filter?: any;
|
1432 | }
|
1433 |
|
1434 | /**
|
1435 | * VideoSource
|
1436 | */
|
1437 | export interface VideoSourceRaw extends Source, VideoSourceOptions {
|
1438 | type: 'video';
|
1439 | }
|
1440 |
|
1441 | export class VideoSource implements VideoSourceRaw {
|
1442 | type: 'video';
|
1443 |
|
1444 | constructor(options?: mapboxgl.VideoSourceOptions);
|
1445 |
|
1446 | getVideo(): HTMLVideoElement;
|
1447 |
|
1448 | setCoordinates(coordinates: number[][]): this;
|
1449 | }
|
1450 |
|
1451 | export interface VideoSourceOptions {
|
1452 | urls?: string[] | undefined;
|
1453 |
|
1454 | coordinates?: number[][] | undefined;
|
1455 | }
|
1456 |
|
1457 | /**
|
1458 | * ImageSource
|
1459 | */
|
1460 | export interface ImageSourceRaw extends Source, ImageSourceOptions {
|
1461 | type: 'image';
|
1462 | }
|
1463 |
|
1464 | export class ImageSource implements ImageSourceRaw {
|
1465 | type: 'image';
|
1466 |
|
1467 | constructor(options?: mapboxgl.ImageSourceOptions);
|
1468 |
|
1469 | updateImage(options: ImageSourceOptions): this;
|
1470 |
|
1471 | setCoordinates(coordinates: number[][]): this;
|
1472 | }
|
1473 |
|
1474 | export interface ImageSourceOptions {
|
1475 | url?: string | undefined;
|
1476 |
|
1477 | coordinates?: number[][] | undefined;
|
1478 | }
|
1479 |
|
1480 | /**
|
1481 | * CanvasSource
|
1482 | */
|
1483 | export interface CanvasSourceRaw extends Source, CanvasSourceOptions {
|
1484 | type: 'canvas';
|
1485 | }
|
1486 |
|
1487 | export class CanvasSource implements CanvasSourceRaw {
|
1488 | type: 'canvas';
|
1489 |
|
1490 | coordinates: number[][];
|
1491 |
|
1492 | canvas: string | HTMLCanvasElement;
|
1493 |
|
1494 | play(): void;
|
1495 |
|
1496 | pause(): void;
|
1497 |
|
1498 | getCanvas(): HTMLCanvasElement;
|
1499 |
|
1500 | setCoordinates(coordinates: number[][]): this;
|
1501 | }
|
1502 |
|
1503 | export interface CanvasSourceOptions {
|
1504 | coordinates: number[][];
|
1505 |
|
1506 | animate?: boolean | undefined;
|
1507 |
|
1508 | canvas: string | HTMLCanvasElement;
|
1509 | }
|
1510 |
|
1511 | export type CameraFunctionSpecification<T> =
|
1512 | | { type: 'exponential'; stops: Array<[number, T]> }
|
1513 | | { type: 'interval'; stops: Array<[number, T]> };
|
1514 |
|
1515 | export type ExpressionSpecification = Array<unknown>;
|
1516 |
|
1517 | export type PropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | ExpressionSpecification;
|
1518 |
|
1519 | export interface TerrainSpecification {
|
1520 | source: string;
|
1521 | exaggeration?: PropertyValueSpecification<number> | undefined;
|
1522 | }
|
1523 |
|
1524 | /**
|
1525 | * @see https://github.com/mapbox/tilejson-spec/tree/master/3.0.0#33-vector_layers
|
1526 | */
|
1527 | type SourceVectorLayer = {
|
1528 | id: string;
|
1529 | fields?: Record<string, string>;
|
1530 | description?: string;
|
1531 | minzoom?: number;
|
1532 | maxzoom?: number;
|
1533 |
|
1534 | // Non standard extensions that are valid in a Mapbox context.
|
1535 | source?: string;
|
1536 | source_name?: string;
|
1537 | };
|
1538 |
|
1539 | interface VectorSource extends Source {
|
1540 | type: 'vector';
|
1541 | format?: 'pbf';
|
1542 |
|
1543 | url?: string | undefined;
|
1544 | id?: string;
|
1545 | name?: string;
|
1546 |
|
1547 | tiles?: string[] | undefined;
|
1548 | bounds?: number[] | undefined;
|
1549 | scheme?: 'xyz' | 'tms' | undefined;
|
1550 | minzoom?: number | undefined;
|
1551 | maxzoom?: number | undefined;
|
1552 | attribution?: string | undefined;
|
1553 | promoteId?: PromoteIdSpecification | undefined;
|
1554 |
|
1555 | vector_layers?: SourceVectorLayer[];
|
1556 | }
|
1557 |
|
1558 | interface RasterSource extends Source {
|
1559 | name?: string;
|
1560 | type: 'raster';
|
1561 | id?: string;
|
1562 | format?: 'webp' | string;
|
1563 |
|
1564 | url?: string | undefined;
|
1565 | tiles?: string[] | undefined;
|
1566 | bounds?: number[] | undefined;
|
1567 | minzoom?: number | undefined;
|
1568 | maxzoom?: number | undefined;
|
1569 | tileSize?: number | undefined;
|
1570 | scheme?: 'xyz' | 'tms' | undefined;
|
1571 | attribution?: string | undefined;
|
1572 | }
|
1573 |
|
1574 | interface RasterDemSource extends Source {
|
1575 | name?: string;
|
1576 | type: 'raster-dem';
|
1577 | id?: string;
|
1578 |
|
1579 | url?: string | undefined;
|
1580 | tiles?: string[] | undefined;
|
1581 | bounds?: number[] | undefined;
|
1582 | minzoom?: number | undefined;
|
1583 | maxzoom?: number | undefined;
|
1584 | tileSize?: number | undefined;
|
1585 | attribution?: string | undefined;
|
1586 | encoding?: 'terrarium' | 'mapbox' | undefined;
|
1587 | }
|
1588 |
|
1589 | /**
|
1590 | * LngLat
|
1591 | */
|
1592 | export class LngLat {
|
1593 | lng: number;
|
1594 | lat: number;
|
1595 |
|
1596 | constructor(lng: number, lat: number);
|
1597 |
|
1598 | /** Return a new LngLat object whose longitude is wrapped to the range (-180, 180). */
|
1599 | wrap(): mapboxgl.LngLat;
|
1600 |
|
1601 | /** Return a LngLat as an array */
|
1602 | toArray(): number[];
|
1603 |
|
1604 | /** Return a LngLat as a string */
|
1605 | toString(): string;
|
1606 |
|
1607 | /** Returns the approximate distance between a pair of coordinates in meters
|
1608 | * Uses the Haversine Formula (from R.W. Sinnott, "Virtues of the Haversine", Sky and Telescope, vol. 68, no. 2, 1984, p. 159) */
|
1609 | distanceTo(lngLat: LngLat): number;
|
1610 |
|
1611 | toBounds(radius: number): LngLatBounds;
|
1612 |
|
1613 | static convert(input: LngLatLike): mapboxgl.LngLat;
|
1614 | }
|
1615 |
|
1616 | /**
|
1617 | * LngLatBounds
|
1618 | */
|
1619 | export class LngLatBounds {
|
1620 | sw: LngLatLike;
|
1621 | ne: LngLatLike;
|
1622 |
|
1623 | constructor(boundsLike?: [LngLatLike, LngLatLike] | [number, number, number, number]);
|
1624 | constructor(sw: LngLatLike, ne: LngLatLike);
|
1625 |
|
1626 | setNorthEast(ne: LngLatLike): this;
|
1627 |
|
1628 | setSouthWest(sw: LngLatLike): this;
|
1629 |
|
1630 | /** Check if the point is within the bounding box. */
|
1631 | contains(lnglat: LngLatLike): boolean;
|
1632 |
|
1633 | /** Extend the bounds to include a given LngLat or LngLatBounds. */
|
1634 | extend(obj: mapboxgl.LngLatLike | mapboxgl.LngLatBoundsLike): this;
|
1635 |
|
1636 | /** Get the point equidistant from this box's corners */
|
1637 | getCenter(): mapboxgl.LngLat;
|
1638 |
|
1639 | /** Get southwest corner */
|
1640 | getSouthWest(): mapboxgl.LngLat;
|
1641 |
|
1642 | /** Get northeast corner */
|
1643 | getNorthEast(): mapboxgl.LngLat;
|
1644 |
|
1645 | /** Get northwest corner */
|
1646 | getNorthWest(): mapboxgl.LngLat;
|
1647 |
|
1648 | /** Get southeast corner */
|
1649 | getSouthEast(): mapboxgl.LngLat;
|
1650 |
|
1651 | /** Get west edge longitude */
|
1652 | getWest(): number;
|
1653 |
|
1654 | /** Get south edge latitude */
|
1655 | getSouth(): number;
|
1656 |
|
1657 | /** Get east edge longitude */
|
1658 | getEast(): number;
|
1659 |
|
1660 | /** Get north edge latitude */
|
1661 | getNorth(): number;
|
1662 |
|
1663 | /** Returns a LngLatBounds as an array */
|
1664 | toArray(): number[][];
|
1665 |
|
1666 | /** Return a LngLatBounds as a string */
|
1667 | toString(): string;
|
1668 |
|
1669 | /** Returns a boolean */
|
1670 | isEmpty(): boolean;
|
1671 |
|
1672 | /** Convert an array to a LngLatBounds object, or return an existing LngLatBounds object unchanged. */
|
1673 | static convert(input: LngLatBoundsLike): mapboxgl.LngLatBounds;
|
1674 | }
|
1675 |
|
1676 | /**
|
1677 | * Point
|
1678 | */
|
1679 | // Todo: Pull out class to seperate definition for Module "point-geometry"
|
1680 | export class Point {
|
1681 | x: number;
|
1682 | y: number;
|
1683 |
|
1684 | constructor(x: number, y: number);
|
1685 |
|
1686 | clone(): Point;
|
1687 |
|
1688 | add(p: Point): Point;
|
1689 |
|
1690 | sub(p: Point): Point;
|
1691 |
|
1692 | mult(k: number): Point;
|
1693 |
|
1694 | div(k: number): Point;
|
1695 |
|
1696 | rotate(a: number): Point;
|
1697 |
|
1698 | matMult(m: number): Point;
|
1699 |
|
1700 | unit(): Point;
|
1701 |
|
1702 | perp(): Point;
|
1703 |
|
1704 | round(): Point;
|
1705 |
|
1706 | mag(): number;
|
1707 |
|
1708 | equals(p: Point): boolean;
|
1709 |
|
1710 | dist(p: Point): number;
|
1711 |
|
1712 | distSqr(p: Point): number;
|
1713 |
|
1714 | angle(): number;
|
1715 |
|
1716 | angleTo(p: Point): number;
|
1717 |
|
1718 | angleWidth(p: Point): number;
|
1719 |
|
1720 | angleWithSep(x: number, y: number): number;
|
1721 |
|
1722 | static convert(a: PointLike): Point;
|
1723 | }
|
1724 |
|
1725 | /**
|
1726 | * MercatorCoordinate
|
1727 | */
|
1728 | export class MercatorCoordinate {
|
1729 | /** The x component of the position. */
|
1730 | x: number;
|
1731 |
|
1732 | /** The y component of the position. */
|
1733 | y: number;
|
1734 |
|
1735 | /**
|
1736 | * The z component of the position.
|
1737 | *
|
1738 | * @default 0
|
1739 | */
|
1740 | z?: number | undefined;
|
1741 |
|
1742 | constructor(x: number, y: number, z?: number);
|
1743 |
|
1744 | /** Returns the altitude in meters of the coordinate. */
|
1745 | toAltitude(): number;
|
1746 |
|
1747 | /** Returns the LngLat for the coordinate. */
|
1748 | toLngLat(): LngLat;
|
1749 |
|
1750 | /**
|
1751 | * Returns the distance of 1 meter in MercatorCoordinate units at this latitude.
|
1752 | *
|
1753 | * For coordinates in real world units using meters, this naturally provides the
|
1754 | * scale to transform into MercatorCoordinates.
|
1755 | */
|
1756 | meterInMercatorCoordinateUnits(): number;
|
1757 |
|
1758 | /** Project a LngLat to a MercatorCoordinate. */
|
1759 | static fromLngLat(lngLatLike: LngLatLike, altitude?: number): MercatorCoordinate;
|
1760 | }
|
1761 |
|
1762 | /**
|
1763 | * Marker
|
1764 | */
|
1765 | export class Marker extends Evented {
|
1766 | constructor(options?: mapboxgl.MarkerOptions);
|
1767 |
|
1768 | constructor(element?: HTMLElement, options?: mapboxgl.MarkerOptions);
|
1769 |
|
1770 | addTo(map: Map): this;
|
1771 |
|
1772 | remove(): this;
|
1773 |
|
1774 | getLngLat(): LngLat;
|
1775 |
|
1776 | setLngLat(lngLat: LngLatLike): this;
|
1777 |
|
1778 | getElement(): HTMLElement;
|
1779 |
|
1780 | setPopup(popup?: Popup): this;
|
1781 |
|
1782 | getPopup(): Popup;
|
1783 |
|
1784 | togglePopup(): this;
|
1785 |
|
1786 | getOffset(): PointLike;
|
1787 |
|
1788 | setOffset(offset: PointLike): this;
|
1789 |
|
1790 | setDraggable(shouldBeDraggable: boolean): this;
|
1791 |
|
1792 | isDraggable(): boolean;
|
1793 |
|
1794 | getRotation(): number;
|
1795 |
|
1796 | setRotation(rotation: number): this;
|
1797 |
|
1798 | getRotationAlignment(): Alignment;
|
1799 |
|
1800 | setRotationAlignment(alignment: Alignment): this;
|
1801 |
|
1802 | getPitchAlignment(): Alignment;
|
1803 |
|
1804 | setPitchAlignment(alignment: Alignment): this;
|
1805 | }
|
1806 |
|
1807 | type Alignment = 'map' | 'viewport' | 'auto';
|
1808 |
|
1809 | export interface MarkerOptions {
|
1810 | /** DOM element to use as a marker. The default is a light blue, droplet-shaped SVG marker */
|
1811 | element?: HTMLElement | undefined;
|
1812 |
|
1813 | /** The offset in pixels as a PointLike object to apply relative to the element's center. Negatives indicate left and up. */
|
1814 | offset?: PointLike | undefined;
|
1815 |
|
1816 | /** A string indicating the part of the Marker that should be positioned closest to the coordinate set via Marker.setLngLat.
|
1817 | * Options are `'center'`, `'top'`, `'bottom'`, `'left'`, `'right'`, `'top-left'`, `'top-right'`, `'bottom-left'`, and `'bottom-right'`.
|
1818 | * The default value os `'center'`
|
1819 | */
|
1820 | anchor?: Anchor | undefined;
|
1821 |
|
1822 | /** The color to use for the default marker if options.element is not provided. The default is light blue (#3FB1CE). */
|
1823 | color?: string | undefined;
|
1824 |
|
1825 | /** A boolean indicating whether or not a marker is able to be dragged to a new position on the map. The default value is false */
|
1826 | draggable?: boolean | undefined;
|
1827 |
|
1828 | /**
|
1829 | * The max number of pixels a user can shift the mouse pointer during a click on the marker for it to be considered a valid click
|
1830 | * (as opposed to a marker drag). The default (0) is to inherit map's clickTolerance.
|
1831 | */
|
1832 | clickTolerance?: number | null | undefined;
|
1833 |
|
1834 | /** The rotation angle of the marker in degrees, relative to its `rotationAlignment` setting. A positive value will rotate the marker clockwise.
|
1835 | * The default value is 0.
|
1836 | */
|
1837 | rotation?: number | undefined;
|
1838 |
|
1839 | /** `map` aligns the `Marker`'s rotation relative to the map, maintaining a bearing as the map rotates.
|
1840 | * `viewport` aligns the `Marker`'s rotation relative to the viewport, agnostic to map rotations.
|
1841 | * `auto` is equivalent to `viewport`.
|
1842 | * The default value is `auto`
|
1843 | */
|
1844 | rotationAlignment?: Alignment | undefined;
|
1845 |
|
1846 | /** `map` aligns the `Marker` to the plane of the map.
|
1847 | * `viewport` aligns the `Marker` to the plane of the viewport.
|
1848 | * `auto` automatically matches the value of `rotationAlignment`.
|
1849 | * The default value is `auto`.
|
1850 | */
|
1851 | pitchAlignment?: Alignment | undefined;
|
1852 |
|
1853 | /** The scale to use for the default marker if options.element is not provided.
|
1854 | * The default scale (1) corresponds to a height of `41px` and a width of `27px`.
|
1855 | */
|
1856 | scale?: number | undefined;
|
1857 | }
|
1858 |
|
1859 | type EventedListener = (object?: Object) => any;
|
1860 | |
1861 |
|
1862 |
|
1863 | export class Evented {
|
1864 | on(type: string, listener: EventedListener): this;
|
1865 |
|
1866 | off(type?: string | any, listener?: EventedListener): this;
|
1867 |
|
1868 | once(type: string, listener: EventedListener): this;
|
1869 |
|
1870 |
|
1871 | fire(type: string, properties?: { [key: string]: any }): this;
|
1872 | }
|
1873 |
|
1874 | |
1875 |
|
1876 |
|
1877 | export interface StyleOptions {
|
1878 | transition?: boolean | undefined;
|
1879 | }
|
1880 |
|
1881 | export type MapboxGeoJSONFeature = GeoJSON.Feature<GeoJSON.Geometry> & {
|
1882 | layer: Layer;
|
1883 | source: string;
|
1884 | sourceLayer: string;
|
1885 | state: { [key: string]: any };
|
1886 | };
|
1887 |
|
1888 | export type EventData = { [key: string]: any };
|
1889 |
|
1890 | export class MapboxEvent<TOrig = undefined> {
|
1891 | type: string;
|
1892 | target: Map;
|
1893 | originalEvent: TOrig;
|
1894 | }
|
1895 |
|
1896 | export class MapMouseEvent extends MapboxEvent<MouseEvent> {
|
1897 | type:
|
1898 | | 'mousedown'
|
1899 | | 'mouseup'
|
1900 | | 'click'
|
1901 | | 'dblclick'
|
1902 | | 'mousemove'
|
1903 | | 'mouseover'
|
1904 | | 'mouseenter'
|
1905 | | 'mouseleave'
|
1906 | | 'mouseout'
|
1907 | | 'contextmenu';
|
1908 |
|
1909 | point: Point;
|
1910 | lngLat: LngLat;
|
1911 |
|
1912 | preventDefault(): void;
|
1913 | defaultPrevented: boolean;
|
1914 | }
|
1915 |
|
1916 | export type MapLayerMouseEvent = MapMouseEvent & { features?: MapboxGeoJSONFeature[] | undefined };
|
1917 |
|
1918 | export class MapTouchEvent extends MapboxEvent<TouchEvent> {
|
1919 | type: 'touchstart' | 'touchend' | 'touchcancel';
|
1920 |
|
1921 | point: Point;
|
1922 | lngLat: LngLat;
|
1923 | points: Point[];
|
1924 | lngLats: LngLat[];
|
1925 |
|
1926 | preventDefault(): void;
|
1927 | defaultPrevented: boolean;
|
1928 | }
|
1929 |
|
1930 | export type MapLayerTouchEvent = MapTouchEvent & { features?: MapboxGeoJSONFeature[] | undefined };
|
1931 |
|
1932 | export class MapWheelEvent extends MapboxEvent<WheelEvent> {
|
1933 | type: 'wheel';
|
1934 |
|
1935 | preventDefault(): void;
|
1936 | defaultPrevented: boolean;
|
1937 | }
|
1938 |
|
1939 | export interface MapBoxZoomEvent extends MapboxEvent<MouseEvent> {
|
1940 | type: 'boxzoomstart' | 'boxzoomend' | 'boxzoomcancel';
|
1941 |
|
1942 | boxZoomBounds: LngLatBounds;
|
1943 | }
|
1944 |
|
1945 | export type MapDataEvent = MapSourceDataEvent | MapStyleDataEvent;
|
1946 |
|
1947 | export interface MapStyleDataEvent extends MapboxEvent {
|
1948 | dataType: 'style';
|
1949 | }
|
1950 |
|
1951 | export interface MapSourceDataEvent extends MapboxEvent {
|
1952 | dataType: 'source';
|
1953 | isSourceLoaded: boolean;
|
1954 | source: Source;
|
1955 | sourceId: string;
|
1956 | sourceDataType: 'metadata' | 'content';
|
1957 | tile: any;
|
1958 | coord: Coordinate;
|
1959 | }
|
1960 |
|
1961 | export interface Coordinate {
|
1962 | canonical: CanonicalCoordinate;
|
1963 | wrap: number;
|
1964 | key: number;
|
1965 | }
|
1966 |
|
1967 | export interface CanonicalCoordinate {
|
1968 | x: number;
|
1969 | y: number;
|
1970 | z: number;
|
1971 | key: number;
|
1972 | equals(coord: CanonicalCoordinate): boolean;
|
1973 | }
|
1974 |
|
1975 | export interface MapContextEvent extends MapboxEvent<WebGLContextEvent> {
|
1976 | type: 'webglcontextlost' | 'webglcontextrestored';
|
1977 | }
|
1978 |
|
1979 | export class ErrorEvent extends MapboxEvent {
|
1980 | type: 'error';
|
1981 | error: Error;
|
1982 | }
|
1983 |
|
1984 | |
1985 |
|
1986 |
|
1987 | export interface FilterOptions {
|
1988 | |
1989 |
|
1990 |
|
1991 |
|
1992 |
|
1993 | validate?: boolean | null | undefined;
|
1994 | }
|
1995 |
|
1996 | |
1997 |
|
1998 |
|
1999 | export interface AnimationOptions {
|
2000 |
|
2001 | duration?: number | undefined;
|
2002 | |
2003 |
|
2004 |
|
2005 |
|
2006 | easing?: ((time: number) => number) | undefined;
|
2007 | /** point, origin of movement relative to map center */
|
2008 | offset?: PointLike | undefined;
|
2009 | /** When set to false, no animation happens */
|
2010 | animate?: boolean | undefined;
|
2011 |
|
2012 | /** If `true`, then the animation is considered essential and will not be affected by `prefers-reduced-motion`.
|
2013 | * Otherwise, the transition will happen instantly if the user has enabled the `reduced motion` accesibility feature in their operating system.
|
2014 | */
|
2015 | essential?: boolean | undefined;
|
2016 | }
|
2017 |
|
2018 | /**
|
2019 | * CameraOptions
|
2020 | */
|
2021 | export interface CameraOptions {
|
2022 | /** Map center */
|
2023 | center?: LngLatLike | undefined;
|
2024 | /** Map zoom level */
|
2025 | zoom?: number | undefined;
|
2026 | /** Map rotation bearing in degrees counter-clockwise from north */
|
2027 | bearing?: number | undefined;
|
2028 | /** Map angle in degrees at which the camera is looking at the ground */
|
2029 | pitch?: number | undefined;
|
2030 | /** If zooming, the zoom center (defaults to map center) */
|
2031 | around?: LngLatLike | undefined;
|
2032 | /** Dimensions in pixels applied on each side of the viewport for shifting the vanishing point. */
|
2033 | padding?: number | PaddingOptions | undefined;
|
2034 | }
|
2035 |
|
2036 | export interface CameraForBoundsOptions extends CameraOptions {
|
2037 | offset?: PointLike | undefined;
|
2038 | maxZoom?: number | undefined;
|
2039 | }
|
2040 |
|
2041 | // The Mapbox docs say that if the result is defined, it will have zoom, center and bearing set.
|
2042 | // In practice center is always a {lat, lng} object.
|
2043 | export type CameraForBoundsResult = Required<Pick<CameraOptions, 'zoom' | 'bearing'>> & {
|
2044 | /** Map center */
|
2045 | center: { lng: number; lat: number };
|
2046 | };
|
2047 |
|
2048 | /**
|
2049 | * FlyToOptions
|
2050 | */
|
2051 | export interface FlyToOptions extends AnimationOptions, CameraOptions {
|
2052 | curve?: number | undefined;
|
2053 | minZoom?: number | undefined;
|
2054 | speed?: number | undefined;
|
2055 | screenSpeed?: number | undefined;
|
2056 | maxDuration?: number | undefined;
|
2057 | }
|
2058 |
|
2059 | /**
|
2060 | * EaseToOptions
|
2061 | */
|
2062 | export interface EaseToOptions extends AnimationOptions, CameraOptions {
|
2063 | delayEndEvents?: number | undefined;
|
2064 | }
|
2065 |
|
2066 | export interface FitBoundsOptions extends mapboxgl.FlyToOptions {
|
2067 | linear?: boolean | undefined;
|
2068 | offset?: mapboxgl.PointLike | undefined;
|
2069 | maxZoom?: number | undefined;
|
2070 | maxDuration?: number | undefined;
|
2071 | }
|
2072 |
|
2073 | /**
|
2074 | * MapEvent
|
2075 | */
|
2076 | export type MapEventType = {
|
2077 | error: ErrorEvent;
|
2078 |
|
2079 | load: MapboxEvent;
|
2080 | idle: MapboxEvent;
|
2081 | remove: MapboxEvent;
|
2082 | render: MapboxEvent;
|
2083 | resize: MapboxEvent;
|
2084 |
|
2085 | webglcontextlost: MapContextEvent;
|
2086 | webglcontextrestored: MapContextEvent;
|
2087 |
|
2088 | dataloading: MapDataEvent;
|
2089 | data: MapDataEvent;
|
2090 | tiledataloading: MapDataEvent;
|
2091 | sourcedataloading: MapSourceDataEvent;
|
2092 | styledataloading: MapStyleDataEvent;
|
2093 | sourcedata: MapSourceDataEvent;
|
2094 | styledata: MapStyleDataEvent;
|
2095 |
|
2096 | boxzoomcancel: MapBoxZoomEvent;
|
2097 | boxzoomstart: MapBoxZoomEvent;
|
2098 | boxzoomend: MapBoxZoomEvent;
|
2099 |
|
2100 | touchcancel: MapTouchEvent;
|
2101 | touchmove: MapTouchEvent;
|
2102 | touchend: MapTouchEvent;
|
2103 | touchstart: MapTouchEvent;
|
2104 |
|
2105 | click: MapMouseEvent;
|
2106 | contextmenu: MapMouseEvent;
|
2107 | dblclick: MapMouseEvent;
|
2108 | mousemove: MapMouseEvent;
|
2109 | mouseup: MapMouseEvent;
|
2110 | mousedown: MapMouseEvent;
|
2111 | mouseout: MapMouseEvent;
|
2112 | mouseover: MapMouseEvent;
|
2113 |
|
2114 | movestart: MapboxEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
2115 | move: MapboxEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
2116 | moveend: MapboxEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
2117 |
|
2118 | zoomstart: MapboxEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
2119 | zoom: MapboxEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
2120 | zoomend: MapboxEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
2121 |
|
2122 | rotatestart: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2123 | rotate: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2124 | rotateend: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2125 |
|
2126 | dragstart: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2127 | drag: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2128 | dragend: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2129 |
|
2130 | pitchstart: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2131 | pitch: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2132 | pitchend: MapboxEvent<MouseEvent | TouchEvent | undefined>;
|
2133 |
|
2134 | wheel: MapWheelEvent;
|
2135 | };
|
2136 |
|
2137 | export type MapLayerEventType = {
|
2138 | click: MapLayerMouseEvent;
|
2139 | dblclick: MapLayerMouseEvent;
|
2140 | mousedown: MapLayerMouseEvent;
|
2141 | mouseup: MapLayerMouseEvent;
|
2142 | mousemove: MapLayerMouseEvent;
|
2143 | mouseenter: MapLayerMouseEvent;
|
2144 | mouseleave: MapLayerMouseEvent;
|
2145 | mouseover: MapLayerMouseEvent;
|
2146 | mouseout: MapLayerMouseEvent;
|
2147 | contextmenu: MapLayerMouseEvent;
|
2148 |
|
2149 | touchstart: MapLayerTouchEvent;
|
2150 | touchend: MapLayerTouchEvent;
|
2151 | touchcancel: MapLayerTouchEvent;
|
2152 | };
|
2153 |
|
2154 | export type AnyLayout =
|
2155 | | BackgroundLayout
|
2156 | | FillLayout
|
2157 | | FillExtrusionLayout
|
2158 | | LineLayout
|
2159 | | SymbolLayout
|
2160 | | RasterLayout
|
2161 | | CircleLayout
|
2162 | | HeatmapLayout
|
2163 | | HillshadeLayout
|
2164 | | SkyLayout;
|
2165 |
|
2166 | export type AnyPaint =
|
2167 | | BackgroundPaint
|
2168 | | FillPaint
|
2169 | | FillExtrusionPaint
|
2170 | | LinePaint
|
2171 | | SymbolPaint
|
2172 | | RasterPaint
|
2173 | | CirclePaint
|
2174 | | HeatmapPaint
|
2175 | | HillshadePaint
|
2176 | | SkyPaint;
|
2177 |
|
2178 | interface Layer {
|
2179 | id: string;
|
2180 | type: string;
|
2181 |
|
2182 | metadata?: any;
|
2183 | ref?: string | undefined;
|
2184 |
|
2185 | source?: string | AnySourceData | undefined;
|
2186 |
|
2187 | 'source-layer'?: string | undefined;
|
2188 |
|
2189 | minzoom?: number | undefined;
|
2190 | maxzoom?: number | undefined;
|
2191 |
|
2192 | interactive?: boolean | undefined;
|
2193 |
|
2194 | filter?: any[] | undefined;
|
2195 | layout?: AnyLayout | undefined;
|
2196 | paint?: AnyPaint | undefined;
|
2197 | }
|
2198 |
|
2199 | interface BackgroundLayer extends Layer {
|
2200 | type: 'background';
|
2201 | layout?: BackgroundLayout | undefined;
|
2202 | paint?: BackgroundPaint | undefined;
|
2203 | }
|
2204 |
|
2205 | interface CircleLayer extends Layer {
|
2206 | type: 'circle';
|
2207 | layout?: CircleLayout | undefined;
|
2208 | paint?: CirclePaint | undefined;
|
2209 | }
|
2210 |
|
2211 | interface FillExtrusionLayer extends Layer {
|
2212 | type: 'fill-extrusion';
|
2213 | layout?: FillExtrusionLayout | undefined;
|
2214 | paint?: FillExtrusionPaint | undefined;
|
2215 | }
|
2216 |
|
2217 | interface FillLayer extends Layer {
|
2218 | type: 'fill';
|
2219 | layout?: FillLayout | undefined;
|
2220 | paint?: FillPaint | undefined;
|
2221 | }
|
2222 |
|
2223 | interface HeatmapLayer extends Layer {
|
2224 | type: 'heatmap';
|
2225 | layout?: HeatmapLayout | undefined;
|
2226 | paint?: HeatmapPaint | undefined;
|
2227 | }
|
2228 |
|
2229 | interface HillshadeLayer extends Layer {
|
2230 | type: 'hillshade';
|
2231 | layout?: HillshadeLayout | undefined;
|
2232 | paint?: HillshadePaint | undefined;
|
2233 | }
|
2234 |
|
2235 | interface LineLayer extends Layer {
|
2236 | type: 'line';
|
2237 | layout?: LineLayout | undefined;
|
2238 | paint?: LinePaint | undefined;
|
2239 | }
|
2240 |
|
2241 | interface RasterLayer extends Layer {
|
2242 | type: 'raster';
|
2243 | layout?: RasterLayout | undefined;
|
2244 | paint?: RasterPaint | undefined;
|
2245 | }
|
2246 |
|
2247 | interface SymbolLayer extends Layer {
|
2248 | type: 'symbol';
|
2249 | layout?: SymbolLayout | undefined;
|
2250 | paint?: SymbolPaint | undefined;
|
2251 | }
|
2252 |
|
2253 | interface SkyLayer extends Layer {
|
2254 | type: 'sky';
|
2255 | layout?: SkyLayout | undefined;
|
2256 | paint?: SkyPaint | undefined;
|
2257 | }
|
2258 |
|
2259 | export type AnyLayer =
|
2260 | | BackgroundLayer
|
2261 | | CircleLayer
|
2262 | | FillExtrusionLayer
|
2263 | | FillLayer
|
2264 | | HeatmapLayer
|
2265 | | HillshadeLayer
|
2266 | | LineLayer
|
2267 | | RasterLayer
|
2268 | | SymbolLayer
|
2269 | | CustomLayerInterface
|
2270 | | SkyLayer;
|
2271 |
|
2272 | // See https://docs.mapbox.com/mapbox-gl-js/api/#customlayerinterface
|
2273 | export interface CustomLayerInterface {
|
2274 | /** A unique layer id. */
|
2275 | id: string;
|
2276 |
|
2277 | /* The layer's type. Must be "custom". */
|
2278 | type: 'custom';
|
2279 |
|
2280 | /* Either "2d" or "3d". Defaults to "2d". */
|
2281 | renderingMode?: '2d' | '3d' | undefined;
|
2282 |
|
2283 | /**
|
2284 | * Optional method called when the layer has been removed from the Map with Map#removeLayer.
|
2285 | * This gives the layer a chance to clean up gl resources and event listeners.
|
2286 | * @param map The Map this custom layer was just added to.
|
2287 | * @param gl The gl context for the map.
|
2288 | */
|
2289 | onRemove?(map: mapboxgl.Map, gl: WebGLRenderingContext): void;
|
2290 |
|
2291 | /**
|
2292 | * Optional method called when the layer has been added to the Map with Map#addLayer.
|
2293 | * This gives the layer a chance to initialize gl resources and register event listeners.
|
2294 | * @param map The Map this custom layer was just added to.
|
2295 | * @param gl The gl context for the map.
|
2296 | */
|
2297 | onAdd?(map: mapboxgl.Map, gl: WebGLRenderingContext): void;
|
2298 |
|
2299 | /**
|
2300 | * Optional method called during a render frame to allow a layer to prepare resources
|
2301 | * or render into a texture.
|
2302 | *
|
2303 | * The layer cannot make any assumptions about the current GL state and must bind a framebuffer
|
2304 | * before rendering.
|
2305 | * @param gl The map's gl context.
|
2306 | * @param matrix The map's camera matrix. It projects spherical mercator coordinates to gl
|
2307 | * coordinates. The mercator coordinate [0, 0] represents the top left corner of
|
2308 | * the mercator world and [1, 1] represents the bottom right corner. When the
|
2309 | * renderingMode is "3d" , the z coordinate is conformal. A box with identical
|
2310 | * x, y, and z lengths in mercator units would be rendered as a cube.
|
2311 | * MercatorCoordinate .fromLatLng can be used to project a LngLat to a mercator
|
2312 | * coordinate.
|
2313 | */
|
2314 | prerender?(gl: WebGLRenderingContext, matrix: number[]): void;
|
2315 |
|
2316 | /**
|
2317 | * Called during a render frame allowing the layer to draw into the GL context.
|
2318 | *
|
2319 | * The layer can assume blending and depth state is set to allow the layer to properly blend
|
2320 | * and clip other layers. The layer cannot make any other assumptions about the current GL state.
|
2321 | *
|
2322 | * If the layer needs to render to a texture, it should implement the prerender method to do this
|
2323 | * and only use the render method for drawing directly into the main framebuffer.
|
2324 | *
|
2325 | * The blend function is set to gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA). This expects
|
2326 | * colors to be provided in premultiplied alpha form where the r, g and b values are already
|
2327 | * multiplied by the a value. If you are unable to provide colors in premultiplied form you may
|
2328 | * want to change the blend function to
|
2329 | * gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA).
|
2330 | *
|
2331 | * @param gl The map's gl context.
|
2332 | * @param matrix The map's camera matrix. It projects spherical mercator coordinates to gl
|
2333 | * coordinates. The mercator coordinate [0, 0] represents the top left corner of
|
2334 | * the mercator world and [1, 1] represents the bottom right corner. When the
|
2335 | * renderingMode is "3d" , the z coordinate is conformal. A box with identical
|
2336 | * x, y, and z lengths in mercator units would be rendered as a cube.
|
2337 | * MercatorCoordinate .fromLatLng can be used to project a LngLat to a mercator
|
2338 | * coordinate.
|
2339 | */
|
2340 | render(gl: WebGLRenderingContext, matrix: number[]): void;
|
2341 | }
|
2342 |
|
2343 | export interface StyleFunction {
|
2344 | stops?: any[][] | undefined;
|
2345 | property?: string | undefined;
|
2346 | base?: number | undefined;
|
2347 | type?: 'identity' | 'exponential' | 'interval' | 'categorical' | undefined;
|
2348 | default?: any;
|
2349 | colorSpace?: 'rgb' | 'lab' | 'hcl' | undefined;
|
2350 | }
|
2351 |
|
2352 | type Visibility = 'visible' | 'none';
|
2353 |
|
2354 | export interface Layout {
|
2355 | visibility?: Visibility | undefined;
|
2356 | }
|
2357 |
|
2358 | export interface BackgroundLayout extends Layout {}
|
2359 |
|
2360 | export interface BackgroundPaint {
|
2361 | 'background-color'?: string | Expression | undefined;
|
2362 | 'background-color-transition'?: Transition | undefined;
|
2363 | 'background-pattern'?: string | undefined;
|
2364 | 'background-pattern-transition'?: Transition | undefined;
|
2365 | 'background-opacity'?: number | Expression | undefined;
|
2366 | 'background-opacity-transition'?: Transition | undefined;
|
2367 | }
|
2368 |
|
2369 | export interface FillLayout extends Layout {
|
2370 | 'fill-sort-key'?: number | Expression | undefined;
|
2371 | }
|
2372 |
|
2373 | export interface FillPaint {
|
2374 | 'fill-antialias'?: boolean | Expression | undefined;
|
2375 | 'fill-opacity'?: number | StyleFunction | Expression | undefined;
|
2376 | 'fill-opacity-transition'?: Transition | undefined;
|
2377 | 'fill-color'?: string | StyleFunction | Expression | undefined;
|
2378 | 'fill-color-transition'?: Transition | undefined;
|
2379 | 'fill-outline-color'?: string | StyleFunction | Expression | undefined;
|
2380 | 'fill-outline-color-transition'?: Transition | undefined;
|
2381 | 'fill-translate'?: number[] | undefined;
|
2382 | 'fill-translate-transition'?: Transition | undefined;
|
2383 | 'fill-translate-anchor'?: 'map' | 'viewport' | undefined;
|
2384 | 'fill-pattern'?: string | Expression | undefined;
|
2385 | 'fill-pattern-transition'?: Transition | undefined;
|
2386 | }
|
2387 |
|
2388 | export interface FillExtrusionLayout extends Layout {}
|
2389 |
|
2390 | export interface FillExtrusionPaint {
|
2391 | 'fill-extrusion-opacity'?: number | Expression | undefined;
|
2392 | 'fill-extrusion-opacity-transition'?: Transition | undefined;
|
2393 | 'fill-extrusion-color'?: string | StyleFunction | Expression | undefined;
|
2394 | 'fill-extrusion-color-transition'?: Transition | undefined;
|
2395 | 'fill-extrusion-translate'?: number[] | Expression | undefined;
|
2396 | 'fill-extrusion-translate-transition'?: Transition | undefined;
|
2397 | 'fill-extrusion-translate-anchor'?: 'map' | 'viewport' | undefined;
|
2398 | 'fill-extrusion-pattern'?: string | Expression | undefined;
|
2399 | 'fill-extrusion-pattern-transition'?: Transition | undefined;
|
2400 | 'fill-extrusion-height'?: number | StyleFunction | Expression | undefined;
|
2401 | 'fill-extrusion-height-transition'?: Transition | undefined;
|
2402 | 'fill-extrusion-base'?: number | StyleFunction | Expression | undefined;
|
2403 | 'fill-extrusion-base-transition'?: Transition | undefined;
|
2404 | 'fill-extrusion-vertical-gradient'?: boolean | undefined;
|
2405 | }
|
2406 |
|
2407 | export interface LineLayout extends Layout {
|
2408 | 'line-cap'?: 'butt' | 'round' | 'square' | Expression | undefined;
|
2409 | 'line-join'?: 'bevel' | 'round' | 'miter' | Expression | undefined;
|
2410 | 'line-miter-limit'?: number | Expression | undefined;
|
2411 | 'line-round-limit'?: number | Expression | undefined;
|
2412 | 'line-sort-key'?: number | Expression | undefined;
|
2413 | }
|
2414 |
|
2415 | export interface LinePaint {
|
2416 | 'line-opacity'?: number | StyleFunction | Expression | undefined;
|
2417 | 'line-opacity-transition'?: Transition | undefined;
|
2418 | 'line-color'?: string | StyleFunction | Expression | undefined;
|
2419 | 'line-color-transition'?: Transition | undefined;
|
2420 | 'line-translate'?: number[] | Expression | undefined;
|
2421 | 'line-translate-transition'?: Transition | undefined;
|
2422 | 'line-translate-anchor'?: 'map' | 'viewport' | undefined;
|
2423 | 'line-width'?: number | StyleFunction | Expression | undefined;
|
2424 | 'line-width-transition'?: Transition | undefined;
|
2425 | 'line-gap-width'?: number | StyleFunction | Expression | undefined;
|
2426 | 'line-gap-width-transition'?: Transition | undefined;
|
2427 | 'line-offset'?: number | StyleFunction | Expression | undefined;
|
2428 | 'line-offset-transition'?: Transition | undefined;
|
2429 | 'line-blur'?: number | StyleFunction | Expression | undefined;
|
2430 | 'line-blur-transition'?: Transition | undefined;
|
2431 | 'line-dasharray'?: number[] | Expression | undefined;
|
2432 | 'line-dasharray-transition'?: Transition | undefined;
|
2433 | 'line-pattern'?: string | Expression | undefined;
|
2434 | 'line-pattern-transition'?: Transition | undefined;
|
2435 | 'line-gradient'?: Expression | undefined;
|
2436 | }
|
2437 |
|
2438 | export interface SymbolLayout extends Layout {
|
2439 | 'symbol-placement'?: 'point' | 'line' | 'line-center' | undefined;
|
2440 | 'symbol-spacing'?: number | Expression | undefined;
|
2441 | 'symbol-avoid-edges'?: boolean | undefined;
|
2442 | 'symbol-z-order'?: 'viewport-y' | 'source' | undefined;
|
2443 | 'icon-allow-overlap'?: boolean | StyleFunction | Expression | undefined;
|
2444 | 'icon-ignore-placement'?: boolean | Expression | undefined;
|
2445 | 'icon-optional'?: boolean | undefined;
|
2446 | 'icon-rotation-alignment'?: 'map' | 'viewport' | 'auto' | undefined;
|
2447 | 'icon-size'?: number | StyleFunction | Expression | undefined;
|
2448 | 'icon-text-fit'?: 'none' | 'both' | 'width' | 'height' | undefined;
|
2449 | 'icon-text-fit-padding'?: number[] | Expression | undefined;
|
2450 | 'icon-image'?: string | StyleFunction | Expression | undefined;
|
2451 | 'icon-rotate'?: number | StyleFunction | Expression | undefined;
|
2452 | 'icon-padding'?: number | Expression | undefined;
|
2453 | 'icon-keep-upright'?: boolean | undefined;
|
2454 | 'icon-offset'?: number[] | StyleFunction | Expression | undefined;
|
2455 | 'icon-anchor'?: Anchor | StyleFunction | Expression | undefined;
|
2456 | 'icon-pitch-alignment'?: 'map' | 'viewport' | 'auto' | undefined;
|
2457 | 'text-pitch-alignment'?: 'map' | 'viewport' | 'auto' | undefined;
|
2458 | 'text-rotation-alignment'?: 'map' | 'viewport' | 'auto' | undefined;
|
2459 | 'text-field'?: string | StyleFunction | Expression | undefined;
|
2460 | 'text-font'?: string[] | Expression | undefined;
|
2461 | 'text-size'?: number | StyleFunction | Expression | undefined;
|
2462 | 'text-max-width'?: number | StyleFunction | Expression | undefined;
|
2463 | 'text-line-height'?: number | Expression | undefined;
|
2464 | 'text-letter-spacing'?: number | Expression | undefined;
|
2465 | 'text-justify'?: 'auto' | 'left' | 'center' | 'right' | Expression | undefined;
|
2466 | 'text-anchor'?: Anchor | StyleFunction | Expression | undefined;
|
2467 | 'text-max-angle'?: number | Expression | undefined;
|
2468 | 'text-rotate'?: number | StyleFunction | Expression | undefined;
|
2469 | 'text-padding'?: number | Expression | undefined;
|
2470 | 'text-keep-upright'?: boolean | undefined;
|
2471 | 'text-transform'?: 'none' | 'uppercase' | 'lowercase' | StyleFunction | Expression | undefined;
|
2472 | 'text-offset'?: number[] | Expression | undefined;
|
2473 | 'text-allow-overlap'?: boolean | undefined;
|
2474 | 'text-ignore-placement'?: boolean | undefined;
|
2475 | 'text-optional'?: boolean | undefined;
|
2476 | 'text-radial-offset'?: number | Expression | undefined;
|
2477 | 'text-variable-anchor'?: Anchor[] | undefined;
|
2478 | 'text-writing-mode'?: ('horizontal' | 'vertical')[] | undefined;
|
2479 | 'symbol-sort-key'?: number | Expression | undefined;
|
2480 | }
|
2481 |
|
2482 | export interface SymbolPaint {
|
2483 | 'icon-opacity'?: number | StyleFunction | Expression | undefined;
|
2484 | 'icon-opacity-transition'?: Transition | undefined;
|
2485 | 'icon-color'?: string | StyleFunction | Expression | undefined;
|
2486 | 'icon-color-transition'?: Transition | undefined;
|
2487 | 'icon-halo-color'?: string | StyleFunction | Expression | undefined;
|
2488 | 'icon-halo-color-transition'?: Transition | undefined;
|
2489 | 'icon-halo-width'?: number | StyleFunction | Expression | undefined;
|
2490 | 'icon-halo-width-transition'?: Transition | undefined;
|
2491 | 'icon-halo-blur'?: number | StyleFunction | Expression | undefined;
|
2492 | 'icon-halo-blur-transition'?: Transition | undefined;
|
2493 | 'icon-translate'?: number[] | Expression | undefined;
|
2494 | 'icon-translate-transition'?: Transition | undefined;
|
2495 | 'icon-translate-anchor'?: 'map' | 'viewport' | undefined;
|
2496 | 'text-opacity'?: number | StyleFunction | Expression | undefined;
|
2497 | 'text-opacity-transition'?: Transition | undefined;
|
2498 | 'text-color'?: string | StyleFunction | Expression | undefined;
|
2499 | 'text-color-transition'?: Transition | undefined;
|
2500 | 'text-halo-color'?: string | StyleFunction | Expression | undefined;
|
2501 | 'text-halo-color-transition'?: Transition | undefined;
|
2502 | 'text-halo-width'?: number | StyleFunction | Expression | undefined;
|
2503 | 'text-halo-width-transition'?: Transition | undefined;
|
2504 | 'text-halo-blur'?: number | StyleFunction | Expression | undefined;
|
2505 | 'text-halo-blur-transition'?: Transition | undefined;
|
2506 | 'text-translate'?: number[] | Expression | undefined;
|
2507 | 'text-translate-transition'?: Transition | undefined;
|
2508 | 'text-translate-anchor'?: 'map' | 'viewport' | undefined;
|
2509 | }
|
2510 |
|
2511 | export interface RasterLayout extends Layout {}
|
2512 |
|
2513 | export interface RasterPaint {
|
2514 | 'raster-opacity'?: number | Expression | undefined;
|
2515 | 'raster-opacity-transition'?: Transition | undefined;
|
2516 | 'raster-hue-rotate'?: number | Expression | undefined;
|
2517 | 'raster-hue-rotate-transition'?: Transition | undefined;
|
2518 | 'raster-brightness-min'?: number | Expression | undefined;
|
2519 | 'raster-brightness-min-transition'?: Transition | undefined;
|
2520 | 'raster-brightness-max'?: number | Expression | undefined;
|
2521 | 'raster-brightness-max-transition'?: Transition | undefined;
|
2522 | 'raster-saturation'?: number | Expression | undefined;
|
2523 | 'raster-saturation-transition'?: Transition | undefined;
|
2524 | 'raster-contrast'?: number | Expression | undefined;
|
2525 | 'raster-contrast-transition'?: Transition | undefined;
|
2526 | 'raster-fade-duration'?: number | Expression | undefined;
|
2527 | 'raster-resampling'?: 'linear' | 'nearest' | undefined;
|
2528 | }
|
2529 |
|
2530 | export interface CircleLayout extends Layout {
|
2531 | 'circle-sort-key'?: number | Expression | undefined;
|
2532 | }
|
2533 |
|
2534 | export interface CirclePaint {
|
2535 | 'circle-radius'?: number | StyleFunction | Expression | undefined;
|
2536 | 'circle-radius-transition'?: Transition | undefined;
|
2537 | 'circle-color'?: string | StyleFunction | Expression | undefined;
|
2538 | 'circle-color-transition'?: Transition | undefined;
|
2539 | 'circle-blur'?: number | StyleFunction | Expression | undefined;
|
2540 | 'circle-blur-transition'?: Transition | undefined;
|
2541 | 'circle-opacity'?: number | StyleFunction | Expression | undefined;
|
2542 | 'circle-opacity-transition'?: Transition | undefined;
|
2543 | 'circle-translate'?: number[] | Expression | undefined;
|
2544 | 'circle-translate-transition'?: Transition | undefined;
|
2545 | 'circle-translate-anchor'?: 'map' | 'viewport' | undefined;
|
2546 | 'circle-pitch-scale'?: 'map' | 'viewport' | undefined;
|
2547 | 'circle-pitch-alignment'?: 'map' | 'viewport' | undefined;
|
2548 | 'circle-stroke-width'?: number | StyleFunction | Expression | undefined;
|
2549 | 'circle-stroke-width-transition'?: Transition | undefined;
|
2550 | 'circle-stroke-color'?: string | StyleFunction | Expression | undefined;
|
2551 | 'circle-stroke-color-transition'?: Transition | undefined;
|
2552 | 'circle-stroke-opacity'?: number | StyleFunction | Expression | undefined;
|
2553 | 'circle-stroke-opacity-transition'?: Transition | undefined;
|
2554 | }
|
2555 |
|
2556 | export interface HeatmapLayout extends Layout {}
|
2557 |
|
2558 | export interface HeatmapPaint {
|
2559 | 'heatmap-radius'?: number | StyleFunction | Expression | undefined;
|
2560 | 'heatmap-radius-transition'?: Transition | undefined;
|
2561 | 'heatmap-weight'?: number | StyleFunction | Expression | undefined;
|
2562 | 'heatmap-intensity'?: number | StyleFunction | Expression | undefined;
|
2563 | 'heatmap-intensity-transition'?: Transition | undefined;
|
2564 | 'heatmap-color'?: string | StyleFunction | Expression | undefined;
|
2565 | 'heatmap-opacity'?: number | StyleFunction | Expression | undefined;
|
2566 | 'heatmap-opacity-transition'?: Transition | undefined;
|
2567 | }
|
2568 |
|
2569 | export interface HillshadeLayout extends Layout {}
|
2570 |
|
2571 | export interface HillshadePaint {
|
2572 | 'hillshade-illumination-direction'?: number | Expression | undefined;
|
2573 | 'hillshade-illumination-anchor'?: 'map' | 'viewport' | undefined;
|
2574 | 'hillshade-exaggeration'?: number | Expression | undefined;
|
2575 | 'hillshade-exaggeration-transition'?: Transition | undefined;
|
2576 | 'hillshade-shadow-color'?: string | Expression | undefined;
|
2577 | 'hillshade-shadow-color-transition'?: Transition | undefined;
|
2578 | 'hillshade-highlight-color'?: string | Expression | undefined;
|
2579 | 'hillshade-highlight-color-transition'?: Transition | undefined;
|
2580 | 'hillshade-accent-color'?: string | Expression | undefined;
|
2581 | 'hillshade-accent-color-transition'?: Transition | undefined;
|
2582 | }
|
2583 |
|
2584 | export interface SkyLayout extends Layout {}
|
2585 |
|
2586 | export interface SkyPaint {
|
2587 | 'sky-atmosphere-color'?: string | Expression | undefined;
|
2588 | 'sky-atmosphere-halo-color'?: string | Expression | undefined;
|
2589 | 'sky-atmosphere-sun'?: number[] | Expression | undefined;
|
2590 | 'sky-atmosphere-sun-intensity'?: number | Expression | undefined;
|
2591 | 'sky-gradient'?: string | Expression | undefined;
|
2592 | 'sky-gradient-center'?: number[] | Expression | undefined;
|
2593 | 'sky-gradient-radius'?: number | Expression | undefined;
|
2594 | 'sky-opacity'?: number | Expression | undefined;
|
2595 | 'sky-type'?: 'gradient' | 'atmosphere' | undefined;
|
2596 | }
|
2597 |
|
2598 | export type ElevationQueryOptions = {
|
2599 | exaggerated: boolean;
|
2600 | };
|
2601 | }
|
2602 |
|
\ | No newline at end of file |