@maptiler/sdk 2.2.1 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/biome.json +2 -1
  2. package/dist/maptiler-sdk.css +0 -1
  3. package/dist/maptiler-sdk.d.ts +1 -1785
  4. package/dist/maptiler-sdk.mjs +1782 -2617
  5. package/dist/maptiler-sdk.mjs.map +1 -1
  6. package/dist/src/MLAdapters/AttributionControl.d.ts +6 -0
  7. package/dist/src/MLAdapters/BoxZoomHandler.d.ts +8 -0
  8. package/dist/src/MLAdapters/CanvasSource.d.ts +6 -0
  9. package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +6 -0
  10. package/dist/src/MLAdapters/FullscreenControl.d.ts +6 -0
  11. package/dist/src/MLAdapters/GeoJSONSource.d.ts +6 -0
  12. package/dist/src/MLAdapters/GeolocateControl.d.ts +6 -0
  13. package/dist/src/MLAdapters/ImageSource.d.ts +6 -0
  14. package/dist/src/MLAdapters/KeyboardHandler.d.ts +6 -0
  15. package/dist/src/MLAdapters/LogoControl.d.ts +6 -0
  16. package/dist/src/MLAdapters/MapMouseEvent.d.ts +6 -0
  17. package/dist/src/MLAdapters/MapTouchEvent.d.ts +6 -0
  18. package/dist/src/MLAdapters/MapWheelEvent.d.ts +6 -0
  19. package/dist/src/MLAdapters/Marker.d.ts +6 -0
  20. package/dist/src/MLAdapters/NavigationControl.d.ts +6 -0
  21. package/dist/src/MLAdapters/Popup.d.ts +6 -0
  22. package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +6 -0
  23. package/dist/src/MLAdapters/RasterTileSource.d.ts +6 -0
  24. package/dist/src/MLAdapters/ScaleControl.d.ts +6 -0
  25. package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +6 -0
  26. package/dist/src/MLAdapters/Style.d.ts +6 -0
  27. package/dist/src/MLAdapters/TerrainControl.d.ts +6 -0
  28. package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +6 -0
  29. package/dist/src/MLAdapters/VectorTileSource.d.ts +6 -0
  30. package/dist/src/MLAdapters/VideoSource.d.ts +6 -0
  31. package/dist/src/Map.d.ts +349 -0
  32. package/dist/src/MaptilerGeolocateControl.d.ts +21 -0
  33. package/dist/src/MaptilerLogoControl.d.ts +20 -0
  34. package/dist/src/MaptilerNavigationControl.d.ts +18 -0
  35. package/dist/src/MaptilerTerrainControl.d.ts +17 -0
  36. package/dist/src/Minimap.d.ts +58 -0
  37. package/dist/src/Point.d.ts +177 -0
  38. package/dist/src/caching.d.ts +5 -0
  39. package/dist/src/colorramp.d.ts +359 -0
  40. package/dist/src/config.d.ts +68 -0
  41. package/dist/src/converters/index.d.ts +1 -0
  42. package/dist/src/converters/xml.d.ts +54 -0
  43. package/dist/src/defaults.d.ts +14 -0
  44. package/dist/src/helpers/index.d.ts +14 -0
  45. package/dist/src/helpers/screenshot.d.ts +19 -0
  46. package/dist/src/helpers/stylehelper.d.ts +29 -0
  47. package/dist/src/helpers/vectorlayerhelpers.d.ts +509 -0
  48. package/dist/src/index.d.ts +89 -0
  49. package/dist/src/language.d.ts +108 -0
  50. package/dist/src/mapstyle.d.ts +3 -0
  51. package/dist/src/tools.d.ts +46 -0
  52. package/dist/src/unit.d.ts +1 -0
  53. package/package.json +15 -21
  54. package/readme.md +31 -0
  55. package/tsconfig.json +21 -8
  56. package/vite.config-es.ts +48 -0
  57. package/vite.config-umd.ts +27 -0
  58. package/.github/pull_request_template.md +0 -11
  59. package/.github/workflows/format-lint.yml +0 -21
  60. package/.github/workflows/npm-publish.yml +0 -22
  61. package/dist/maptiler-sdk.min.mjs +0 -3
  62. package/rollup.config.js +0 -147
