@maptiler/sdk 3.10.0-rc.2 → 3.10.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 (83) hide show
  1. package/package.json +1 -1
  2. package/dist/eslint.mjs +0 -133
  3. package/dist/maptiler-sdk.d.ts +0 -2
  4. package/dist/maptiler-sdk.mjs +0 -14226
  5. package/dist/maptiler-sdk.mjs.map +0 -1
  6. package/dist/src/ColorRamp.d.ts +0 -359
  7. package/dist/src/ImageViewer/ImageViewer.d.ts +0 -408
  8. package/dist/src/ImageViewer/ImageViewerMarker.d.ts +0 -236
  9. package/dist/src/ImageViewer/events.d.ts +0 -47
  10. package/dist/src/ImageViewer/index.d.ts +0 -5
  11. package/dist/src/ImageViewer/monkeyPatchML.d.ts +0 -10
  12. package/dist/src/ImageViewer/symbols.d.ts +0 -2
  13. package/dist/src/MLAdapters/AttributionControl.d.ts +0 -5
  14. package/dist/src/MLAdapters/BoxZoomHandler.d.ts +0 -7
  15. package/dist/src/MLAdapters/CanvasSource.d.ts +0 -5
  16. package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +0 -5
  17. package/dist/src/MLAdapters/FullscreenControl.d.ts +0 -5
  18. package/dist/src/MLAdapters/GeoJSONSource.d.ts +0 -5
  19. package/dist/src/MLAdapters/GeolocateControl.d.ts +0 -5
  20. package/dist/src/MLAdapters/ImageSource.d.ts +0 -5
  21. package/dist/src/MLAdapters/KeyboardHandler.d.ts +0 -5
  22. package/dist/src/MLAdapters/LogoControl.d.ts +0 -5
  23. package/dist/src/MLAdapters/MapMouseEvent.d.ts +0 -5
  24. package/dist/src/MLAdapters/MapTouchEvent.d.ts +0 -5
  25. package/dist/src/MLAdapters/MapWheelEvent.d.ts +0 -5
  26. package/dist/src/MLAdapters/Marker.d.ts +0 -5
  27. package/dist/src/MLAdapters/NavigationControl.d.ts +0 -5
  28. package/dist/src/MLAdapters/Popup.d.ts +0 -5
  29. package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +0 -5
  30. package/dist/src/MLAdapters/RasterTileSource.d.ts +0 -5
  31. package/dist/src/MLAdapters/ScaleControl.d.ts +0 -5
  32. package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +0 -5
  33. package/dist/src/MLAdapters/Style.d.ts +0 -5
  34. package/dist/src/MLAdapters/TerrainControl.d.ts +0 -5
  35. package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +0 -5
  36. package/dist/src/MLAdapters/VectorTileSource.d.ts +0 -5
  37. package/dist/src/MLAdapters/VideoSource.d.ts +0 -5
  38. package/dist/src/Map.d.ts +0 -480
  39. package/dist/src/Point.d.ts +0 -177
  40. package/dist/src/Telemetry.d.ts +0 -23
  41. package/dist/src/caching.d.ts +0 -4
  42. package/dist/src/config.d.ts +0 -85
  43. package/dist/src/constants/defaults.d.ts +0 -15
  44. package/dist/src/controls/ImageViewerFitImageToBoundsControl.d.ts +0 -13
  45. package/dist/src/controls/MaptilerCustomControl.d.ts +0 -17
  46. package/dist/src/controls/MaptilerExternalControl.d.ts +0 -25
  47. package/dist/src/controls/MaptilerGeolocateControl.d.ts +0 -21
  48. package/dist/src/controls/MaptilerLogoControl.d.ts +0 -19
  49. package/dist/src/controls/MaptilerNavigationControl.d.ts +0 -17
  50. package/dist/src/controls/MaptilerProjectionControl.d.ts +0 -15
  51. package/dist/src/controls/MaptilerTerrainControl.d.ts +0 -17
  52. package/dist/src/controls/Minimap.d.ts +0 -57
  53. package/dist/src/controls/index.d.ts +0 -8
  54. package/dist/src/converters/index.d.ts +0 -1
  55. package/dist/src/converters/xml.d.ts +0 -54
  56. package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +0 -239
  57. package/dist/src/custom-layers/CubemapLayer/constants.d.ts +0 -3
  58. package/dist/src/custom-layers/CubemapLayer/index.d.ts +0 -2
  59. package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +0 -43
  60. package/dist/src/custom-layers/CubemapLayer/types.d.ts +0 -67
  61. package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +0 -149
  62. package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +0 -2
  63. package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +0 -50
  64. package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +0 -17
  65. package/dist/src/custom-layers/index.d.ts +0 -6
  66. package/dist/src/helpers/index.d.ts +0 -5
  67. package/dist/src/helpers/screenshot.d.ts +0 -18
  68. package/dist/src/helpers/stylehelper.d.ts +0 -28
  69. package/dist/src/helpers/vectorlayerhelpers.d.ts +0 -508
  70. package/dist/src/index.d.ts +0 -100
  71. package/dist/src/language.d.ts +0 -107
  72. package/dist/src/mapstyle.d.ts +0 -18
  73. package/dist/src/ml-types.d.ts +0 -634
  74. package/dist/src/tools.d.ts +0 -84
  75. package/dist/src/types.d.ts +0 -1
  76. package/dist/src/utils/dom.d.ts +0 -2
  77. package/dist/src/utils/errors.d.ts +0 -5
  78. package/dist/src/utils/geo-utils.d.ts +0 -6
  79. package/dist/src/utils/index.d.ts +0 -1
  80. package/dist/src/utils/logSDKVersion.d.ts +0 -1
  81. package/dist/src/utils/math-utils.d.ts +0 -8
  82. package/dist/src/utils/object.d.ts +0 -1
  83. package/dist/src/utils/webgl-utils.d.ts +0 -49
