@maptiler/sdk 3.9.0-rc.3 → 3.9.0-rc.4
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 +2 -2
- package/test-results/tests-map-load-Awaits-until-map-ready-and-takes-snapshot-chromium/trace.zip +0 -0
- package/dist/eslint.mjs +0 -133
- package/dist/maptiler-sdk.d.ts +0 -2
- package/dist/maptiler-sdk.mjs +0 -14182
- package/dist/maptiler-sdk.mjs.map +0 -1
- package/dist/src/ColorRamp.d.ts +0 -359
- package/dist/src/ImageViewer/ImageViewer.d.ts +0 -408
- package/dist/src/ImageViewer/ImageViewerMarker.d.ts +0 -236
- package/dist/src/ImageViewer/events.d.ts +0 -47
- package/dist/src/ImageViewer/index.d.ts +0 -5
- package/dist/src/ImageViewer/monkeyPatchML.d.ts +0 -11
- package/dist/src/ImageViewer/symbols.d.ts +0 -2
- 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 -471
- package/dist/src/Point.d.ts +0 -177
- package/dist/src/Telemetry.d.ts +0 -23
- 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/ImageViewerFitImageToBoundsControl.d.ts +0 -13
- package/dist/src/controls/MaptilerCustomControl.d.ts +0 -17
- package/dist/src/controls/MaptilerExternalControl.d.ts +0 -25
- 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 -15
- package/dist/src/controls/MaptilerTerrainControl.d.ts +0 -17
- package/dist/src/controls/Minimap.d.ts +0 -57
- package/dist/src/controls/index.d.ts +0 -8
- 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 -232
- 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 -42
- package/dist/src/custom-layers/CubemapLayer/types.d.ts +0 -67
- package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +0 -142
- 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 -99
- 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/errors.d.ts +0 -5
- 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
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { LngLat, Marker, Point, PositionAnchor } from '../index';
|
|
2
|
-
import { Map } from '../Map';
|
|
3
|
-
export declare function unprojectFromWorldCoordinates(worldSize: number, point: Point): LngLat;
|
|
4
|
-
export declare function monkeyPatchMapTransformInstance(instance: Map): void;
|
|
5
|
-
export declare const anchorTranslate: Record<PositionAnchor, string>;
|
|
6
|
-
/**
|
|
7
|
-
* Monkey patches the Marker instance to remove wrapping. Because pixel projection does not wrap like lnglat.
|
|
8
|
-
* See here https://github.com/maplibre/maplibre-gl-js/blob/14f56b00e0f08784681ef98f0731c60f3923a4a9/src/ui/marker.ts#L601
|
|
9
|
-
* @param {Marker} marker - The Marker instance to patch.
|
|
10
|
-
*/
|
|
11
|
-
export declare function monkeyPatchMarkerInstanceToRemoveWrapping(marker: Marker): void;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
-
import { Map as SDKMap } from '../Map';
|
|
3
|
-
export declare class BoxZoomHandler extends maplibregl.BoxZoomHandler {
|
|
4
|
-
constructor(map: SDKMap | MapMLGL, options: {
|
|
5
|
-
clickTolerance: number;
|
|
6
|
-
});
|
|
7
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { default as maplibregl, GestureOptions, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
-
import { Map as SDKMap } from '../Map';
|
|
3
|
-
export declare class CooperativeGesturesHandler extends maplibregl.CooperativeGesturesHandler {
|
|
4
|
-
constructor(map: SDKMap | MapMLGL, options: GestureOptions);
|
|
5
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { default as maplibregl, Map as MapMLGL } from 'maplibre-gl';
|
|
2
|
-
import { Map as SDKMap } from '../Map';
|
|
3
|
-
export declare class MapMouseEvent extends maplibregl.MapMouseEvent {
|
|
4
|
-
constructor(type: string, map: SDKMap | MapMLGL, originalEvent: MouseEvent, data?: Record<string, unknown>);
|
|
5
|
-
}
|
package/dist/src/Map.d.ts
DELETED
|
@@ -1,471 +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.
|
|
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
|
-
* Detect custom external controls. (default: `false`, will detect automatically if `true`)
|
|
95
|
-
*/
|
|
96
|
-
customControls?: boolean | string;
|
|
97
|
-
/**
|
|
98
|
-
* Display a minimap in a user defined corner of the map. (default: `bottom-left` corner)
|
|
99
|
-
* If set to true, the map will assume it is a minimap and forego the attribution control.
|
|
100
|
-
*/
|
|
101
|
-
minimap?: boolean | ControlPosition | MinimapOptionsInput;
|
|
102
|
-
/**
|
|
103
|
-
* attributionControl
|
|
104
|
-
*/
|
|
105
|
-
forceNoAttributionControl?: boolean;
|
|
106
|
-
/**
|
|
107
|
-
* Method to position the map at a given geolocation. Only if:
|
|
108
|
-
* - `hash` is `false`
|
|
109
|
-
* - `center` is not provided
|
|
110
|
-
*
|
|
111
|
-
* If the value is `true` of `"POINT"` (given by `GeolocationType.POINT`) then the positionning uses the MapTiler Cloud
|
|
112
|
-
* Geolocation to find the non-GPS location point.
|
|
113
|
-
* The zoom level can be provided in the `Map` constructor with the `zoom` option or will be `13` if not provided.
|
|
114
|
-
*
|
|
115
|
-
* If the value is `"COUNTRY"` (given by `GeolocationType.COUNTRY`) then the map is centered around the bounding box of the country.
|
|
116
|
-
* In this case, the `zoom` option will be ignored.
|
|
117
|
-
*
|
|
118
|
-
* If the value is `false`, no geolocation is performed and the map centering and zooming depends on other options or on
|
|
119
|
-
* the built-in defaults.
|
|
120
|
-
*
|
|
121
|
-
* If this option is non-false and the options `center` is also provided, then `center` prevails.
|
|
122
|
-
*
|
|
123
|
-
* Default: `false`
|
|
124
|
-
*/
|
|
125
|
-
geolocate?: (typeof GeolocationType)[keyof typeof GeolocationType] | boolean;
|
|
126
|
-
/**
|
|
127
|
-
* Show the projection control. (default: `false`, will show if `true`)
|
|
128
|
-
*/
|
|
129
|
-
projectionControl?: boolean | ControlPosition;
|
|
130
|
-
/**
|
|
131
|
-
* Whether the projection should be "mercator" or "globe".
|
|
132
|
-
* If not provided, the style takes precedence. If provided, overwrite the style.
|
|
133
|
-
*/
|
|
134
|
-
projection?: ProjectionTypes;
|
|
135
|
-
/**
|
|
136
|
-
* Turn on/off spacebox.
|
|
137
|
-
*
|
|
138
|
-
* Default: { color: "#1D29F1" }
|
|
139
|
-
*/
|
|
140
|
-
space?: CubemapLayerConstructorOptions | boolean;
|
|
141
|
-
halo?: RadialGradientLayerConstructorOptions | boolean;
|
|
142
|
-
};
|
|
143
|
-
/**
|
|
144
|
-
* The Map class can be instanciated to display a map in a `<div>`
|
|
145
|
-
*/
|
|
146
|
-
export declare class Map extends maplibregl.Map {
|
|
147
|
-
readonly telemetry: Telemetry;
|
|
148
|
-
private space?;
|
|
149
|
-
private halo?;
|
|
150
|
-
getSpace(): CubemapLayer | undefined;
|
|
151
|
-
/**
|
|
152
|
-
* Sets the space for the map.
|
|
153
|
-
* @param {CubemapDefinition} space the `CubemapDefinition` options to set.
|
|
154
|
-
* @remarks This method, at present, ** overwrites ** the current config.
|
|
155
|
-
* If an option is not set it will internally revert to the default option
|
|
156
|
-
* unless explicitly set when calling.
|
|
157
|
-
*/
|
|
158
|
-
setSpace(space: CubemapDefinition | boolean, updateOptions?: boolean): void;
|
|
159
|
-
/**
|
|
160
|
-
* Enables the animations for the space layer.
|
|
161
|
-
*/
|
|
162
|
-
enableSpaceAnimations(): void;
|
|
163
|
-
/**
|
|
164
|
-
* Disables the animations for the space layer.
|
|
165
|
-
*/
|
|
166
|
-
disableSpaceAnimations(): void;
|
|
167
|
-
/**
|
|
168
|
-
* Enables the animations for the halo layer.
|
|
169
|
-
*/
|
|
170
|
-
enableHaloAnimations(): void;
|
|
171
|
-
/**
|
|
172
|
-
* Disables the animations for the halo layer.
|
|
173
|
-
*/
|
|
174
|
-
disableHaloAnimations(): void;
|
|
175
|
-
/**
|
|
176
|
-
* Sets whether the halo layer should be animated in and out.
|
|
177
|
-
* @param active - Whether the animation should be active.
|
|
178
|
-
*/
|
|
179
|
-
setHaloAnimationActive(active: boolean): void;
|
|
180
|
-
/**
|
|
181
|
-
* Sets whether the space layer should be animated in and out.
|
|
182
|
-
* @param active - Whether the animation should be active.
|
|
183
|
-
*/
|
|
184
|
-
setSpaceAnimationActive(active: boolean): void;
|
|
185
|
-
private setSpaceFromStyle;
|
|
186
|
-
private setHaloFromStyle;
|
|
187
|
-
private initSpace;
|
|
188
|
-
private initHalo;
|
|
189
|
-
getHalo(): RadialGradientLayer | undefined;
|
|
190
|
-
setHalo(halo: GradientDefinition): void;
|
|
191
|
-
private options;
|
|
192
|
-
private isTerrainEnabled;
|
|
193
|
-
private terrainExaggeration;
|
|
194
|
-
private primaryLanguage;
|
|
195
|
-
private terrainGrowing;
|
|
196
|
-
private terrainFlattening;
|
|
197
|
-
private minimap?;
|
|
198
|
-
private forceLanguageUpdate;
|
|
199
|
-
private languageAlwaysBeenStyle;
|
|
200
|
-
private isReady;
|
|
201
|
-
private terrainAnimationDuration;
|
|
202
|
-
private monitoredStyleUrls;
|
|
203
|
-
private styleInProcess;
|
|
204
|
-
private curentProjection;
|
|
205
|
-
private originalLabelStyle;
|
|
206
|
-
private isStyleLocalized;
|
|
207
|
-
private languageIsUpdated;
|
|
208
|
-
constructor(options: MapOptions);
|
|
209
|
-
/**
|
|
210
|
-
* Recreates the map instance with the same options.
|
|
211
|
-
* Useful for WebGL context loss.
|
|
212
|
-
*/
|
|
213
|
-
recreate(): void;
|
|
214
|
-
/**
|
|
215
|
-
* Set the duration (millisec) of the terrain animation for growing or flattening.
|
|
216
|
-
* Must be positive. (Built-in default: `1000` milliseconds)
|
|
217
|
-
*/
|
|
218
|
-
setTerrainAnimationDuration(d: number): void;
|
|
219
|
-
/**
|
|
220
|
-
* Awaits for _this_ Map instance to be "loaded" and returns a Promise to the Map.
|
|
221
|
-
* If _this_ Map instance is already loaded, the Promise is resolved directly,
|
|
222
|
-
* otherwise, it is resolved as a result of the "load" event.
|
|
223
|
-
* @returns
|
|
224
|
-
*/
|
|
225
|
-
onLoadAsync(): Promise<Map>;
|
|
226
|
-
/**
|
|
227
|
-
* Awaits for _this_ Map instance to be "ready" and returns a Promise to the Map.
|
|
228
|
-
* If _this_ Map instance is already ready, the Promise is resolved directly,
|
|
229
|
-
* otherwise, it is resolved as a result of the "ready" event.
|
|
230
|
-
* A map instance is "ready" when all the controls that can be managed by the contructor are
|
|
231
|
-
* dealt with. This happens after the "load" event, due to the asynchronous nature
|
|
232
|
-
* of some built-in controls.
|
|
233
|
-
*/
|
|
234
|
-
onReadyAsync(): Promise<Map>;
|
|
235
|
-
/**
|
|
236
|
-
* Awaits for _this_ Map instance to be "loaded" as well as with terrain being non-null for the first time
|
|
237
|
-
* and returns a Promise to the Map.
|
|
238
|
-
* If _this_ Map instance is already loaded with terrain, the Promise is resolved directly,
|
|
239
|
-
* otherwise, it is resolved as a result of the "loadWithTerrain" event.
|
|
240
|
-
* @returns
|
|
241
|
-
*/
|
|
242
|
-
onLoadWithTerrainAsync(): Promise<Map>;
|
|
243
|
-
private monitorStyleUrl;
|
|
244
|
-
/**
|
|
245
|
-
* Update the style of the map.
|
|
246
|
-
* Can be:
|
|
247
|
-
* - a full style URL (possibly with API key)
|
|
248
|
-
* - a shorthand with only the MapTIler style name (eg. `"streets-v2"`)
|
|
249
|
-
* - a longer form with the prefix `"maptiler://"` (eg. `"maptiler://streets-v2"`)
|
|
250
|
-
*/
|
|
251
|
-
setStyle(style: null | ReferenceMapStyle | MapStyleVariant | StyleSpecification | StyleSpecificationWithMetaData | string, options?: StyleSwapOptions & StyleOptions): this;
|
|
252
|
-
private spaceboxLoadingState;
|
|
253
|
-
/**
|
|
254
|
-
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-style-spec/layers)
|
|
255
|
-
* to the map's style.
|
|
256
|
-
*
|
|
257
|
-
* A layer defines how data from a specified source will be styled. Read more about layer types
|
|
258
|
-
* and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/layers).
|
|
259
|
-
*
|
|
260
|
-
* @param layer - The layer to add,
|
|
261
|
-
* conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-style-spec/layers) or,
|
|
262
|
-
* less commonly, the {@link CustomLayerInterface} specification.
|
|
263
|
-
* The MapLibre Style Specification's layer definition is appropriate for most layers.
|
|
264
|
-
*
|
|
265
|
-
* @param beforeId - The ID of an existing layer to insert the new layer before,
|
|
266
|
-
* resulting in the new layer appearing visually beneath the existing layer.
|
|
267
|
-
* If this argument is not specified, the layer will be appended to the end of the layers array
|
|
268
|
-
* and appear visually above all other layers.
|
|
269
|
-
*
|
|
270
|
-
* @returns `this`
|
|
271
|
-
*/
|
|
272
|
-
addLayer(layer: (LayerSpecification & {
|
|
273
|
-
source?: string | SourceSpecification;
|
|
274
|
-
}) | CustomLayerInterface, beforeId?: string): this;
|
|
275
|
-
/**
|
|
276
|
-
* Moves a layer to a different z-position.
|
|
277
|
-
*
|
|
278
|
-
* @param id - The ID of the layer to move.
|
|
279
|
-
* @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.
|
|
280
|
-
* @returns `this`
|
|
281
|
-
*
|
|
282
|
-
* @example
|
|
283
|
-
* 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.
|
|
284
|
-
* ```ts
|
|
285
|
-
* map.moveLayer('polygon', 'country-label');
|
|
286
|
-
* ```
|
|
287
|
-
*/
|
|
288
|
-
moveLayer(id: string, beforeId?: string): this;
|
|
289
|
-
/**
|
|
290
|
-
* Removes the layer with the given ID from the map's style.
|
|
291
|
-
*
|
|
292
|
-
* An {@link ErrorEvent} will be fired if the image parameter is invald.
|
|
293
|
-
*
|
|
294
|
-
* @param id - The ID of the layer to remove
|
|
295
|
-
* @returns `this`
|
|
296
|
-
*
|
|
297
|
-
* @example
|
|
298
|
-
* If a layer with ID 'state-data' exists, remove it.
|
|
299
|
-
* ```ts
|
|
300
|
-
* if (map.getLayer('state-data')) map.removeLayer('state-data');
|
|
301
|
-
* ```
|
|
302
|
-
*/
|
|
303
|
-
removeLayer(id: string): this;
|
|
304
|
-
/**
|
|
305
|
-
* Sets the zoom extent for the specified style layer. The zoom extent includes the
|
|
306
|
-
* [minimum zoom level](https://maplibre.org/maplibre-style-spec/layers/#minzoom)
|
|
307
|
-
* and [maximum zoom level](https://maplibre.org/maplibre-style-spec/layers/#maxzoom))
|
|
308
|
-
* at which the layer will be rendered.
|
|
309
|
-
*
|
|
310
|
-
* Note: For style layers using vector sources, style layers cannot be rendered at zoom levels lower than the
|
|
311
|
-
* minimum zoom level of the _source layer_ because the data does not exist at those zoom levels. If the minimum
|
|
312
|
-
* zoom level of the source layer is higher than the minimum zoom level defined in the style layer, the style
|
|
313
|
-
* layer will not be rendered at all zoom levels in the zoom range.
|
|
314
|
-
*/
|
|
315
|
-
setLayerZoomRange(layerId: string, minzoom: number, maxzoom: number): this;
|
|
316
|
-
/**
|
|
317
|
-
* Sets the filter for the specified style layer.
|
|
318
|
-
*
|
|
319
|
-
* Filters control which features a style layer renders from its source.
|
|
320
|
-
* Any feature for which the filter expression evaluates to `true` will be
|
|
321
|
-
* rendered on the map. Those that are false will be hidden.
|
|
322
|
-
*
|
|
323
|
-
* Use `setFilter` to show a subset of your source data.
|
|
324
|
-
*
|
|
325
|
-
* To clear the filter, pass `null` or `undefined` as the second parameter.
|
|
326
|
-
*/
|
|
327
|
-
setFilter(layerId: string, filter?: FilterSpecification | null, options?: StyleSetterOptions): this;
|
|
328
|
-
/**
|
|
329
|
-
* Sets the value of a paint property in the specified style layer.
|
|
330
|
-
*
|
|
331
|
-
* @param layerId - The ID of the layer to set the paint property in.
|
|
332
|
-
* @param name - The name of the paint property to set.
|
|
333
|
-
* @param value - The value of the paint property to set.
|
|
334
|
-
* Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
|
|
335
|
-
* @param options - Options object.
|
|
336
|
-
* @returns `this`
|
|
337
|
-
* @example
|
|
338
|
-
* ```ts
|
|
339
|
-
* map.setPaintProperty('my-layer', 'fill-color', '#faafee');
|
|
340
|
-
* ```
|
|
341
|
-
*/
|
|
342
|
-
setPaintProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
|
|
343
|
-
/**
|
|
344
|
-
* Sets the value of a layout property in the specified style layer.
|
|
345
|
-
* Layout properties define how the layer is styled.
|
|
346
|
-
* Layout properties for layers of the same type are documented together.
|
|
347
|
-
* Layers of different types have different layout properties.
|
|
348
|
-
* See the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/) for the complete list of layout properties.
|
|
349
|
-
* @param layerId - The ID of the layer to set the layout property in.
|
|
350
|
-
* @param name - The name of the layout property to set.
|
|
351
|
-
* @param value - The value of the layout property to set.
|
|
352
|
-
* Must be of a type appropriate for the property, as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/).
|
|
353
|
-
* @param options - Options object.
|
|
354
|
-
* @returns `this`
|
|
355
|
-
*/
|
|
356
|
-
setLayoutProperty(layerId: string, name: string, value: any, options?: StyleSetterOptions): this;
|
|
357
|
-
/**
|
|
358
|
-
* Sets the value of the style's glyphs property.
|
|
359
|
-
*
|
|
360
|
-
* @param glyphsUrl - Glyph URL to set. Must conform to the [MapLibre Style Specification](https://maplibre.org/maplibre-style-spec/glyphs/).
|
|
361
|
-
* @param options - Options object.
|
|
362
|
-
* @returns `this`
|
|
363
|
-
* @example
|
|
364
|
-
* ```ts
|
|
365
|
-
* map.setGlyphs('https://demotiles.maplibre.org/font/{fontstack}/{range}.pbf');
|
|
366
|
-
* ```
|
|
367
|
-
*/
|
|
368
|
-
setGlyphs(glyphsUrl: string | null, options?: StyleSetterOptions): this;
|
|
369
|
-
private getStyleLanguage;
|
|
370
|
-
/**
|
|
371
|
-
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
372
|
-
*/
|
|
373
|
-
setLanguage(language: LanguageInfo | string): void;
|
|
374
|
-
/**
|
|
375
|
-
* Define the primary language of the map. Note that not all the languages shorthands provided are available.
|
|
376
|
-
*/
|
|
377
|
-
private setPrimaryLanguage;
|
|
378
|
-
/**
|
|
379
|
-
* Get the primary language
|
|
380
|
-
* @returns
|
|
381
|
-
*/
|
|
382
|
-
getPrimaryLanguage(): LanguageInfo;
|
|
383
|
-
/**
|
|
384
|
-
* Get the exaggeration factor applied to the terrain
|
|
385
|
-
* @returns
|
|
386
|
-
*/
|
|
387
|
-
getTerrainExaggeration(): number;
|
|
388
|
-
/**
|
|
389
|
-
* Know if terrian is enabled or not
|
|
390
|
-
* @returns
|
|
391
|
-
*/
|
|
392
|
-
hasTerrain(): boolean;
|
|
393
|
-
private growTerrain;
|
|
394
|
-
/**
|
|
395
|
-
* Enables the 3D terrain visualization
|
|
396
|
-
*/
|
|
397
|
-
enableTerrain(exaggeration?: number): void;
|
|
398
|
-
/**
|
|
399
|
-
* Disable the 3D terrain visualization
|
|
400
|
-
*/
|
|
401
|
-
disableTerrain(): void;
|
|
402
|
-
/**
|
|
403
|
-
* Sets the 3D terrain exageration factor.
|
|
404
|
-
* If the terrain was not enabled prior to the call of this method,
|
|
405
|
-
* the method `.enableTerrain()` will be called.
|
|
406
|
-
* If `animate` is `true`, the terrain transformation will be animated in the span of 1 second.
|
|
407
|
-
* If `animate` is `false`, no animated transition to the newly defined exaggeration.
|
|
408
|
-
*/
|
|
409
|
-
setTerrainExaggeration(exaggeration: number, animate?: boolean): void;
|
|
410
|
-
/**
|
|
411
|
-
* Perform an action when the style is ready. It could be at the moment of calling this method
|
|
412
|
-
* or later.
|
|
413
|
-
*/
|
|
414
|
-
private onStyleReady;
|
|
415
|
-
fitToIpBounds(): Promise<void>;
|
|
416
|
-
centerOnIpPoint(zoom: number | undefined): Promise<void>;
|
|
417
|
-
getCameraHash(): string;
|
|
418
|
-
/**
|
|
419
|
-
* Get the SDK config object.
|
|
420
|
-
* This is convenient to dispatch the SDK configuration to externally built layers
|
|
421
|
-
* that do not directly have access to the SDK configuration but do have access to a Map instance.
|
|
422
|
-
*/
|
|
423
|
-
getSdkConfig(): SdkConfig;
|
|
424
|
-
/**
|
|
425
|
-
* Get the MapTiler session ID. Convenient to dispatch to externaly built component
|
|
426
|
-
* that do not directly have access to the SDK configuration but do have access to a Map instance.
|
|
427
|
-
* @returns
|
|
428
|
-
*/
|
|
429
|
-
getMaptilerSessionId(): string;
|
|
430
|
-
/**
|
|
431
|
-
* Updates the requestManager's transform request with a new function.
|
|
432
|
-
*
|
|
433
|
-
* @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.
|
|
434
|
-
* Expected to return an object with a `url` property and optionally `headers` and `credentials` properties
|
|
435
|
-
*
|
|
436
|
-
* @returns {Map} `this`
|
|
437
|
-
*
|
|
438
|
-
* @example
|
|
439
|
-
* map.setTransformRequest((url: string, resourceType: string) => {});
|
|
440
|
-
*/
|
|
441
|
-
setTransformRequest(transformRequest: RequestTransformFunction): this;
|
|
442
|
-
/**
|
|
443
|
-
* Gets the {@link ProjectionSpecification}.
|
|
444
|
-
* @returns the projection specification.
|
|
445
|
-
* @example
|
|
446
|
-
* ```ts
|
|
447
|
-
* let projection = map.getProjection();
|
|
448
|
-
* ```
|
|
449
|
-
*/
|
|
450
|
-
getProjection(): ProjectionSpecification;
|
|
451
|
-
/**
|
|
452
|
-
* Returns whether a globe projection is currently being used
|
|
453
|
-
*/
|
|
454
|
-
isGlobeProjection(): boolean;
|
|
455
|
-
/**
|
|
456
|
-
* Activate the globe projection.
|
|
457
|
-
*/
|
|
458
|
-
enableGlobeProjection(): void;
|
|
459
|
-
/**
|
|
460
|
-
* Activate the mercator projection.
|
|
461
|
-
*/
|
|
462
|
-
enableMercatorProjection(): void;
|
|
463
|
-
setProjection(projection: maplibregl.ProjectionSpecification): this;
|
|
464
|
-
/**
|
|
465
|
-
* Returns `true` is the language was ever updated, meaning changed
|
|
466
|
-
* from what is delivered in the style.
|
|
467
|
-
* Returns `false` if language in use is the language from the style
|
|
468
|
-
* and has never been changed.
|
|
469
|
-
*/
|
|
470
|
-
isLanguageUpdated(): boolean;
|
|
471
|
-
}
|