-
Notifications
You must be signed in to change notification settings - Fork 9
/
mapbox-gl.d.ts
934 lines (679 loc) · 21.9 KB
/
mapbox-gl.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
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
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
// Type definitions for Mapbox GL JS v0.18.0
// Project: https://github.com/mapbox/mapbox-gl-js
// Definitions by: Dominik Bruderer <https://github.com/dobrud>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare namespace mapboxgl {
let accessToken: string;
let version: string;
export function supported(options?: {failIfMajorPerformanceCaveat?: boolean}): boolean;
/**
* Map
*/
export class Map extends Evented {
constructor(options?: MapboxOptions);
addControl(control: Control): this;
addClass(klass: string, options?: mapboxgl.StyleOptions): this;
removeClass(klass: string, options?: mapboxgl.StyleOptions): this;
setClasses(klasses: string[], options?: mapboxgl.StyleOptions): this;
hasClass(klass: string): boolean;
getClasses(): string[];
resize(): this;
getBounds(): mapboxgl.LngLatBounds;
setMaxBounds(lnglatbounds?: mapboxgl.LngLatBounds | number[][]): this;
setMinZoom(minZoom?: number): this;
setMaxZoom(maxZoom?: number): this;
project(lnglat: mapboxgl.LngLat | number[]): mapboxgl.Point;
unproject(point: mapboxgl.Point | number[]): mapboxgl.LngLat;
queryRenderedFeatures(pointOrBox?: mapboxgl.Point|number[]|mapboxgl.Point[]|number[][], parameters?: {layers?: string[], filter?: any[]}): GeoJSON.Feature<GeoJSON.GeometryObject>[];
querySourceFeatures(sourceID: string, parameters: {sourceLayer?: string, filter?: any[]}): GeoJSON.Feature<GeoJSON.GeometryObject>[];
setStyle(style: mapboxgl.Style | string): this;
getStyle(): mapboxgl.Style;
addSource(id: string, source: VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource | GeoJSONSourceRaw): this;
removeSource(id: string): this;
getSource(id: string): VectorSource | RasterSource | GeoJSONSource | ImageSource | VideoSource;
addLayer(layer: mapboxgl.Layer, before?: string): this;
removeLayer(id: string): this;
getLayer(id: string): mapboxgl.Layer;
setFilter(layer: string, filter: any[]): this;
setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
getFilter(layer: string): any[];
setPaintProperty(layer: string, name: string, value: any, klass?: string): this;
getPaintProperty(layer: string, name: string, klass?: string): any;
setLayoutProperty(layer: string, name: string, value: any): this;
getLayoutProperty(layer: string, name: string, klass?: string): any;
getContainer(): HTMLElement;
getCanvasContainer(): HTMLElement;
getCanvas(): HTMLCanvasElement;
loaded(): boolean;
remove(): void;
onError(): void;
showTileBoundaries: boolean;
showCollisionBoxes: boolean;
repaint: boolean;
getCenter(): mapboxgl.LngLat;
setCenter(center: LngLat|number[], eventData?: mapboxgl.EventData): this;
panBy(offset: number[], options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
panTo(lnglat: mapboxgl.LngLat, options?: mapboxgl.AnimationOptions, eventdata?: mapboxgl.EventData): this;
getZoom(): number;
setZoom(zoom: number, eventData?: mapboxgl.EventData): this;
zoomTo(zoom: number, options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
zoomIn(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
zoomOut(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
getBearing(): number;
setBearing(bearing: number, eventData?: mapboxgl.EventData): this;
rotateTo(bearing: number, options?: mapboxgl.AnimationOptions, eventData?: EventData): this;
resetNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
snapToNorth(options?: mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
getPitch(): number;
setPitch(pitch: number, eventData?: EventData): this;
fitBounds(bounds: mapboxgl.LngLatBounds | number[][], options?: { linear?: boolean, easing?: Function, padding?: number, offset?: Point|number[],maxZoom?: number }): this;
jumpTo(options: mapboxgl.CameraOptions, eventData?: mapboxgl.EventData): this;
easeTo(options: mapboxgl.CameraOptions | mapboxgl.AnimationOptions, eventData?: mapboxgl.EventData): this;
flyTo(options: mapboxgl.FlyToOptions, eventData?: mapboxgl.EventData): this;
stop(): this;
scrollZoom: ScrollZoomHandler;
boxZoom: BoxZoomHandler;
dragRotate: DragRotateHandler;
dragPan: DragPanHandler;
keyboard: KeyboardHandler;
doublClickZoom: DoubleClickZoomHandler;
touchZoomRotate: TouchZoomRotateHandler;
}
export interface MapboxOptions {
/** If true, an attribution control will be added to the map. */
attributionControl?: boolean;
bearing?: number;
/** Snap to north threshold in degrees. */
bearingSnap?: number;
/** If true, enable the "box zoom" interaction (see BoxZoomHandler) */
boxZoom?: boolean;
/** initial map center */
center?: mapboxgl.LngLat | number[];
/** Style class names with which to initialize the map */
classes?: string[];
/** ID of the container element */
container?: string | Element;
/** If true, enable the "drag to pan" interaction (see DragPanHandler). */
dragPan?: boolean;
/** If true, enable the "drag to rotate" interaction (see DragRotateHandler). */
dragRotate?: boolean;
/** If true, enable the "double click to zoom" interaction (see DoubleClickZoomHandler). */
doubleClickZoom?: boolean;
/** If true, the map will track and update the page URL according to map position */
hash?: boolean;
/** If true, map creation will fail if the implementation determines that the performance of the created WebGL context would be dramatically lower than expected. */
failIfMayorPerformanceCaveat?: boolean;
/** If false, no mouse, touch, or keyboard listeners are attached to the map, so it will not respond to input */
interactive?: boolean;
/** If true, enable keyboard shortcuts (see KeyboardHandler). */
keyboard?: boolean;
/** If set, the map is constrained to the given bounds. */
maxBounds?: mapboxgl.LngLatBounds | number[][];
/** Maximum zoom of the map */
maxZoom?: number;
/** Minimum zoom of the map */
minZoom?: number;
/** If true, The maps canvas can be exported to a PNG using map.getCanvas().toDataURL();. This is false by default as a performance optimization. */
preserveDrawingBuffer?: boolean;
pitch?: number;
/** If true, enable the "scroll to zoom" interaction */
scrollZoom?: boolean;
/** stylesheet location */
style?: mapboxgl.Style | string;
/** If true, the map will automatically resize when the browser window resizes */
trackResize?: boolean;
/** If true, enable the "pinch to rotate and zoom" interaction (see TouchZoomRotateHandler). */
touchZoomRotate?: boolean;
/** Initial zoom level */
zoom?: number;
}
/**
* BoxZoomHandler
*/
export class BoxZoomHandler {
constructor(map: mapboxgl.Map);
isEnabled(): boolean;
isActive(): boolean;
enable(): void;
disable(): void;
}
/**
* ScrollZoomHandler
*/
export class ScrollZoomHandler {
constructor(map: mapboxgl.Map);
isEnabled(): boolean;
enable(): void;
disable(): void;
}
/**
* DragPenHandler
*/
export class DragPanHandler {
constructor(map: mapboxgl.Map);
isEnabled(): boolean;
isActive(): boolean;
enable(): void;
disable(): void;
}
/**
* DragRotateHandler
*/
export class DragRotateHandler {
constructor(map: mapboxgl.Map, options?: {bearingSnap?: number, pitchWithRotate?: boolean});
isEnabled(): boolean;
isActive(): boolean;
enable(): void;
disable(): void;
}
/**
* KeyboardHandler
*/
export class KeyboardHandler {
constructor(map: mapboxgl.Map);
isEnabled(): boolean;
enable(): void;
disable(): void;
}
/**
* DoubleClickZoomHandler
*/
export class DoubleClickZoomHandler {
constructor(map: mapboxgl.Map);
isEnabled(): boolean;
enable(): void;
disable(): void;
}
/**
* TouchZoomRotateHandler
*/
export class TouchZoomRotateHandler {
constructor(map: mapboxgl.Map);
isEnabled(): boolean;
enable(): void;
disable(): void;
disableRotation(): void;
enableRotation(): void;
}
/**
* Control
*/
export class Control extends Evented {
addTo(map: mapboxgl.Map): this;
remove(): this;
}
/**
* ControlOptions
*/
export interface ControlOptions {
position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
}
/**
* Navigation
*/
export class Navigation extends Control {
constructor(options?: mapboxgl.ControlOptions);
}
/**
* Geolocate
*/
export class Geolocate extends Control {
constructor(options?: mapboxgl.ControlOptions);
}
/**
* Attribution
*/
export class Attribution extends Control {
constructor(options?: mapboxgl.ControlOptions);
}
/**
* Scale
*/
export class Scale extends Control {
constructor(options?: {position?: 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left', maxWidth?: number, unit?: string})
}
/**
* Popup
*/
export class Popup extends Evented {
constructor(options?: mapboxgl.PopupOptions);
addTo(map: mapboxgl.Map): this;
isOpen(): boolean;
remove(): this;
getLngLat(): mapboxgl.LngLat;
setLngLat(lnglat: mapboxgl.LngLat | number[]): this;
setText(text: string): this;
setHTML(html: string): this;
setDOMContent(htmlNode: Node): this;
}
export interface PopupOptions {
closeButton?: boolean;
closeOnClick?: boolean;
anchor?: 'top' | 'bottom' | 'left' | 'right' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right';
offset?: number | Point | number[] | { [key:string]: Point | number[];};
}
export interface Style {
bearing?: number;
center?: number[];
glyphs?: string;
layers?: Layer[];
metadata?: any;
name?: string;
pitch?: number;
sources?: any;
sprite?: string;
transition?: Transition;
version: number;
zoom?: number;
}
export interface Transition {
delay?: number;
duration?: number;
}
export interface Source {
type: "vector" | "raster" | "geojson" | "image" | "video";
}
/**
* GeoJSONSource
*/
export interface GeoJSONSourceRaw extends Source, GeoJSONSourceOptions {
type: "geojson";
}
export class GeoJSONSource implements GeoJSONSourceRaw {
type: "geojson";
constructor(options?: mapboxgl.GeoJSONSourceOptions);
setData(data: GeoJSON.Feature<GeoJSON.GeometryObject> | GeoJSON.FeatureCollection<GeoJSON.GeometryObject> | String): this;
}
export interface GeoJSONSourceOptions {
data?: GeoJSON.Feature<GeoJSON.GeometryObject> | GeoJSON.FeatureCollection<GeoJSON.GeometryObject> | string;
maxzoom?: number;
buffer?: number;
tolerance?: number;
cluster?: number | boolean;
clusterRadius?: number;
clusterMaxZoom?: number;
}
/**
* VideoSource
*/
export class VideoSource implements Source, VideoSourceOptions {
type: "video";
constructor(options?: mapboxgl.VideoSourceOptions);
getVideo(): HTMLVideoElement;
setCoordinates(coordinates: number[][]): this;
}
export interface VideoSourceOptions {
urls?: string[];
coordinates?: number[][];
}
/**
* ImageSource
*/
export class ImageSource implements Source, ImageSourceOptions {
type: "image";
constructor(options?: mapboxgl.ImageSourceOptions);
setCoordinates(coordinates: number[][]): this;
}
export interface ImageSourceOptions {
url?: string;
coordinates?: number[][];
}
interface VectorSource extends Source {
type: "vector";
url?: string;
tiles?: string[];
minzoom?: number;
maxzoom?: number;
}
interface RasterSource extends Source {
type: "raster";
url: string;
tiles?: string[];
minzoom?: number;
maxzoom?: number;
tileSize?: number;
}
/**
* LngLat
*/
export class LngLat {
lng: number;
lat: number;
constructor(lng: number, lat: number);
/** Return a new LngLat object whose longitude is wrapped to the range (-180, 180). */
wrap(): mapboxgl.LngLat;
/** Return a LngLat as an array */
toArray(): number[];
/** Return a LngLat as a string */
toString(): string;
static convert(input: number[]|mapboxgl.LngLat): mapboxgl.LngLat;
}
/**
* LngLatBounds
*/
export class LngLatBounds {
sw: LngLat | number[];
ne: LngLat | number[];
constructor(sw?: LngLat, ne?: LngLat);
/** Extend the bounds to include a given LngLat or LngLatBounds. */
extend(obj: mapboxgl.LngLat | mapboxgl.LngLatBounds): this;
/** Get the point equidistant from this box's corners */
getCenter(): mapboxgl.LngLat;
/** Get southwest corner */
getSouthWest(): mapboxgl.LngLat;
/** Get northeast corner */
getNorthEast(): mapboxgl.LngLat;
/** Get northwest corner */
getNorthWest(): mapboxgl.LngLat;
/** Get southeast corner */
getSouthEast(): mapboxgl.LngLat;
/** Get west edge longitude */
getWest(): number;
/** Get south edge latitude */
getSouth(): number;
/** Get east edge longitude */
getEast(): number;
/** Get north edge latitude */
getNorth(): number;
/** Returns a LngLatBounds as an array */
toArray(): number[][];
/** Return a LngLatBounds as a string */
toString(): string;
/** Convert an array to a LngLatBounds object, or return an existing LngLatBounds object unchanged. */
static convert(input: mapboxgl.LngLatBounds | number[] | number[][]): mapboxgl.LngLatBounds;
}
/**
* Point
*/
// Todo: Pull out class to seperate definition for Module "point-geometry"
export class Point {
constructor(options?: Object);
clone(): Point;
add(p: number): Point;
sub(p: number): Point;
mult(k: number): Point;
div(k: number): Point;
rotate(a: number): Point;
matMult(m: number): Point;
unit(): Point;
perp(): Point;
round(): Point;
mag(): number;
equals(): boolean;
dist(): number;
distSqr(): number;
angle(): number;
angleTo(): number;
angleWidth(): number;
angleWidthSep(): number;
}
export class Marker {
constructor(element?: HTMLElement, options?: { offset?: Point | number[] });
addTo(map: Map): this;
remove(): this;
getLngLat(): LngLat;
setLngLat(lngLat: LngLat | number[]): this;
setPopup(popup?: Popup): this;
getPopup(): Popup;
togglePopup(): this;
}
/**
* Evented
*/
export class Evented {
on(type: string, listener: Function): this;
off(type?: string | any, listener?: Function): this;
once(type: string, listener: Function): this;
fire(type: string, data?: mapboxgl.EventData | Object): this;
listens(type: string): boolean;
}
/**
* StyleOptions
*/
export interface StyleOptions {
transition?: boolean;
}
/**
* EventData
*/
export class EventData {
type: string;
target: Map;
originalEvent: Event;
point: mapboxgl.Point;
lngLat: mapboxgl.LngLat;
}
export class MapMouseEvent {
type: string;
target: Map;
originalEvent: MouseEvent;
point: mapboxgl.Point;
lngLat: mapboxgl.LngLat;
}
export class MapTouchEvent {
type: string;
target: Map;
originalEvent: TouchEvent;
point: mapboxgl.Point;
lngLat: mapboxgl.LngLat;
points: Array<Point>;
lngLats: Array<LngLat>;
}
export class MapBoxZoomEvent {
originalEvent: MouseEvent;
boxZoomBounds: LngLatBounds;
}
/**
* AnimationOptions
*/
export interface AnimationOptions {
/** Number in milliseconds */
duration?: number;
easing?: Function;
/** point, origin of movement relative to map center */
offset?: Point | number[];
/** When set to false, no animation happens */
animate?: boolean;
}
/**
* CameraOptions
*/
export interface CameraOptions {
/** Map center */
center?: mapboxgl.LngLat | number[];
/** Map zoom level */
zoom?: number;
/** Map rotation bearing in degrees counter-clockwise from north */
bearing?: number;
/** Map angle in degrees at which the camera is looking at the ground */
pitch?: number;
/** If zooming, the zoom center (defaults to map center) */
around?: mapboxgl.LngLat | number[];
}
/**
* FlyToOptions
*/
export interface FlyToOptions extends AnimationOptions, CameraOptions {
curve?: number;
minZoom?: number;
speed?: number;
screenSpeed?: number;
easing?: Function;
}
/**
* MapEvent
*/
export interface MapEvent {
webglcontextlost?: {originalEvent: WebGLContextEvent};
webglcontextrestored?: {originalEvent: WebGLContextEvent};
render?: void;
contextmenu?: {data: mapboxgl.MapMouseEvent};
dblclick?: {data: mapboxgl.MapMouseEvent};
click?: {data: mapboxgl.MapMouseEvent};
touchcancel?: {data: mapboxgl.MapTouchEvent};
touchmove?: {data: mapboxgl.MapTouchEvent};
touchend?: {data: mapboxgl.MapTouchEvent};
touchstart?: {data: mapboxgl.MapTouchEvent};
mousemove?: {data: mapboxgl.MapMouseEvent};
mouseup?: {data: mapboxgl.MapMouseEvent};
mousedown?: {data: mapboxgl.MapMouseEvent};
moveend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
move?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
movestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
mouseout?:{data: mapboxgl.MapMouseEvent};
load?: void;
zoomend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
zoom?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
zoomstart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
boxzoomcancel?: {data: mapboxgl.MapBoxZoomEvent};
boxzoomstart?: {data: mapboxgl.MapBoxZoomEvent};
boxzoomend?: {data: mapboxgl.MapBoxZoomEvent};
rotate?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
rotatestart?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
rotateend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
drag?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
dragend?: {data: mapboxgl.MapMouseEvent | mapboxgl.MapTouchEvent};
pitch?: {data: mapboxgl.EventData};
}
export interface Layer {
id: string;
type?: "fill" | "line" | "symbol" | "circle" | "raster" | "background" | string; //TODO: Ideally we wouldn't accept string here, just these specific strings
metadata?: any;
ref?: string;
source?: string;
"source-layer"?: string;
minzoom?: number;
maxzoom?: number;
interactive?: boolean;
filter?: Array<any>;
layout?: BackgroundLayout | FillLayout | LineLayout | SymbolLayout | RasterLayout | CircleLayout;
paint?: BackgroundPaint | FillPaint | LinePaint | SymbolPaint | RasterPaint | CirclePaint;
}
export interface StyleFunction {
stops: Array<Array<any>>;
property?: string;
base?: number;
type?: "continuous" | "interval" | "categorical";
}
export interface BackgroundLayout {
visibility?: "visible" | "none";
}
export interface BackgroundPaint {
"background-color"?: string;
"background-pattern"?: string;
"background-opacity"?: number;
}
export interface FillLayout {
visibility?: "visible" | "none";
}
export interface FillPaint {
"fill-antialias"?: boolean;
"fill-opacity"?: number | StyleFunction;
"fill-color"?: string | StyleFunction;
"fill-outline-color": string | StyleFunction;
"fill-translate"?: Array<number>;
"fill-translate-anchor"?: "map" | "viewport";
"fill-pattern"?: "string";
}
export interface LineLayout {
visibility?: "visible" | "none";
"line-cap"?: "butt" | "round" | "square";
"line-join"?: "bevel" | "round" | "miter";
"line-miter-limit"?: number;
"line-round-limit"?: number;
}
export interface LinePaint {
"line-opacity"?: number;
"line-color"?: string| StyleFunction;
"line-translate"?: Array<number>;
"line-translate-anchor"?: "map" | "viewport";
"line-width"?: number;
"line-gap-width"?: number;
"line-offset"?: number;
"line-blur"?: number;
"line-dasharray"?: Array<number>;
"line-dasharray-transition"?: Transition;
"line-pattern"?: string;
}
export interface SymbolLayout {
visibility?: "visible" | "none";
"symbol-placement"?: "point" | "line";
"symbol-spacing"?: number;
"symbol-avoid-edges"?: boolean;
"icon-allow-overlap"?: boolean;
"icon-ignore-placement"?: boolean;
"icon-optional"?: boolean;
"icon-rotation-alignment"?: "map" | "viewport" | "auto";
"icon-size"?: number;
"icon-text-fit"?: "none" | "both" | "width" | "height";
"icon-text-fit-padding"?: Array<number>;
"icon-image"?: string;
"icon-rotate"?: number | StyleFunction;
"icon-padding"?: number;
"icon-keep-upright"?: boolean;
"icon-offset"?: Array<number>;
"text-pitch-alignment"?: "map" | "viewport" | "auto";
"text-rotation-alignment"?: "map" | "viewport" | "auto";
"text-field"?: string;
"text-font"?: string | string[];
"text-size"?: number;
"text-max-width"?: number;
"text-line-height"?: number;
"text-letter-spacing"?: number;
"text-justify"?: "left" | "center" | "right";
"text-anchor"?: "center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
"text-max-angle"?: number;
"text-rotate"?: number;
"text-padding"?: number;
"text-keep-upright"?: boolean;
"text-transform"?: "none" | "uppercase" | "lowercase";
"text-offset"?: Array<number>;
"text-allow-overlap"?: boolean;
"text-ignore-placement"?: boolean;
"text-optional"?: boolean;
}
export interface SymbolPaint {
"icon-opacity"?: number;
"icon-color"?: string;
"icon-halo-color"?: string;
"icon-halo-width"?: number;
"icon-halo-blur"?: number;
"icon-translate"?: Array<number>;
"icon-translate-anchor"?: "map" | "viewport";
"text-opacity"?: number;
"text-color"?: "string";
"text-halo-color"?: "string";
"text-halo-width"?: number;
"text-halo-blur"?: number;
"text-translate"?: Array<number>;
"text-translate-anchor"?: "map" | "viewport";
}
export interface RasterLayout {
visibility?: "visible" | "none";
}
export interface RasterPaint {
"raster-opacity"?: number;
"raster-hue-rotate"?: number;
"raster-brightness-min"?: number;
"raster-brightness-max"?: number;
"raster-saturation"?: number;
"raster-contrast"?: number;
"raster-fade-duration"?: number;
}
export interface CircleLayout {
visibility?: "visible" | "none";
}
export interface CirclePaint {
"circle-radius"?: number | StyleFunction;
"circle-radius-transition"?: Transition;
"circle-color"?: number | StyleFunction;
"circle-blur"?: number | StyleFunction;
"circle-opacity"?: number | StyleFunction;
"circle-translate"?: Array<number>;
"circle-translate-anchor"?: "map" | "viewport";
"circle-pitch-scale"?: "map" | "viewport";
}
}
declare module 'mapbox-gl' {
export = mapboxgl;
}