package/dist/src/Map.d.ts DELETED
@@ -1,480 +0,0 @@
1
- import { default as maplibregl, StyleSpecification, MapOptions as MapOptionsML, ControlPosition, StyleSwapOptions, StyleOptions, RequestTransformFunction, LayerSpecification, SourceSpecification, CustomLayerInterface, FilterSpecification, StyleSetterOptions, ProjectionSpecification } from 'maplibre-gl';
2
- import { ReferenceMapStyle, MapStyleVariant } from '@maptiler/client';
3
- import { SdkConfig } from './config';
4
- import { LanguageInfo } from './language';
5
- import { MinimapOptionsInput } from './controls/Minimap';
6
- import { Telemetry } from './Telemetry';
7
- import { CubemapDefinition, CubemapLayer, CubemapLayerConstructorOptions } from './custom-layers/CubemapLayer';
8
- import { GradientDefinition, RadialGradientLayer, RadialGradientLayerConstructorOptions } from './custom-layers/RadialGradientLayer';
9
- import { StyleSpecificationWithMetaData } from './custom-layers/extractCustomLayerStyle';
10
- export type LoadWithTerrainEvent = {
11
- type: "loadWithTerrain";
12
- target: Map;
13
- terrain: {
14
- source: string;
15
- exaggeration: number;
16
- };
17
- };
18
- export declare const GeolocationType: {
19
- POINT: "POINT";
20
- COUNTRY: "COUNTRY";
21
- };
22
- /**
23
- * The type of projection, `undefined` means it's decided by the style and if the style does not contain any projection info,
24
- * if falls back to the default Mercator
25
- */
26
- export type ProjectionTypes = "mercator" | "globe" | undefined;
27
- /**
28
- * Options to provide to the `Map` constructor
29
- */
30
- export type MapOptions = Omit<MapOptionsML, "style" | "maplibreLogo"> & {
31
- /**
32
- * Style of the map. Can be:
33
- * - a full style URL (possibly with API key)
34
- * - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
35
- * - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
36
- */
37
- style?: ReferenceMapStyle | MapStyleVariant | StyleSpecification | string;
38
- /**
39
- * Define the language of the map. This can be done directly with a language ISO code (eg. "en"),
40
- * the ISO code prepended with the OSM flag (eg. "name:en" or even just "name"),
41
- * or with a built-in shorthand (eg. Language.ENGLISH).
42
- * Note that this is equivalent to setting the `config.primaryLanguage` and will overwrite it.
43
- */
44
- language?: LanguageInfo | string;
45
- /**
46
- * Define the MapTiler Cloud API key to be used. This is strictly equivalent to setting
47
- * `config.apiKey` and will overwrite it.
48
- */
49
- apiKey?: string;
50
- /**
51
- * Shows or hides the MapTiler logo in the bottom left corner (only for paid plans).
52
- * Default is `false` for paid plans.
53
- *
54
- * For free plans the MapTiler logo is always visible, and cannot be disabled.
55
- * @example
56
- * ```ts
57
- * mapTilerLogo: false // hides the logo
58
- * ```
59
- * @example
60
- * ```ts
61
- * mapTilerLogo: true // shows the logo
62
- * ```
63
- */
64
- maptilerLogo?: boolean;
65
- /**
66
- * Attribution text to show in an {@link AttributionControl}.
67
- */
68
- customAttribution?: string | Array<string>;
69
- /**
70
- * Enables 3D terrain if `true`. (default: `false`)
71
- */
72
- terrain?: boolean;
73
- /**
74
- * Exaggeration factor of the terrain. (default: `1`, no exaggeration)
75
- */
76
- terrainExaggeration?: number;
77
- /**
78
- * Show the navigation control. (default: `true`, will hide if `false`)
79
- */
80
- navigationControl?: boolean | ControlPosition;
81
- /**
82
- * Show the terrain control. (default: `false`, will show if `true`)
83
- */
84
- terrainControl?: boolean | ControlPosition;
85
- /**
86
- * Show the geolocate control. (default: `true`, will hide if `false`)
87
- */
88
- geolocateControl?: boolean | ControlPosition;
89
- /**
90
- * Show the scale control. (default: `false`, will show if `true`)
91
- */
92
- scaleControl?: boolean | ControlPosition;
93
- /**
94
- * Show the full screen control. (default: `false`, will show if `true`)
95
- */
96
- fullscreenControl?: boolean | ControlPosition;
97
- /**
98
- * Detect custom external controls. (default: `false`, will detect automatically if `true`)
99
- */
100
- customControls?: boolean | string;
101
- /**
102
- * Display a minimap in a user defined corner of the map. (default: `bottom-left` corner)
103
- * If set to true, the map will assume it is a minimap and forego the attribution control.
104
- */
105
- minimap?: boolean | ControlPosition | MinimapOptionsInput;
106
- /**
107
- * attributionControl
108
- */
109
- forceNoAttributionControl?: boolean;
110
- /**
111
- * Method to position the map at a given geolocation. Only if:
112
- * - `hash` is `false`
113
- * - `center` is not provided
114
- *
115
- * If the value is `true` of `"POINT"` (given by `GeolocationType.POINT`) then the positionning uses the MapTiler Cloud
116
- * Geolocation to find the non-GPS location point.
117
- * The zoom level can be provided in the `Map` constructor with the `zoom` option or will be `13` if not provided.
118
- *
119
- * If the value is `"COUNTRY"` (given by `GeolocationType.COUNTRY`) then the map is centered around the bounding box of the country.
120
- * In this case, the `zoom` option will be ignored.
121
- *
122
- * If the value is `false`, no geolocation is performed and the map centering and zooming depends on other options or on
123
- * the built-in defaults.
124
- *
125
- * If this option is non-false and the options `center` is also provided, then `center` prevails.
126
- *
127
- * Default: `false`
128
- */
129
- geolocate?: (typeof GeolocationType)[keyof typeof GeolocationType] | boolean;
130
- /**
131
- * Show the projection control. (default: `false`, will show if `true`)
132
- */
133
- projectionControl?: boolean | ControlPosition;
134
- /**
135
- * Whether the projection should be "mercator" or "globe".
136
- * If not provided, the style takes precedence. If provided, overwrite the style.
137
- */
138
- projection?: ProjectionTypes;
139
- /**
140
- * Turn on/off spacebox.
141
- *
142
- * Default: { color: "#1D29F1" }
143
- */
144
- space?: CubemapLayerConstructorOptions | boolean;
145
- halo?: RadialGradientLayerConstructorOptions | boolean;
146
- /**
147
- * Whether to log the SDK version to the console.
148
- * Default: Unless this is set explicitly to false, the SDK version will be logged to the console.
149
- */
150
- logSDKVersion?: boolean;
151
- };
152
- /**
153
- * The Map class can be instanciated to display a map in a `<div>`
154
- */
155
- export declare class Map extends maplibregl.Map {
156
- readonly telemetry: Telemetry;
157
- private space?;
158
- private halo?;
159
- getSpace(): CubemapLayer | undefined;
160
- /**
161
- * Sets the space for the map.
162
- * @param {CubemapDefinition} space the `CubemapDefinition` options to set.
163
- * @remarks This method, at present, ** overwrites ** the current config.
164
- * If an option is not set it will internally revert to the default option
165
- * unless explicitly set when calling.
166
- */
167
- setSpace(space: CubemapDefinition | boolean, updateOptions?: boolean): void;
168
- /**
169
- * Enables the animations for the space layer.
170
- */
171
- enableSpaceAnimations(): void;
172
- /**
173
- * Disables the animations for the space layer.
174
- */
175
- disableSpaceAnimations(): void;
176
- /**
177
- * Enables the animations for the halo layer.
178
- */
179
- enableHaloAnimations(): void;
180
- /**
181
- * Disables the animations for the halo layer.
182
- */
183
- disableHaloAnimations(): void;
184
- /**
185
- * Sets whether the halo layer should be animated in and out.
186
- * @param active - Whether the animation should be active.
187
- */
188
- setHaloAnimationActive(active: boolean): void;
189
- /**
190
- * Sets whether the space layer should be animated in and out.
191
- * @param active - Whether the animation should be active.
192
- */
193
- setSpaceAnimationActive(active: boolean): void;
194
- private setSpaceFromStyle;
195
- private setHaloFromStyle;
196
- private initSpace;
197
- private initHalo;
198
- getHalo(): RadialGradientLayer | undefined;
199
- setHalo(halo: GradientDefinition): void;
200
- private options;
201
- private isTerrainEnabled;
202
- private terrainExaggeration;
203
- private primaryLanguage;
204
- private terrainGrowing;
205
- private terrainFlattening;
206
- private minimap?;
207
- private forceLanguageUpdate;
208
- private languageAlwaysBeenStyle;
209
- private isReady;
210
- private terrainAnimationDuration;
211
- private monitoredStyleUrls;
212
- private styleInProcess;
213
- private curentProjection;
214
- private originalLabelStyle;
215
- private isStyleLocalized;
216
- private languageIsUpdated;
217
- constructor(options: MapOptions);
218
- /**
219
- * Recreates the map instance with the same options.
220
- * Useful for WebGL context loss.
221
- */
222
- recreate(): void;
223
- /**
224
- * Set the duration (millisec) of the terrain animation for growing or flattening.
225
- * Must be positive. (Built-in default: `1000` milliseconds)
226
- */
227
- setTerrainAnimationDuration(d: number): void;
228
- /**
229
- * Awaits for _this_ Map instance to be "loaded" and returns a Promise to the Map.
230
- * If _this_ Map instance is already loaded, the Promise is resolved directly,
231
- * otherwise, it is resolved as a result of the "load" event.
232
- * @returns
233
- */
234
- onLoadAsync(): Promise<Map>;
235
- /**
236
- * Awaits for _this_ Map instance to be "ready" and returns a Promise to the Map.
237
- * If _this_ Map instance is already ready, the Promise is resolved directly,
238
- * otherwise, it is resolved as a result of the "ready" event.
239
- * A map instance is "ready" when all the controls that can be managed by the contructor are
240
- * dealt with. This happens after the "load" event, due to the asynchronous nature
241
- * of some built-in controls.
242
- */
243
- onReadyAsync(): Promise<Map>;
244
- /**
245
- * Awaits for _this_ Map instance to be "loaded" as well as with terrain being non-null for the first time
246
- * and returns a Promise to the Map.
247
- * If _this_ Map instance is already loaded with terrain, the Promise is resolved directly,
248
- * otherwise, it is resolved as a result of the "loadWithTerrain" event.
249
- * @returns
250
- */
251
- onLoadWithTerrainAsync(): Promise<Map>;
252
- private monitorStyleUrl;
253
- /**
254
- * Update the style of the map.
255
- * Can be:
256
- * - a full style URL (possibly with API key)
257
- * - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
258
- * - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
259
- */
260
- setStyle(style: null | ReferenceMapStyle | MapStyleVariant | StyleSpecification | StyleSpecificationWithMetaData | string, options?: StyleSwapOptions & StyleOptions): this;
261
- private spaceboxLoadingState;
262
- /**
263
- * Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)
264
- * to the map's style.
265
- *
266
- * A layer defines how data from a specified source will be styled. Read more about layer types
267
- * and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).
268
- *
269
- * @param layer - The layer to add,
270
- * conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or,
271
- * less commonly, the {@link CustomLayerInterface} specification.
272
- * The MapLibre Style Specification's layer definition is appropriate for most layers.
273
- *
274
- * @param beforeId - The ID of an existing layer to insert the new layer before,
275
- * resulting in the new layer appearing visually beneath the existing layer.
276
- * If this argument is not specified, the layer will be appended to the end of the layers array
277
- * and appear visually above all other layers.
278
- *
279
- * @returns `this`
280
- */
281
- addLayer(layer: (LayerSpecification & {
282
- source?: string | SourceSpecification;
283
- }) | CustomLayerInterface, beforeId?: string): this;
284
- /**
285
- * Moves a layer to a different z-position.
286
- *
287
- * @param id - The ID of the layer to move.
288
- * @param beforeId - The ID of an existing layer to insert the new layer before. When viewing the map, the `id` layer will appear beneath the `beforeId` layer. If `beforeId` is omitted, the layer will be appended to the end of the layers array and appear above all other layers on the map.
289
- * @returns `this`
290
- *
291
- * @example
292
- * Move a layer with ID 'polygon' before the layer with ID 'country-label'. The `polygon` layer will appear beneath the `country-label` layer on the map.
293
- * ```ts
294
- * map.moveLayer('polygon', 'country-label');
295
- * ```
296
- */
297
- moveLayer(id: string, beforeId?: string): this;
298
- /**
299
- * Removes the layer with the given ID from the map's style.
300
- *
301
- * An {@link ErrorEvent} will be fired if the image parameter is invald.
302
- *
303
- * @param id - The ID of the layer to remove
304
- * @returns `this`
305
- *
306
- * @example
307
- * If a layer with ID 'state-data' exists, remove it.
308
- * ```ts
309
- * if (map.getLayer('state-data')) map.removeLayer('state-data');
310
- * ```
311
- */
312
- removeLayer(id: string): this;
313
- /**
314
- * Sets the zoom extent for the specified style layer. The zoom extent includes the
315
- * [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom)
316
- * and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom))
317
- * at which the layer will be rendered.
318
- *
319
- * Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the
320
- * minimum zoom level of the _source layer_ because the data does not exist at those zoom levels. If the minimum
321
- * zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style
322
- * layer will not be rendered at all zoom levels in the zoom range.
323
- */
324
- setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
325
- /**
326
- * Sets the filter for the specified style layer.
327
- *
328
- * Filters control which features a style layer renders from its source.
329
- * Any feature for which the filter expression evaluates to `true` will be
330
- * rendered on the map. Those that are false will be hidden.
331
- *
332
- * Use `setFilter` to show a subset of your source data.
333
- *
334
- * To clear the filter, pass `null` or `undefined` as the second parameter.
335
- */
336
- setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): this;
337
- /**
338
- * Sets the value of a paint property in the specified style layer.
339
- *
340
- * @param layerId - The ID of the layer to set the paint property in.
341
- * @param name - The name of the paint property to set.
342
- * @param value - The value of the paint property to set.
343
- * Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
344
- * @param options - Options object.
345
- * @returns `this`
346
- * @example
347
- * ```ts
348
- * map.setPaintProperty('my-layer', 'fill-color', '#faafee');
349
- * ```
350
- */
351
- setPaintProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
352
- /**
353
- * Sets the value of a layout property in the specified style layer.
354
- * Layout properties define how the layer is styled.
355
- * Layout properties for layers of the same type are documented together.
356
- * Layers of different types have different layout properties.
357
- * See the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/) for the complete list of layout properties.
358
- * @param layerId - The ID of the layer to set the layout property in.
359
- * @param name - The name of the layout property to set.
360
- * @param value - The value of the layout property to set.
361
- * Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
362
- * @param options - Options object.
363
- * @returns `this`
364
- */
365
- setLayoutProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
366
- /**
367
- * Sets the value of the style's glyphs property.
368
- *
369
- * @param glyphsUrl - Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).
370
- * @param options - Options object.
371
- * @returns `this`
372
- * @example
373
- * ```ts
374
- * map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');
375
- * ```
376
- */
377
- setGlyphs(glyphsUrl: string | null, options?: StyleSetterOptions): this;
378
- private getStyleLanguage;
379
- /**
380
- * Define the primary language of the map. Note that not all the languages shorthands provided are available.
381
- */
382
- setLanguage(language: LanguageInfo | string): void;
383
- /**
384
- * Define the primary language of the map. Note that not all the languages shorthands provided are available.
385
- */
386
- private setPrimaryLanguage;
387
- /**
388
- * Get the primary language
389
- * @returns
390
- */
391
- getPrimaryLanguage(): LanguageInfo;
392
- /**
393
- * Get the exaggeration factor applied to the terrain
394
- * @returns
395
- */
396
- getTerrainExaggeration(): number;
397
- /**
398
- * Know if terrian is enabled or not
399
- * @returns
400
- */
401
- hasTerrain(): boolean;
402
- private growTerrain;
403
- /**
404
- * Enables the 3D terrain visualization
405
- */
406
- enableTerrain(exaggeration?: number): void;
407
- /**
408
- * Disable the 3D terrain visualization
409
- */
410
- disableTerrain(): void;
411
- /**
412
- * Sets the 3D terrain exageration factor.
413
- * If the terrain was not enabled prior to the call of this method,
414
- * the method `.enableTerrain()` will be called.
415
- * If `animate` is `true`, the terrain transformation will be animated in the span of 1 second.
416
- * If `animate` is `false`, no animated transition to the newly defined exaggeration.
417
- */
418
- setTerrainExaggeration(exaggeration: number, animate?: boolean): void;
419
- /**
420
- * Perform an action when the style is ready. It could be at the moment of calling this method
421
- * or later.
422
- */
423
- private onStyleReady;
424
- fitToIpBounds(): Promise<void>;
425
- centerOnIpPoint(zoom: number | undefined): Promise<void>;
426
- getCameraHash(): string;
427
- /**
428
- * Get the SDK config object.
429
- * This is convenient to dispatch the SDK configuration to externally built layers
430
- * that do not directly have access to the SDK configuration but do have access to a Map instance.
431
- */
432
- getSdkConfig(): SdkConfig;
433
- /**
434
- * Get the MapTiler session ID. Convenient to dispatch to externaly built component
435
- * that do not directly have access to the SDK configuration but do have access to a Map instance.
436
- * @returns
437
- */
438
- getMaptilerSessionId(): string;
439
- /**
440
- * Updates the requestManager's transform request with a new function.
441
- *
442
- * @param transformRequest A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.
443
- * Expected to return an object with a `url` property and optionally `headers` and `credentials` properties
444
- *
445
- * @returns {Map} `this`
446
- *
447
- * @example
448
- * map.setTransformRequest((url: string, resourceType: string) => {});
449
- */
450
- setTransformRequest(transformRequest: RequestTransformFunction): this;
451
- /**
452
- * Gets the {@link ProjectionSpecification}.
453
- * @returns the projection specification.
454
- * @example
455
- * ```ts
456
- * let projection = map.getProjection();
457
- * ```
458
- */
459
- getProjection(): ProjectionSpecification;
460
- /**
461
- * Returns whether a globe projection is currently being used
462
- */
463
- isGlobeProjection(): boolean;
464
- /**
465
- * Activate the globe projection.
466
- */
467
- enableGlobeProjection(): void;
468
- /**
469
- * Activate the mercator projection.
470
- */
471
- enableMercatorProjection(): void;
472
- setProjection(projection: maplibregl.ProjectionSpecification): this;
473
- /**
474
- * Returns `true` is the language was ever updated, meaning changed
475
- * from what is delivered in the style.
476
- * Returns `false` if language in use is the language from the style
477
- * and has never been changed.
478
- */
479
- isLanguageUpdated(): boolean;
480
- }
@@ -1,177 +0,0 @@
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
- }
@@ -1,23 +0,0 @@
1
- import { Map as MapSDK } from './Map';
2
- /**
3
- * A Telemetry instance sends some usage and merics to a dedicated endpoint at MapTiler Cloud.
4
- */
5
- export declare class Telemetry {
6
- private map;
7
- private registeredModules;
8
- private viewerType;
9
- /**
10
- *
11
- * @param map : a Map instance
12
- * @param delay : a delay in milliseconds after which the payload is sent to MapTiler cloud (cannot be less than 1000ms)
13
- */
14
- constructor(map: MapSDK, delay?: number);
15
- /**
16
- * Register a module to the telemetry system of the SDK.
17
- * The arguments `name` and `version` likely come from the package.json
18
- * of each module.
19
- */
20
- registerModule(name: string, version: string): void;
21
- registerViewerType(viewerType?: string): void;
22
- private preparePayload;
23
- }
@@ -1,4 +0,0 @@
1
- import { ResourceType } from 'maplibre-gl';
2
- export declare const CACHE_API_AVAILABLE: boolean;
3
- export declare function localCacheTransformRequest(reqUrl: URL, resourceType?: ResourceType): string;
4
- export declare function registerLocalCacheProtocol(): void;