@maptiler/sdk 3.8.0-rc2 → 3.8.0-rc4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint.mjs +133 -0
- package/dist/maptiler-sdk.d.ts +2 -0
- package/dist/maptiler-sdk.mjs +13070 -0
- package/dist/maptiler-sdk.mjs.map +1 -0
- package/dist/src/ColorRamp.d.ts +359 -0
- package/dist/src/ImageViewer/ImageViewer.d.ts +66 -0
- package/dist/src/ImageViewer/events.d.ts +22 -0
- package/dist/src/ImageViewer/index.d.ts +1 -0
- package/dist/src/ImageViewer/utils.d.ts +5 -0
- package/dist/src/MLAdapters/AttributionControl.d.ts +5 -0
- package/dist/src/MLAdapters/BoxZoomHandler.d.ts +7 -0
- package/dist/src/MLAdapters/CanvasSource.d.ts +5 -0
- package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +5 -0
- package/dist/src/MLAdapters/FullscreenControl.d.ts +5 -0
- package/dist/src/MLAdapters/GeoJSONSource.d.ts +5 -0
- package/dist/src/MLAdapters/GeolocateControl.d.ts +5 -0
- package/dist/src/MLAdapters/ImageSource.d.ts +5 -0
- package/dist/src/MLAdapters/KeyboardHandler.d.ts +5 -0
- package/dist/src/MLAdapters/LogoControl.d.ts +5 -0
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapTouchEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapWheelEvent.d.ts +5 -0
- package/dist/src/MLAdapters/Marker.d.ts +5 -0
- package/dist/src/MLAdapters/NavigationControl.d.ts +5 -0
- package/dist/src/MLAdapters/Popup.d.ts +5 -0
- package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/RasterTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/ScaleControl.d.ts +5 -0
- package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +5 -0
- package/dist/src/MLAdapters/Style.d.ts +5 -0
- package/dist/src/MLAdapters/TerrainControl.d.ts +5 -0
- package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +5 -0
- package/dist/src/MLAdapters/VectorTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/VideoSource.d.ts +5 -0
- package/dist/src/Map.d.ts +431 -0
- package/dist/src/Point.d.ts +177 -0
- package/dist/src/Telemetry.d.ts +23 -0
- package/dist/src/caching.d.ts +4 -0
- package/dist/src/config.d.ts +85 -0
- package/dist/src/constants/defaults.d.ts +15 -0
- package/dist/src/controls/MaptilerGeolocateControl.d.ts +21 -0
- package/dist/src/controls/MaptilerLogoControl.d.ts +19 -0
- package/dist/src/controls/MaptilerNavigationControl.d.ts +17 -0
- package/dist/src/controls/MaptilerProjectionControl.d.ts +14 -0
- package/dist/src/controls/MaptilerTerrainControl.d.ts +16 -0
- package/dist/src/controls/Minimap.d.ts +57 -0
- package/dist/src/controls/index.d.ts +6 -0
- package/dist/src/converters/index.d.ts +1 -0
- package/dist/src/converters/xml.d.ts +54 -0
- package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +227 -0
- package/dist/src/custom-layers/CubemapLayer/constants.d.ts +3 -0
- package/dist/src/custom-layers/CubemapLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +41 -0
- package/dist/src/custom-layers/CubemapLayer/types.d.ts +67 -0
- package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +128 -0
- package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +50 -0
- package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +17 -0
- package/dist/src/custom-layers/index.d.ts +5 -0
- package/dist/src/helpers/index.d.ts +5 -0
- package/dist/src/helpers/screenshot.d.ts +18 -0
- package/dist/src/helpers/stylehelper.d.ts +28 -0
- package/dist/src/helpers/vectorlayerhelpers.d.ts +508 -0
- package/dist/src/index.d.ts +92 -0
- package/dist/src/language.d.ts +107 -0
- package/dist/src/mapstyle.d.ts +17 -0
- package/dist/src/tools.d.ts +84 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/utils/dom.d.ts +2 -0
- package/dist/src/utils/geo-utils.d.ts +6 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/math-utils.d.ts +8 -0
- package/dist/src/utils/webgl-utils.d.ts +49 -0
- package/package.json +1 -1
|
@@ -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,66 @@
|
|
|
1
|
+
import { DoubleClickZoomHandler, DragPanHandler, EaseToOptions, PointLike, TwoFingersTouchZoomRotateHandler } from 'maplibre-gl';
|
|
2
|
+
import { FlyToOptions, MapDataEvent, MapOptions, JumpToOptions, ScrollZoomHandler, BoxZoomHandler, KeyboardHandler, CooperativeGesturesHandler } from '..';
|
|
3
|
+
import { Map } from '../Map';
|
|
4
|
+
import { Evented } from '../';
|
|
5
|
+
type AllowedConstrcutorOptions = "container" | "apiKey" | "maxZoom" | "minZoom" | "zoom" | "bearing";
|
|
6
|
+
type ImageViewerConstructorOptions = Pick<MapOptions, AllowedConstrcutorOptions> & {
|
|
7
|
+
imageUUID: string;
|
|
8
|
+
debug?: boolean;
|
|
9
|
+
center?: [number, number];
|
|
10
|
+
};
|
|
11
|
+
export default class ImageViewer extends Evented {
|
|
12
|
+
private imageUUID;
|
|
13
|
+
private debug;
|
|
14
|
+
private imageMetadata?;
|
|
15
|
+
/**
|
|
16
|
+
* Why not extend the Map class?
|
|
17
|
+
* Because ImageViewer technically operates in screen space and not in map space.
|
|
18
|
+
* We wrap map and perform calculations in screen space.
|
|
19
|
+
* We do not want to have to extend the Map class and give access to
|
|
20
|
+
* methods and properties that operate in LngLat space. *
|
|
21
|
+
*/
|
|
22
|
+
private sdk;
|
|
23
|
+
private options;
|
|
24
|
+
private imageSize?;
|
|
25
|
+
private paddedSizeMax?;
|
|
26
|
+
get version(): string;
|
|
27
|
+
constructor(imageViewerConstructorOptions: Partial<ImageViewerConstructorOptions>);
|
|
28
|
+
onReadyAsync(): Promise<void>;
|
|
29
|
+
init(): Promise<void>;
|
|
30
|
+
fetchImageMetadata(): Promise<void>;
|
|
31
|
+
addImageSource(): void;
|
|
32
|
+
triggerRepaint(): void;
|
|
33
|
+
get scrollZoom(): ScrollZoomHandler;
|
|
34
|
+
set scrollZoom(value: ScrollZoomHandler);
|
|
35
|
+
get boxZoom(): BoxZoomHandler;
|
|
36
|
+
set boxZoom(value: BoxZoomHandler);
|
|
37
|
+
get dragPan(): DragPanHandler;
|
|
38
|
+
set dragPan(value: DragPanHandler);
|
|
39
|
+
get keyboard(): KeyboardHandler;
|
|
40
|
+
set keyboard(value: KeyboardHandler);
|
|
41
|
+
get doubleClickZoom(): DoubleClickZoomHandler;
|
|
42
|
+
set doubleClickZoom(value: DoubleClickZoomHandler);
|
|
43
|
+
get touchZoomRotate(): TwoFingersTouchZoomRotateHandler;
|
|
44
|
+
set touchZoomRotate(value: TwoFingersTouchZoomRotateHandler);
|
|
45
|
+
get cooperativeGestures(): CooperativeGesturesHandler;
|
|
46
|
+
set cooperativeGestures(value: CooperativeGesturesHandler);
|
|
47
|
+
private lngLatToPx;
|
|
48
|
+
private pxToLngLat;
|
|
49
|
+
flyTo(options: Omit<ImageViewerFlyToOptions, "bearing" | "pitch">, eventData?: MapDataEvent): Map;
|
|
50
|
+
jumpTo(options: Omit<ImageViewerJumpToOptions, "bearing" | "pitch">, eventData?: MapDataEvent): Map;
|
|
51
|
+
setZoom(zoom: number): void;
|
|
52
|
+
getZoom(): number;
|
|
53
|
+
getCenter(): [number, number];
|
|
54
|
+
setCenter(center: [number, number]): void;
|
|
55
|
+
setBearing(bearing: number): void;
|
|
56
|
+
getBearing(): number;
|
|
57
|
+
panBy(delta: PointLike, options?: EaseToOptions, eventData?: any): void;
|
|
58
|
+
panTo(center: [number, number], options?: EaseToOptions, eventData?: any): void;
|
|
59
|
+
}
|
|
60
|
+
type ImageViewerFlyToOptions = Omit<FlyToOptions, "bearing" | "pitch"> & {
|
|
61
|
+
center: [number, number];
|
|
62
|
+
};
|
|
63
|
+
type ImageViewerJumpToOptions = Omit<JumpToOptions, "bearing" | "pitch"> & {
|
|
64
|
+
center: [number, number];
|
|
65
|
+
};
|
|
66
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Map } from '../Map';
|
|
2
|
+
import { default as ImageViewer } from './ImageViewer';
|
|
3
|
+
import { LngLat } from 'maplibre-gl';
|
|
4
|
+
export declare class ImageViewerEvent {
|
|
5
|
+
readonly type: string;
|
|
6
|
+
readonly target: ImageViewer;
|
|
7
|
+
readonly originalEvent: MouseEvent | TouchEvent | WheelEvent | WebGLContextEvent | null;
|
|
8
|
+
readonly data?: Record<string, any>;
|
|
9
|
+
constructor(type: string, viewer: ImageViewer, originalEvent?: MouseEvent | TouchEvent | WheelEvent | WebGLContextEvent | null, data?: Record<string, any>);
|
|
10
|
+
}
|
|
11
|
+
export declare const ALL_MAP_EVENT_TYPES: string[];
|
|
12
|
+
type LngLatToPixel = (lngLat: LngLat) => [number, number];
|
|
13
|
+
interface SetupGlobalMapEventForwarderOptions {
|
|
14
|
+
map: Map;
|
|
15
|
+
viewer: ImageViewer;
|
|
16
|
+
lngLatToPx: LngLatToPixel;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Sets up event forwarding from Map to ImageViewer with proper categorization
|
|
20
|
+
*/
|
|
21
|
+
export declare function setupGlobalMapEventForwarder({ map, viewer, lngLatToPx }: SetupGlobalMapEventForwarderOptions): void;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ImageViewer } from './ImageViewer';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
+
import { Map as SDKMap } from '../Map';
|
|
3
|
+
export declare class BoxZoomHandler extends maplibregl.BoxZoomHandler {
|
|
4
|
+
constructor(map: SDKMap | MapMLGL, options: {
|
|
5
|
+
clickTolerance: number;
|
|
6
|
+
});
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as maplibregl, GestureOptions, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
+
import { Map as SDKMap } from '../Map';
|
|
3
|
+
export declare class CooperativeGesturesHandler extends maplibregl.CooperativeGesturesHandler {
|
|
4
|
+
constructor(map: SDKMap | MapMLGL, options: GestureOptions);
|
|
5
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
+
import { Map as SDKMap } from '../Map';
|
|
3
|
+
export declare class MapMouseEvent extends maplibregl.MapMouseEvent {
|
|
4
|
+
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?: Record<string, unknown>);
|
|
5
|
+
}
|