@@ -0,0 +1,58 @@
1
+ import { Map as SDKMap, MapOptions } from './Map';
2
+ import { ControlPosition, CustomLayerInterface, FillLayerSpecification, FilterSpecification, IControl, LayerSpecification, LineLayerSpecification, SourceSpecification, StyleOptions, StyleSetterOptions, StyleSpecification, StyleSwapOptions } from 'maplibre-gl';
3
+ import { MapStyleVariant, ReferenceMapStyle } from '@maptiler/client';
4
+
5
+ export interface ParentRect {
6
+ lineLayout: LineLayerSpecification["layout"];
7
+ linePaint: LineLayerSpecification["paint"];
8
+ fillPaint: FillLayerSpecification["paint"];
9
+ }
10
+ export interface MinimapOptionsInput {
11
+ /**
12
+ * Style of the map. Can be:
13
+ * - a full style URL (possibly with API key)
14
+ * - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
15
+ * - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
16
+ */
17
+ style?: ReferenceMapStyle | MapStyleVariant | StyleSpecification | string;
18
+ /**
19
+ * Set the zoom difference between the parent and the minimap
20
+ * If the parent is zoomed to 10 and the minimap is zoomed to 8, the zoomAdjust should be 2
21
+ * Default: -4
22
+ */
23
+ zoomAdjust?: number;
24
+ /** Set a zoom of the minimap and don't allow any future changes */
25
+ lockZoom?: number;
26
+ /** Adjust the pitch only if the user requests */
27
+ pitchAdjust?: boolean;
28
+ /** Set CSS properties of the container using object key-values */
29
+ containerStyle?: Record<string, string>;
30
+ /** Set the position of the minimap at either "top-left", "top-right", "bottom-left", or "bottom-right" */
31
+ position?: ControlPosition;
32
+ /** Set the parentRect fill and/or line options */
33
+ parentRect?: ParentRect;
34
+ }
35
+ export interface MinimapOptions extends MapOptions {
36
+ zoomAdjust: number;
37
+ pitchAdjust: boolean;
38
+ containerStyle: Record<string, string>;
39
+ parentRect?: ParentRect;
40
+ }
41
+ export default class Minimap implements IControl {
42
+ #private;
43
+ map: SDKMap;
44
+ constructor(options: MinimapOptionsInput, mapOptions: MapOptions);
45
+ setStyle(style: null | ReferenceMapStyle | MapStyleVariant | StyleSpecification | string, options?: StyleSwapOptions & StyleOptions): void;
46
+ addLayer(layer: (LayerSpecification & {
47
+ source?: string | SourceSpecification;
48
+ }) | CustomLayerInterface, beforeId?: string): SDKMap;
49
+ moveLayer(id: string, beforeId?: string): SDKMap;
50
+ removeLayer(id: string): this;
51
+ setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
52
+ setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): this;
53
+ setPaintProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
54
+ setLayoutProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
55
+ setGlyphs(glyphsUrl: string | null, options?: StyleSetterOptions): this;
56
+ onAdd(parentMap: SDKMap): HTMLElement;
57
+ onRemove(): void;
58
+ }
@@ -0,0 +1,177 @@
1
+ /**
2
+ * This is TypeScript rewrite of the Point class to use instead of the version imported in MapLibre.
3
+ * It also uses a class instead of prototypes.
4
+ */
5
+ /**
6
+ * Row major 2x2 matrix
7
+ */
8
+ export type Matrix2 = [number, number, number, number];
9
+ /**
10
+ * a point
11
+ */
12
+ export declare class Point {
13
+ x: number;
14
+ y: number;
15
+ constructor(x: number, y: number);
16
+ private _matMult;
17
+ private _add;
18
+ private _sub;
19
+ private _mult;
20
+ private _div;
21
+ private _multByPoint;
22
+ private _divByPoint;
23
+ private _unit;
24
+ private _perp;
25
+ private _rotate;
26
+ private _rotateAround;
27
+ private _round;
28
+ /**
29
+ * Clone this point, returning a new point that can be modified
30
+ * without affecting the old one.
31
+ * @return {Point} the clone
32
+ */
33
+ clone(): Point;
34
+ /**
35
+ * Add this point's x & y coordinates to another point,
36
+ * yielding a new point.
37
+ * @param {Point} p the other point
38
+ * @return {Point} output point
39
+ */
40
+ add(p: Point): Point;
41
+ /**
42
+ * Subtract this point's x & y coordinates to from point,
43
+ * yielding a new point.
44
+ * @param {Point} p the other point
45
+ * @return {Point} output point
46
+ */
47
+ sub(p: Point): Point;
48
+ /**
49
+ * Multiply this point's x & y coordinates by point,
50
+ * yielding a new point.
51
+ * @param {Point} p the other point
52
+ * @return {Point} output point
53
+ */
54
+ multByPoint(p: Point): Point;
55
+ /**
56
+ * Divide this point's x & y coordinates by point,
57
+ * yielding a new point.
58
+ * @param {Point} p the other point
59
+ * @return {Point} output point
60
+ */
61
+ divByPoint(p: Point): Point;
62
+ /**
63
+ * Multiply this point's x & y coordinates by a factor,
64
+ * yielding a new point.
65
+ * @param {Number} k factor
66
+ * @return {Point} output point
67
+ */
68
+ mult(k: number): Point;
69
+ /**
70
+ * Divide this point's x & y coordinates by a factor,
71
+ * yielding a new point.
72
+ * @param {Point} k factor
73
+ * @return {Point} output point
74
+ */
75
+ div(k: number): Point;
76
+ /**
77
+ * Rotate this point around the 0, 0 origin by an angle a,
78
+ * given in radians
79
+ * @param {Number} a angle to rotate around, in radians
80
+ * @return {Point} output point
81
+ */
82
+ rotate(a: number): Point;
83
+ /**
84
+ * Rotate this point around p point by an angle a,
85
+ * given in radians
86
+ * @param {Number} a angle to rotate around, in radians
87
+ * @param {Point} p Point to rotate around
88
+ * @return {Point} output point
89
+ */
90
+ rotateAround(a: number, p: Point): Point;
91
+ /**
92
+ * Multiply this point by a 4x1 transformation matrix
93
+ * @param {Array<Number>} m transformation matrix
94
+ * @return {Point} output point
95
+ */
96
+ matMult(m: Matrix2): Point;
97
+ /**
98
+ * Calculate this point but as a unit vector from 0, 0, meaning
99
+ * that the distance from the resulting point to the 0, 0
100
+ * coordinate will be equal to 1 and the angle from the resulting
101
+ * point to the 0, 0 coordinate will be the same as before.
102
+ * @return {Point} unit vector point
103
+ */
104
+ unit(): Point;
105
+ /**
106
+ * Compute a perpendicular point, where the new y coordinate
107
+ * is the old x coordinate and the new x coordinate is the old y
108
+ * coordinate multiplied by -1
109
+ * @return {Point} perpendicular point
110
+ */
111
+ perp(): Point;
112
+ /**
113
+ * Return a version of this point with the x & y coordinates
114
+ * rounded to integers.
115
+ * @return {Point} rounded point
116
+ */
117
+ round(): Point;
118
+ /**
119
+ * Return the magnitude of this point: this is the Euclidean
120
+ * distance from the 0, 0 coordinate to this point's x and y
121
+ * coordinates.
122
+ * @return {Number} magnitude
123
+ */
124
+ mag(): number;
125
+ /**
126
+ * Judge whether this point is equal to another point, returning
127
+ * true or false.
128
+ * @param {Point} other the other point
129
+ * @return {boolean} whether the points are equal
130
+ */
131
+ equals(other: Point): boolean;
132
+ /**
133
+ * Calculate the distance from this point to another point
134
+ * @param {Point} p the other point
135
+ * @return {Number} distance
136
+ */
137
+ dist(p: Point): number;
138
+ /**
139
+ * Calculate the distance from this point to another point,
140
+ * without the square root step. Useful if you're comparing
141
+ * relative distances.
142
+ * @param {Point} p the other point
143
+ * @return {Number} distance
144
+ */
145
+ distSqr(p: Point): number;
146
+ /**
147
+ * Get the angle from the 0, 0 coordinate to this point, in radians
148
+ * coordinates.
149
+ * @return {Number} angle
150
+ */
151
+ angle(): number;
152
+ /**
153
+ * Get the angle from this point to another point, in radians
154
+ * @param {Point} b the other point
155
+ * @return {Number} angle
156
+ */
157
+ angleTo(b: Point): number;
158
+ /**
159
+ * Get the angle between this point and another point, in radians
160
+ * @param {Point} b the other point
161
+ * @return {Number} angle
162
+ */
163
+ angleWith(b: Point): number;
164
+ angleWithSep(x: number, y: number): number;
165
+ /**
166
+ * Construct a point from an array if necessary, otherwise if the input
167
+ * is already a Point, or an unknown type, return it unchanged
168
+ * @param {Array<number> | Point} a any kind of input value
169
+ * @return {Point} constructed point, or passed-through value.
170
+ * @example
171
+ * // this
172
+ * var point = Point.convert([0, 1]);
173
+ * // is equivalent to
174
+ * var point = new Point(0, 1);
175
+ */
176
+ static convert(a: Point | Array<number>): Point;
177
+ }
@@ -0,0 +1,5 @@
1
+ import { ResourceType } from 'maplibre-gl';
2
+
3
+ export declare const CACHE_API_AVAILABLE: boolean;
4
+ export declare function localCacheTransformRequest(reqUrl: URL, resourceType?: ResourceType): string;
5
+ export declare function registerLocalCacheProtocol(): void;
@@ -0,0 +1,359 @@
1
+ export type RgbaColor = [number, number, number] | [number, number, number, number];
2
+ export type ColorStop = {
3
+ /**
4
+ * The "value" at which this ColorStop should be applied.
5
+ */
6
+ value: number;
7
+ /**
8
+ * RGB[A] - Array of 3-4 numbers. 0-255 per channel.
9
+ */
10
+ color: RgbaColor;
11
+ };
12
+ /**
13
+ * A RGBA color as per the array definition
14
+ */
15
+ export type ArrayColor = [number, number, number, number];
16
+ /**
17
+ * A color ramp stop as per array definition
18
+ */
19
+ export type ArrayColorRampStop = [
20
+ /**
21
+ * Real world value in a real world unit
22
+ */
23
+ number,
24
+ /**
25
+ * Color RGBA
26
+ */
27
+ ArrayColor
28
+ ];
29
+ /**
30
+ * A color ramp as per array definition
31
+ */
32
+ export type ArrayColorRamp = Array<ArrayColorRampStop>;
33
+ export type ColorRampOptions = {
34
+ /**
35
+ * The value the colorramp starts
36
+ */
37
+ min?: number;
38
+ /**
39
+ * The value the colorramp ends
40
+ */
41
+ max?: number;
42
+ /**
43
+ * Some color stops to copy from
44
+ */
45
+ stops?: Array<ColorStop>;
46
+ };
47
+ export declare class ColorRamp extends Array<ColorStop> {
48
+ /**
49
+ * Converts a array-definition color ramp definition into a usable ColorRamp instance.
50
+ * Note: units are not converted and may need to to be converted beforehand (eg. kelvin to centigrade)
51
+ * @param cr
52
+ * @returns
53
+ */
54
+ static fromArrayDefinition(cr: ArrayColorRamp): ColorRamp;
55
+ private min;
56
+ private max;
57
+ constructor(options?: ColorRampOptions);
58
+ setStops(stops: Array<ColorStop>, options?: {
59
+ clone?: boolean;
60
+ }): ColorRamp;
61
+ scale(min: number, max: number, options?: {
62
+ clone?: boolean;
63
+ }): ColorRamp;
64
+ at(pos: number): ColorStop;
65
+ clone(): ColorRamp;
66
+ getRawColorStops(): Array<ColorStop>;
67
+ reverse(options?: {
68
+ clone?: boolean;
69
+ }): ColorRamp;
70
+ getBounds(): {
71
+ min: number;
72
+ max: number;
73
+ };
74
+ getColor(value: number, options?: {
75
+ smooth?: boolean;
76
+ }): RgbaColor;
77
+ /**
78
+ * Get the color as an hexadecimal string
79
+ */
80
+ getColorHex(value: number, options?: {
81
+ smooth?: boolean;
82
+ withAlpha?: boolean;
83
+ }): string;
84
+ /**
85
+ * Get the color of the color ramp at a relative position in [0, 1]
86
+ */
87
+ getColorRelative(value: number, options?: {
88
+ smooth?: boolean;
89
+ }): RgbaColor;
90
+ getCanvasStrip(options?: {
91
+ horizontal?: boolean;
92
+ size?: number;
93
+ smooth?: boolean;
94
+ }): HTMLCanvasElement;
95
+ /**
96
+ * Apply a non-linear ressampling. This will create a new instance of ColorRamp with the same bounds.
97
+ */
98
+ resample(method: "ease-in-square" | "ease-out-square" | "ease-in-sqrt" | "ease-out-sqrt" | "ease-in-exp" | "ease-out-exp", samples?: number): ColorRamp;
99
+ /**
100
+ * Makes a clone of this color ramp that is fully transparant at the begining of their range
101
+ */
102
+ transparentStart(): ColorRamp;
103
+ /**
104
+ * Check if this color ramp has a transparent start
105
+ */
106
+ hasTransparentStart(): boolean;
107
+ }
108
+ /**
109
+ * This is a collection of built-in color ramps. They are all defined in the range [0, 1]
110
+ * but can be scaled or reversed to fit specific usages.
111
+ */
112
+ export declare const ColorRampCollection: {
113
+ /**
114
+ * A fully transparent [0, 0, 0, 0] colorramp to hide data.
115
+ * Defined in interval [0, 1], without unit.
116
+ */
117
+ NULL: ColorRamp;
118
+ GRAY: ColorRamp;
119
+ /**
120
+ * Classic jet color ramp.
121
+ * Defined in interval [0, 1], without unit.
122
+ */
123
+ JET: ColorRamp;
124
+ /**
125
+ * Classic HSV color ramp (hue, saturation, value).
126
+ * Defined in interval [0, 1], without unit.
127
+ */
128
+ HSV: ColorRamp;
129
+ /**
130
+ * Classic hot color ramp.
131
+ * Defined in interval [0, 1], without unit.
132
+ */
133
+ HOT: ColorRamp;
134
+ /**
135
+ * Classic spring color ramp.
136
+ * Defined in interval [0, 1], without unit.
137
+ */
138
+ SPRING: ColorRamp;
139
+ /**
140
+ * Classic summer color ramp.
141
+ * Defined in interval [0, 1], without unit.
142
+ */
143
+ SUMMER: ColorRamp;
144
+ /**
145
+ * Classic autommn color ramp.
146
+ * Defined in interval [0, 1], without unit.
147
+ */
148
+ AUTOMN: ColorRamp;
149
+ /**
150
+ * Classic winter color ramp.
151
+ * Defined in interval [0, 1], without unit.
152
+ */
153
+ WINTER: ColorRamp;
154
+ /**
155
+ * Classic bone color ramp.
156
+ * Defined in interval [0, 1], without unit.
157
+ */
158
+ BONE: ColorRamp;
159
+ /**
160
+ * Classic copper color ramp.
161
+ * Defined in interval [0, 1], without unit.
162
+ */
163
+ COPPER: ColorRamp;
164
+ /**
165
+ * Classic greys color ramp.
166
+ * Defined in interval [0, 1], without unit.
167
+ */
168
+ GREYS: ColorRamp;
169
+ /**
170
+ * Classic yignbu color ramp (blue to light yellow).
171
+ * Defined in interval [0, 1], without unit.
172
+ */
173
+ YIGNBU: ColorRamp;
174
+ /**
175
+ * Classic greens color ramp.
176
+ * Defined in interval [0, 1], without unit.
177
+ */
178
+ GREENS: ColorRamp;
179
+ /**
180
+ * Classic yiorrd color ramp (red to light yellow).
181
+ * Defined in interval [0, 1], without unit.
182
+ */
183
+ YIORRD: ColorRamp;
184
+ /**
185
+ * Classic blue-red color ramp.
186
+ * Defined in interval [0, 1], without unit.
187
+ */
188
+ BLUERED: ColorRamp;
189
+ /**
190
+ * Classic rdbu color ramp.
191
+ * Defined in interval [0, 1], without unit.
192
+ */
193
+ RDBU: ColorRamp;
194
+ /**
195
+ * Classic picnic color ramp.
196
+ * Defined in interval [0, 1], without unit.
197
+ */
198
+ PICNIC: ColorRamp;
199
+ /**
200
+ * Classic rainbow color ramp.
201
+ * Defined in interval [0, 1], without unit.
202
+ */
203
+ RAINBOW: ColorRamp;
204
+ /**
205
+ * Classic Portland color ramp.
206
+ * Defined in interval [0, 1], without unit.
207
+ */
208
+ PORTLAND: ColorRamp;
209
+ /**
210
+ * Classic blackbody color ramp.
211
+ * Defined in interval [0, 1], without unit.
212
+ */
213
+ BLACKBODY: ColorRamp;
214
+ /**
215
+ * Classic earth color ramp.
216
+ * Defined in interval [0, 1], without unit.
217
+ */
218
+ EARTH: ColorRamp;
219
+ /**
220
+ * Classic electric color ramp.
221
+ * Defined in interval [0, 1], without unit.
222
+ */
223
+ ELECTRIC: ColorRamp;
224
+ /**
225
+ * Classic viridis color ramp.
226
+ * Defined in interval [0, 1], without unit.
227
+ */
228
+ VIRIDIS: ColorRamp;
229
+ /**
230
+ * Classic inferno color ramp.
231
+ * Defined in interval [0, 1], without unit.
232
+ */
233
+ INFERNO: ColorRamp;
234
+ /**
235
+ * Classic magma color ramp.
236
+ * Defined in interval [0, 1], without unit.
237
+ */
238
+ MAGMA: ColorRamp;
239
+ /**
240
+ * Classic plasma color ramp.
241
+ * Defined in interval [0, 1], without unit.
242
+ */
243
+ PLASMA: ColorRamp;
244
+ /**
245
+ * Classic warm color ramp.
246
+ * Defined in interval [0, 1], without unit.
247
+ */
248
+ WARM: ColorRamp;
249
+ /**
250
+ * Classic cool color ramp.
251
+ * Defined in interval [0, 1], without unit.
252
+ */
253
+ COOL: ColorRamp;
254
+ /**
255
+ * Classic rainboz soft color ramp.
256
+ * Defined in interval [0, 1], without unit.
257
+ */
258
+ RAINBOW_SOFT: ColorRamp;
259
+ /**
260
+ * Classic bathymetry color ramp.
261
+ * Defined in interval [0, 1], without unit.
262
+ */
263
+ BATHYMETRY: ColorRamp;
264
+ /**
265
+ * Classic cdom color ramp.
266
+ * Defined in interval [0, 1], without unit.
267
+ */
268
+ CDOM: ColorRamp;
269
+ /**
270
+ * Classic chlorophyll color ramp.
271
+ * Defined in interval [0, 1], without unit.
272
+ */
273
+ CHLOROPHYLL: ColorRamp;
274
+ /**
275
+ * Classic density color ramp.
276
+ * Defined in interval [0, 1], without unit.
277
+ */
278
+ DENSITY: ColorRamp;
279
+ /**
280
+ * Classic freesurface blue color ramp.
281
+ * Defined in interval [0, 1], without unit.
282
+ */
283
+ FREESURFACE_BLUE: ColorRamp;
284
+ /**
285
+ * Classic freesurface red color ramp.
286
+ * Defined in interval [0, 1], without unit.
287
+ */
288
+ FREESURFACE_RED: ColorRamp;
289
+ /**
290
+ * Classic oxygen color ramp.
291
+ * Defined in interval [0, 1], without unit.
292
+ */
293
+ OXYGEN: ColorRamp;
294
+ /**
295
+ * Classic par color ramp.
296
+ * Defined in interval [0, 1], without unit.
297
+ */
298
+ PAR: ColorRamp;
299
+ /**
300
+ * Classic phase color ramp.
301
+ * Defined in interval [0, 1], without unit.
302
+ */
303
+ PHASE: ColorRamp;
304
+ /**
305
+ * Classic salinity color ramp.
306
+ * Defined in interval [0, 1], without unit.
307
+ */
308
+ SALINITY: ColorRamp;
309
+ /**
310
+ * Classic temperature color ramp.
311
+ * Defined in interval [0, 1], without unit.
312
+ */
313
+ TEMPERATURE: ColorRamp;
314
+ /**
315
+ * Classic turbidity color ramp.
316
+ * Defined in interval [0, 1], without unit.
317
+ */
318
+ TURBIDITY: ColorRamp;
319
+ /**
320
+ * Classic velocity blue color ramp.
321
+ * Defined in interval [0, 1], without unit.
322
+ */
323
+ VELOCITY_BLUE: ColorRamp;
324
+ /**
325
+ * Classic velocity green color ramp.
326
+ * Defined in interval [0, 1], without unit.
327
+ */
328
+ VELOCITY_GREEN: ColorRamp;
329
+ /**
330
+ * Classic cube helix color ramp.
331
+ * Defined in interval [0, 1], without unit.
332
+ */
333
+ CUBEHELIX: ColorRamp;
334
+ /**
335
+ * The cividis color ramp is color blind friendly.
336
+ * Read more here https://journals.plos.org/plosone/article?id=10.1371/journal.pone.0199239
337
+ * Defined in interval [0, 1], without unit.
338
+ */
339
+ CIVIDIS: ColorRamp;
340
+ /**
341
+ * Classic turbo color ramp.
342
+ * This is a luminance-constant alternative to the jet, making it more
343
+ * clor-blind friendly.
344
+ * Defined in interval [0, 1], without unit.
345
+ */
346
+ TURBO: ColorRamp;
347
+ /**
348
+ * The rocket color ramp is perceptually uniform, which makes it more
349
+ * color bliend friendly than the classic magma color ramp.
350
+ * Defined in interval [0, 1], without unit.
351
+ */
352
+ ROCKET: ColorRamp;
353
+ /**
354
+ * The mako color ramp is perceptually uniform and can be seen as
355
+ * a color blind friendly alternative to bathymetry or yignbu.
356
+ * Defined in interval [0, 1], without unit.
357
+ */
358
+ MAKO: ColorRamp;
359
+ };
@@ -0,0 +1,68 @@
1
+ import { default as EventEmitter } from 'events';
2
+ import { LanguageInfo } from './language';
3
+ import { FetchFunction } from '@maptiler/client';
4
+ import { Unit } from './unit';
5
+
6
+ export declare const MAPTILER_SESSION_ID: string;
7
+ /**
8
+ * Configuration class for the SDK
9
+ */
10
+ declare class SdkConfig extends EventEmitter {
11
+ /**
12
+ * The primary language. By default, the language of the web browser is used.
13
+ */
14
+ primaryLanguage: LanguageInfo;
15
+ /**
16
+ * The secondary language, to overwrite the default language defined in the map style.
17
+ * This settings is highly dependant on the style compatibility and may not work in most cases.
18
+ */
19
+ secondaryLanguage?: LanguageInfo;
20
+ /**
21
+ * Setting on whether of not the SDK runs with a session logic.
22
+ * A "session" is started at the initialization of the SDK and finished when the browser
23
+ * page is being refreshed.
24
+ * When `session` is enabled (default: true), the extra URL param `mtsid` is added to queries
25
+ * on the MapTiler Cloud API. This allows MapTiler to enable "session based billing".
26
+ */
27
+ session: boolean;
28
+ /**
29
+ * Enables client-side caching of requests for tiles and fonts.
30
+ * The cached requests persist multiple browser sessions and will be reused when possible.
31
+ * Works only for requests to the MapTiler Cloud API when sessions are enabled.
32
+ */
33
+ caching: boolean;
34
+ /**
35
+ * Unit to be used
36
+ */
37
+ private _unit;
38
+ /**
39
+ * MapTiler Cloud API key
40
+ */
41
+ private _apiKey;
42
+ /**
43
+ * Set the unit system
44
+ */
45
+ set unit(u: Unit);
46
+ /**
47
+ * Get the unit system
48
+ */
49
+ get unit(): Unit;
50
+ /**
51
+ * Set the MapTiler Cloud API key
52
+ */
53
+ set apiKey(k: string);
54
+ /**
55
+ * Get the MapTiler Cloud API key
56
+ */
57
+ get apiKey(): string;
58
+ /**
59
+ * Set a the custom fetch function to replace the default one
60
+ */
61
+ set fetch(f: FetchFunction);
62
+ /**
63
+ * Get the fetch fucntion
64
+ */
65
+ get fetch(): FetchFunction | null;
66
+ }
67
+ declare const config: SdkConfig;
68
+ export { config, SdkConfig };
@@ -0,0 +1 @@
1
+ export * from './xml';