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