@maptiler/sdk 3.8.0-rc5 → 3.8.0-rc8
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/README.md +44 -0
- package/dist/maptiler-sdk.css +5 -0
- package/dist/maptiler-sdk.mjs +2867 -2430
- package/dist/maptiler-sdk.mjs.map +1 -1
- package/dist/src/ImageViewer/ImageViewer.d.ts +268 -15
- package/dist/src/ImageViewer/events.d.ts +24 -2
- package/dist/src/ImageViewer/index.d.ts +3 -0
- package/dist/src/ImageViewer/monkeyPatchML.d.ts +4 -0
- package/dist/src/Map.d.ts +3 -3
- package/dist/src/controls/ImageViewerFitImageToBoundsControl.d.ts +13 -0
- package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +4 -1
- package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +7 -0
- package/dist/src/custom-layers/index.d.ts +1 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/{ImageViewer/utils.d.ts → utils/errors.d.ts} +1 -1
- package/dist/src/utils/webgl-utils.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,16 +1,52 @@
|
|
|
1
1
|
import { DoubleClickZoomHandler, DragPanHandler, EaseToOptions, PointLike, TwoFingersTouchZoomRotateHandler, default as MapLibre } from 'maplibre-gl';
|
|
2
2
|
import { FlyToOptions, MapDataEvent, MapOptions, JumpToOptions, ScrollZoomHandler, BoxZoomHandler, KeyboardHandler, CooperativeGesturesHandler } from '..';
|
|
3
3
|
import { Map } from '../Map';
|
|
4
|
-
type AllowedConstrcutorOptions = "container" | "apiKey" | "maxZoom" | "minZoom" | "zoom" | "bearing";
|
|
4
|
+
export type AllowedConstrcutorOptions = "container" | "apiKey" | "maxZoom" | "minZoom" | "zoom" | "bearing";
|
|
5
5
|
declare const Evented: typeof MapLibre.Evented;
|
|
6
|
-
type
|
|
6
|
+
export type ImageViewerFlyToOptions = Omit<FlyToOptions, "pitch"> & {
|
|
7
|
+
center: [number, number];
|
|
8
|
+
};
|
|
9
|
+
export type ImageViewerJumpToOptions = Omit<JumpToOptions, "pitch"> & {
|
|
10
|
+
center: [number, number];
|
|
11
|
+
};
|
|
12
|
+
export type ImageViewerEaseToOptions = Omit<EaseToOptions, "pitch"> & {
|
|
13
|
+
center: [number, number];
|
|
14
|
+
};
|
|
15
|
+
export type ImageViewerConstructorOptions = Pick<MapOptions, AllowedConstrcutorOptions> & {
|
|
7
16
|
imageUUID: string;
|
|
8
17
|
debug?: boolean;
|
|
9
18
|
center?: [number, number];
|
|
19
|
+
fitToBoundsControl?: boolean;
|
|
20
|
+
navigationControl?: boolean;
|
|
21
|
+
};
|
|
22
|
+
export type ImageMetadata = {
|
|
23
|
+
id: string;
|
|
24
|
+
description: string;
|
|
25
|
+
attribution: string;
|
|
26
|
+
width: number;
|
|
27
|
+
height: number;
|
|
28
|
+
minzoom: number;
|
|
29
|
+
maxzoom: number;
|
|
30
|
+
tileSize: number;
|
|
10
31
|
};
|
|
11
32
|
export default class ImageViewer extends Evented {
|
|
33
|
+
/**
|
|
34
|
+
* The UUID of the image.
|
|
35
|
+
*
|
|
36
|
+
* @internal
|
|
37
|
+
*/
|
|
12
38
|
private imageUUID;
|
|
39
|
+
/**
|
|
40
|
+
* Whether to enable debug mode.
|
|
41
|
+
*
|
|
42
|
+
* @internal
|
|
43
|
+
*/
|
|
13
44
|
private debug;
|
|
45
|
+
/**
|
|
46
|
+
* The metadata of the image.
|
|
47
|
+
*
|
|
48
|
+
* @internal
|
|
49
|
+
*/
|
|
14
50
|
private imageMetadata?;
|
|
15
51
|
/**
|
|
16
52
|
* Why not extend the Map class?
|
|
@@ -20,47 +56,264 @@ export default class ImageViewer extends Evented {
|
|
|
20
56
|
* methods and properties that operate in LngLat space. *
|
|
21
57
|
*/
|
|
22
58
|
private sdk;
|
|
59
|
+
/**
|
|
60
|
+
* The options for the ImageViewer.
|
|
61
|
+
*
|
|
62
|
+
* @internal
|
|
63
|
+
*/
|
|
23
64
|
private options;
|
|
65
|
+
/**
|
|
66
|
+
* The size of the image.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
24
70
|
private imageSize?;
|
|
71
|
+
/**
|
|
72
|
+
* The padded size max.
|
|
73
|
+
*
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
25
76
|
private paddedSizeMax?;
|
|
77
|
+
/**
|
|
78
|
+
* The version of the ImageViewer / SDK.
|
|
79
|
+
*/
|
|
26
80
|
get version(): string;
|
|
81
|
+
/**
|
|
82
|
+
* The constructor for the ImageViewer.
|
|
83
|
+
*
|
|
84
|
+
* @param {Partial<ImageViewerConstructorOptions>} imageViewerConstructorOptions - The options for the ImageViewer.
|
|
85
|
+
*/
|
|
27
86
|
constructor(imageViewerConstructorOptions: Partial<ImageViewerConstructorOptions>);
|
|
87
|
+
/**
|
|
88
|
+
* Waits for the ImageViewer to be ready.
|
|
89
|
+
*
|
|
90
|
+
* @returns {Promise<void>}
|
|
91
|
+
*/
|
|
28
92
|
onReadyAsync(): Promise<void>;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
93
|
+
shouldFitImageToViewport: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Initializes the ImageViewer
|
|
96
|
+
* - fetches the image metadata
|
|
97
|
+
* - adds the image source to the sdk instance
|
|
98
|
+
* - sets the center to the middle of the image (if center is not provided)
|
|
99
|
+
* - monkeypatches the maplibre-gl sdk transform method to allow for overpanning and underzooming.
|
|
100
|
+
* - sets up global event forwarding / intercepting from the map instance
|
|
101
|
+
* - sets the center to the middle of the image (if center is not provided)
|
|
102
|
+
*
|
|
103
|
+
* @internal
|
|
104
|
+
* @returns {Promise<void>}
|
|
105
|
+
*/
|
|
106
|
+
private init;
|
|
107
|
+
/**
|
|
108
|
+
* Fits the image to the viewport.
|
|
109
|
+
*
|
|
110
|
+
* @param {Object} options - The options for the fit image to viewport.
|
|
111
|
+
* @param {boolean} options.ease - Whether to ease to the viewport bounds.
|
|
112
|
+
*/
|
|
113
|
+
fitImageToViewport({ ease }?: {
|
|
114
|
+
ease?: boolean;
|
|
115
|
+
}): void;
|
|
116
|
+
/**
|
|
117
|
+
* Fetches the image metadata from the API.
|
|
118
|
+
*
|
|
119
|
+
* @internal
|
|
120
|
+
* @returns {Promise<void>}
|
|
121
|
+
*/
|
|
122
|
+
private fetchImageMetadata;
|
|
123
|
+
/**
|
|
124
|
+
* Adds the image source to the sdk instance.
|
|
125
|
+
*
|
|
126
|
+
* @internal
|
|
127
|
+
* @returns {void}
|
|
128
|
+
*/
|
|
129
|
+
private addImageSource;
|
|
130
|
+
/**
|
|
131
|
+
* Triggers a repaint of the ImageViewer. Same as map.triggerRepaint().
|
|
132
|
+
*
|
|
133
|
+
* @internal
|
|
134
|
+
* @returns {void}
|
|
135
|
+
*/
|
|
32
136
|
triggerRepaint(): void;
|
|
137
|
+
/**
|
|
138
|
+
* The scroll zoom handler.
|
|
139
|
+
*
|
|
140
|
+
* @internal
|
|
141
|
+
* @returns {ScrollZoomHandler}
|
|
142
|
+
*/
|
|
33
143
|
get scrollZoom(): ScrollZoomHandler;
|
|
144
|
+
/**
|
|
145
|
+
* The scroll zoom handler.
|
|
146
|
+
*
|
|
147
|
+
* @internal
|
|
148
|
+
* @param {ScrollZoomHandler} value - The scroll zoom handler.
|
|
149
|
+
*/
|
|
34
150
|
set scrollZoom(value: ScrollZoomHandler);
|
|
151
|
+
/**
|
|
152
|
+
* The box zoom handler.
|
|
153
|
+
*
|
|
154
|
+
* @internal
|
|
155
|
+
* @returns {BoxZoomHandler}
|
|
156
|
+
*/
|
|
35
157
|
get boxZoom(): BoxZoomHandler;
|
|
158
|
+
/**
|
|
159
|
+
* The box zoom handler.
|
|
160
|
+
*
|
|
161
|
+
* @internal
|
|
162
|
+
* @param {BoxZoomHandler} value - The box zoom handler.
|
|
163
|
+
*/
|
|
36
164
|
set boxZoom(value: BoxZoomHandler);
|
|
165
|
+
/**
|
|
166
|
+
* The drag pan handler.
|
|
167
|
+
*
|
|
168
|
+
* @internal
|
|
169
|
+
* @returns {DragPanHandler}
|
|
170
|
+
*/
|
|
37
171
|
get dragPan(): DragPanHandler;
|
|
172
|
+
/**
|
|
173
|
+
* The drag pan handler.
|
|
174
|
+
*
|
|
175
|
+
* @internal
|
|
176
|
+
* @param {DragPanHandler} value - The drag pan handler.
|
|
177
|
+
*/
|
|
38
178
|
set dragPan(value: DragPanHandler);
|
|
179
|
+
/**
|
|
180
|
+
* The keyboard handler.
|
|
181
|
+
*
|
|
182
|
+
* @internal
|
|
183
|
+
* @returns {KeyboardHandler}
|
|
184
|
+
*/
|
|
39
185
|
get keyboard(): KeyboardHandler;
|
|
186
|
+
/**
|
|
187
|
+
* The keyboard handler.
|
|
188
|
+
*
|
|
189
|
+
* @internal
|
|
190
|
+
* @param {KeyboardHandler} value - The keyboard handler.
|
|
191
|
+
*/
|
|
40
192
|
set keyboard(value: KeyboardHandler);
|
|
193
|
+
/**
|
|
194
|
+
* The double click zoom handler.
|
|
195
|
+
*
|
|
196
|
+
* @internal
|
|
197
|
+
* @returns {DoubleClickZoomHandler}
|
|
198
|
+
*/
|
|
41
199
|
get doubleClickZoom(): DoubleClickZoomHandler;
|
|
200
|
+
/**
|
|
201
|
+
* The double click zoom handler.
|
|
202
|
+
*
|
|
203
|
+
* @internal
|
|
204
|
+
* @param {DoubleClickZoomHandler} value - The double click zoom handler.
|
|
205
|
+
*/
|
|
42
206
|
set doubleClickZoom(value: DoubleClickZoomHandler);
|
|
207
|
+
/**
|
|
208
|
+
* The touch zoom rotate handler.
|
|
209
|
+
*
|
|
210
|
+
* @internal
|
|
211
|
+
* @returns {TwoFingersTouchZoomRotateHandler}
|
|
212
|
+
*/
|
|
43
213
|
get touchZoomRotate(): TwoFingersTouchZoomRotateHandler;
|
|
214
|
+
/**
|
|
215
|
+
* The touch zoom rotate handler.
|
|
216
|
+
*
|
|
217
|
+
* @internal
|
|
218
|
+
* @param {TwoFingersTouchZoomRotateHandler} value - The touch zoom rotate handler.
|
|
219
|
+
*/
|
|
44
220
|
set touchZoomRotate(value: TwoFingersTouchZoomRotateHandler);
|
|
221
|
+
/**
|
|
222
|
+
* The cooperative gestures handler.
|
|
223
|
+
*
|
|
224
|
+
* @internal
|
|
225
|
+
* @returns {CooperativeGesturesHandler}
|
|
226
|
+
*/
|
|
45
227
|
get cooperativeGestures(): CooperativeGesturesHandler;
|
|
228
|
+
/**
|
|
229
|
+
* The cooperative gestures handler.
|
|
230
|
+
*
|
|
231
|
+
* @internal
|
|
232
|
+
* @param {CooperativeGesturesHandler} value - The cooperative gestures handler.
|
|
233
|
+
*/
|
|
46
234
|
set cooperativeGestures(value: CooperativeGesturesHandler);
|
|
235
|
+
/**
|
|
236
|
+
* Converts a LngLat to a px coordinate, based on the image metadata.
|
|
237
|
+
*
|
|
238
|
+
* @internal
|
|
239
|
+
* @param {LngLat} lngLat - The LngLat to convert.
|
|
240
|
+
* @returns {[number, number]} The px coordinate.
|
|
241
|
+
*/
|
|
47
242
|
private lngLatToPx;
|
|
243
|
+
/**
|
|
244
|
+
* Converts a px coordinate to a LngLat, based on the image metadata.
|
|
245
|
+
*
|
|
246
|
+
* @internal
|
|
247
|
+
* @param {LngLat} lngLat - The LngLat to convert.
|
|
248
|
+
* @returns {[number, number]} The px coordinate.
|
|
249
|
+
*/
|
|
48
250
|
private pxToLngLat;
|
|
49
|
-
|
|
50
|
-
|
|
251
|
+
/**
|
|
252
|
+
* Fly to a given center.
|
|
253
|
+
*
|
|
254
|
+
* @param {ImageViewerFlyToOptions} options - The options for the fly to.
|
|
255
|
+
* @param {MapDataEvent} eventData - The event data.
|
|
256
|
+
*/
|
|
257
|
+
flyTo(options: ImageViewerFlyToOptions, eventData?: MapDataEvent): Map;
|
|
258
|
+
/**
|
|
259
|
+
* Jump to a given center.
|
|
260
|
+
*
|
|
261
|
+
* @param {ImageViewerJumpToOptions} options - The options for the jump to.
|
|
262
|
+
* @param {MapDataEvent} eventData - The event data.
|
|
263
|
+
*/
|
|
264
|
+
jumpTo(options: ImageViewerJumpToOptions, eventData?: MapDataEvent): Map;
|
|
265
|
+
/**
|
|
266
|
+
* Set the zoom level.
|
|
267
|
+
*
|
|
268
|
+
* @param {number} zoom - The zoom level.
|
|
269
|
+
*/
|
|
51
270
|
setZoom(zoom: number): void;
|
|
271
|
+
/**
|
|
272
|
+
* Get the zoom level.
|
|
273
|
+
*
|
|
274
|
+
* @returns {number} The zoom level.
|
|
275
|
+
*/
|
|
52
276
|
getZoom(): number;
|
|
277
|
+
/**
|
|
278
|
+
* Get the center of the ImageViewer.
|
|
279
|
+
*
|
|
280
|
+
* @internal
|
|
281
|
+
* @returns {[number, number]} The center of the ImageViewer.
|
|
282
|
+
*/
|
|
53
283
|
getCenter(): [number, number];
|
|
284
|
+
/**
|
|
285
|
+
* Set the center of the ImageViewer.
|
|
286
|
+
*
|
|
287
|
+
* @param {number} center - The center of the ImageViewer.
|
|
288
|
+
*/
|
|
54
289
|
setCenter(center: [number, number]): void;
|
|
290
|
+
/**
|
|
291
|
+
* Set the bearing of the ImageViewer.
|
|
292
|
+
*
|
|
293
|
+
* @param {number} bearing - The bearing of the ImageViewer.
|
|
294
|
+
*/
|
|
55
295
|
setBearing(bearing: number): void;
|
|
296
|
+
/**
|
|
297
|
+
* Get the bearing of the ImageViewer.
|
|
298
|
+
*
|
|
299
|
+
* @returns {number} The bearing of the ImageViewer.
|
|
300
|
+
*/
|
|
56
301
|
getBearing(): number;
|
|
57
|
-
|
|
58
|
-
|
|
302
|
+
/**
|
|
303
|
+
* Pan by a given delta.
|
|
304
|
+
*
|
|
305
|
+
* @param {PointLike} delta - The delta to pan by.
|
|
306
|
+
* @param {ImageViewerEaseToOptions} options - The options for the pan.
|
|
307
|
+
* @param {any} eventData - The event data.
|
|
308
|
+
*/
|
|
309
|
+
panBy(delta: PointLike, options?: ImageViewerEaseToOptions, eventData?: any): void;
|
|
310
|
+
/**
|
|
311
|
+
* Pan to a given center.
|
|
312
|
+
*
|
|
313
|
+
* @param {number} center - The center to pan to.
|
|
314
|
+
* @param {ImageViewerEaseToOptions} options - The options for the pan.
|
|
315
|
+
* @param {any} eventData - The event data.
|
|
316
|
+
*/
|
|
317
|
+
panTo(center: [number, number], options?: ImageViewerEaseToOptions, eventData?: any): void;
|
|
59
318
|
}
|
|
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
319
|
export {};
|
|
@@ -5,10 +5,27 @@ export declare class ImageViewerEvent {
|
|
|
5
5
|
readonly type: string;
|
|
6
6
|
readonly target: ImageViewer;
|
|
7
7
|
readonly originalEvent: MouseEvent | TouchEvent | WheelEvent | WebGLContextEvent | null;
|
|
8
|
-
|
|
8
|
+
[key: string]: any;
|
|
9
9
|
constructor(type: string, viewer: ImageViewer, originalEvent?: MouseEvent | TouchEvent | WheelEvent | WebGLContextEvent | null, data?: Record<string, any>);
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
declare const BASE_MAP_EVENT_TYPES: readonly ["idle", "render", "load", "remove", "idle"];
|
|
12
|
+
declare const ERROR_EVENTS: readonly ["error"];
|
|
13
|
+
declare const RESIZE_EVENTS: readonly ["resize"];
|
|
14
|
+
declare const WEBGL_CONTEXT_EVENTS: readonly ["webglcontextlost", "webglcontextrestored"];
|
|
15
|
+
declare const CAMERA_EVENTS: readonly ["moveend", "movestart", "move", "zoomend", "zoomstart", "zoom", "rotatestart", "rotateend", "rotate", "dragstart", "dragend", "drag", "boxzoomcancel", "boxzoomend", "boxzoomstart"];
|
|
16
|
+
declare const UI_EVENTS: readonly ["click", "dblclick", "mousedown", "mouseup", "mousemove", "mouseout", "mouseover", "contextmenu", "touchstart", "touchend", "touchmove", "touchcancel"];
|
|
17
|
+
declare const COOPERATIVE_GESTURE_EVENTS: readonly ["cooperativegestureprevented"];
|
|
18
|
+
declare const DATA_EVENTS: readonly ["data", "dataloading", "sourcedata", "sourcedataloading", "dataabort", "sourcedataabort"];
|
|
19
|
+
export declare const IMAGE_VIEWER_EVENT_TYPES: ("data" | "error" | "load" | "idle" | "remove" | "render" | "resize" | "webglcontextlost" | "webglcontextrestored" | "dataloading" | "sourcedataloading" | "sourcedata" | "dataabort" | "sourcedataabort" | "boxzoomcancel" | "boxzoomstart" | "boxzoomend" | "touchcancel" | "touchmove" | "touchend" | "touchstart" | "click" | "contextmenu" | "dblclick" | "mousemove" | "mouseup" | "mousedown" | "mouseout" | "mouseover" | "movestart" | "move" | "moveend" | "zoomstart" | "zoom" | "zoomend" | "rotatestart" | "rotate" | "rotateend" | "dragstart" | "drag" | "dragend" | "cooperativegestureprevented")[];
|
|
20
|
+
type BaseMapEventKeys = (typeof BASE_MAP_EVENT_TYPES)[number];
|
|
21
|
+
type UiEventKeys = (typeof UI_EVENTS)[number];
|
|
22
|
+
type CameraEventKeys = (typeof CAMERA_EVENTS)[number];
|
|
23
|
+
type ErrorEventKeys = (typeof ERROR_EVENTS)[number];
|
|
24
|
+
type ResizeEventKeys = (typeof RESIZE_EVENTS)[number];
|
|
25
|
+
type WebglContextEventKeys = (typeof WEBGL_CONTEXT_EVENTS)[number];
|
|
26
|
+
type DataEventKeys = (typeof DATA_EVENTS)[number];
|
|
27
|
+
type CooperativeGestureEventKeys = (typeof COOPERATIVE_GESTURE_EVENTS)[number];
|
|
28
|
+
export type ImageViewerEventTypes = BaseMapEventKeys | UiEventKeys | CameraEventKeys | ErrorEventKeys | ResizeEventKeys | WebglContextEventKeys | DataEventKeys | CooperativeGestureEventKeys | "imageviewerready" | "imagevieweriniterror";
|
|
12
29
|
type LngLatToPixel = (lngLat: LngLat) => [number, number];
|
|
13
30
|
interface SetupGlobalMapEventForwarderOptions {
|
|
14
31
|
map: Map;
|
|
@@ -17,6 +34,11 @@ interface SetupGlobalMapEventForwarderOptions {
|
|
|
17
34
|
}
|
|
18
35
|
/**
|
|
19
36
|
* Sets up event forwarding from Map to ImageViewer with proper categorization
|
|
37
|
+
* @param {SetupGlobalMapEventForwarderOptions} options - The options for setting up the event forwarder.
|
|
38
|
+
* @param {Map} options.map - The map to forward events from.
|
|
39
|
+
* @param {ImageViewer} options.viewer - The viewer to forward events to.
|
|
40
|
+
* @param {LngLatToPixel} options.lngLatToPx - A function to convert LngLat to pixel coordinates.
|
|
41
|
+
* @returns {void}
|
|
20
42
|
*/
|
|
21
43
|
export declare function setupGlobalMapEventForwarder({ map, viewer, lngLatToPx }: SetupGlobalMapEventForwarderOptions): void;
|
|
22
44
|
export {};
|
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export { default as ImageViewer } from './ImageViewer';
|
|
2
|
+
export type { ImageViewerEventTypes } from './events';
|
|
3
|
+
export type { ImageViewerConstructorOptions, ImageViewerFlyToOptions, ImageViewerJumpToOptions, ImageMetadata } from './ImageViewer';
|
|
4
|
+
export { ImageViewerEvent } from './events';
|
package/dist/src/Map.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ import { MinimapOptionsInput } from './controls/Minimap';
|
|
|
6
6
|
import { Telemetry } from './Telemetry';
|
|
7
7
|
import { CubemapDefinition, CubemapLayer, CubemapLayerConstructorOptions } from './custom-layers/CubemapLayer';
|
|
8
8
|
import { GradientDefinition, RadialGradientLayer, RadialGradientLayerConstructorOptions } from './custom-layers/RadialGradientLayer';
|
|
9
|
+
import { StyleSpecificationWithMetaData } from './custom-layers/extractCustomLayerStyle';
|
|
9
10
|
export type LoadWithTerrainEvent = {
|
|
10
11
|
type: "loadWithTerrain";
|
|
11
12
|
target: Map;
|
|
@@ -153,8 +154,6 @@ export declare class Map extends maplibregl.Map {
|
|
|
153
154
|
setSpace(space: CubemapDefinition): void;
|
|
154
155
|
private setSpaceFromStyle;
|
|
155
156
|
private setHaloFromStyle;
|
|
156
|
-
private setSpaceFromCurrentStyle;
|
|
157
|
-
private setHaloFromCurrentStyle;
|
|
158
157
|
private initSpace;
|
|
159
158
|
private initHalo;
|
|
160
159
|
getHalo(): RadialGradientLayer | undefined;
|
|
@@ -219,7 +218,8 @@ export declare class Map extends maplibregl.Map {
|
|
|
219
218
|
* - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
|
|
220
219
|
* - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
|
|
221
220
|
*/
|
|
222
|
-
setStyle(style: null | ReferenceMapStyle | MapStyleVariant | StyleSpecification | string, options?: StyleSwapOptions & StyleOptions): this;
|
|
221
|
+
setStyle(style: null | ReferenceMapStyle | MapStyleVariant | StyleSpecification | StyleSpecificationWithMetaData | string, options?: StyleSwapOptions & StyleOptions): this;
|
|
222
|
+
private spaceboxLoadingState;
|
|
223
223
|
/**
|
|
224
224
|
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)
|
|
225
225
|
* to the map's style.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { IControl } from 'maplibre-gl';
|
|
2
|
+
import { ImageViewer } from '../ImageViewer';
|
|
3
|
+
import { Map as MapSDK } from '../Map';
|
|
4
|
+
export declare class ImageViewerFitImageToBoundsControl implements IControl {
|
|
5
|
+
private viewer;
|
|
6
|
+
private container;
|
|
7
|
+
constructor({ imageViewer }: {
|
|
8
|
+
imageViewer: ImageViewer;
|
|
9
|
+
});
|
|
10
|
+
handleClick: () => void;
|
|
11
|
+
onAdd(_map: MapSDK): HTMLElement;
|
|
12
|
+
onRemove(): void;
|
|
13
|
+
}
|
|
@@ -117,7 +117,9 @@ declare class CubemapLayer implements CustomLayerInterface {
|
|
|
117
117
|
* It creates a new Object3D instance with the specified vertex and fragment shaders,
|
|
118
118
|
* attributes, and uniforms. The cubemap will be rendered using this configuration.
|
|
119
119
|
*/
|
|
120
|
-
updateCubemap(
|
|
120
|
+
updateCubemap({ facesNeedUpdate }?: {
|
|
121
|
+
facesNeedUpdate: boolean;
|
|
122
|
+
}): void;
|
|
121
123
|
/**
|
|
122
124
|
* Called when the layer is added to the map.
|
|
123
125
|
* Initializes the cubemap and sets up the WebGL context.
|
|
@@ -224,4 +226,5 @@ declare class CubemapLayer implements CustomLayerInterface {
|
|
|
224
226
|
*/
|
|
225
227
|
hide(): void;
|
|
226
228
|
}
|
|
229
|
+
export declare function validateSpaceSpecification(space: CubemapDefinition | boolean): boolean;
|
|
227
230
|
export { CubemapLayer };
|
|
@@ -84,6 +84,12 @@ export declare class RadialGradientLayer implements CustomLayerInterface {
|
|
|
84
84
|
* @returns void
|
|
85
85
|
*/
|
|
86
86
|
onAdd(map: MapSDK, gl: WebGLRenderingContext | WebGL2RenderingContext): void;
|
|
87
|
+
/**
|
|
88
|
+
* Returns the current gradient configuration of the radial gradient layer.
|
|
89
|
+
*
|
|
90
|
+
* @returns {GradientDefinition} The current gradient configuration.
|
|
91
|
+
*/
|
|
92
|
+
getConfig(): GradientDefinition;
|
|
87
93
|
/**
|
|
88
94
|
* Animates the radial gradient into view by gradually scaling from 0 to the target scale.
|
|
89
95
|
*
|
|
@@ -126,3 +132,4 @@ export declare class RadialGradientLayer implements CustomLayerInterface {
|
|
|
126
132
|
show(): void;
|
|
127
133
|
hide(): void;
|
|
128
134
|
}
|
|
135
|
+
export declare function validateHaloSpecification(halo: RadialGradientLayerConstructorOptions | boolean): boolean;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -77,8 +77,8 @@ export { MapTouchEvent } from './MLAdapters/MapTouchEvent';
|
|
|
77
77
|
export { MapMouseEvent } from './MLAdapters/MapMouseEvent';
|
|
78
78
|
export { Map, GeolocationType, type MapOptions, type LoadWithTerrainEvent } from './Map';
|
|
79
79
|
export * from './controls';
|
|
80
|
-
export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, type LanguageGeocodingOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle, type LanguageInfo, areSameLanguages, toLanguageInfo, isLanguageInfo, getAutoLanguage, getLanguageInfoFromFlag, getLanguageInfoFromCode, getLanguageInfoFromKey, } from '@maptiler/client';
|
|
81
|
-
export
|
|
80
|
+
export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, type LanguageGeocodingOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle, type LanguageInfo, areSameLanguages, toLanguageInfo, isLanguageInfo, getAutoLanguage, getLanguageInfoFromFlag, getLanguageInfoFromCode, getLanguageInfoFromKey, canParsePixelData, } from '@maptiler/client';
|
|
81
|
+
export * from './ImageViewer';
|
|
82
82
|
export { getWebGLSupportError, displayWebGLContextLostWarning } from './tools';
|
|
83
83
|
export { config, SdkConfig } from './config';
|
|
84
84
|
export * from './language';
|
|
@@ -16,7 +16,7 @@ export declare function loadShader({ gl, type, source }: {
|
|
|
16
16
|
*
|
|
17
17
|
* @returns WebGL program
|
|
18
18
|
*/
|
|
19
|
-
export declare function
|
|
19
|
+
export declare function createShaderProgram({ gl, vertexShaderSource, fragmentShaderSource }: {
|
|
20
20
|
gl: WebGLContext;
|
|
21
21
|
vertexShaderSource: string;
|
|
22
22
|
fragmentShaderSource: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maptiler/sdk",
|
|
3
|
-
"version": "3.8.0-
|
|
3
|
+
"version": "3.8.0-rc8",
|
|
4
4
|
"description": "The Javascript & TypeScript map SDK tailored for MapTiler Cloud",
|
|
5
5
|
"author": "MapTiler",
|
|
6
6
|
"module": "dist/maptiler-sdk.mjs",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@koa/cors": "^5.0.0",
|
|
90
90
|
"@koa/router": "^13.1.1",
|
|
91
91
|
"@maplibre/maplibre-gl-style-spec": "~23.3.0",
|
|
92
|
-
"@maptiler/client": "~2.
|
|
92
|
+
"@maptiler/client": "~2.5.0",
|
|
93
93
|
"events": "^3.3.0",
|
|
94
94
|
"gl-matrix": "^3.4.3",
|
|
95
95
|
"js-base64": "^3.7.7",
|