@maptiler/sdk 3.10.0 → 3.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eslint.mjs +133 -0
- package/dist/maptiler-sdk.d.ts +2 -0
- package/dist/maptiler-sdk.mjs +14235 -0
- package/dist/maptiler-sdk.mjs.map +1 -0
- package/dist/src/ColorRamp.d.ts +359 -0
- package/dist/src/ImageViewer/ImageViewer.d.ts +408 -0
- package/dist/src/ImageViewer/ImageViewerMarker.d.ts +236 -0
- package/dist/src/ImageViewer/events.d.ts +47 -0
- package/dist/src/ImageViewer/index.d.ts +5 -0
- package/dist/src/ImageViewer/monkeyPatchML.d.ts +10 -0
- package/dist/src/ImageViewer/symbols.d.ts +2 -0
- package/dist/src/MLAdapters/AttributionControl.d.ts +5 -0
- package/dist/src/MLAdapters/BoxZoomHandler.d.ts +7 -0
- package/dist/src/MLAdapters/CanvasSource.d.ts +5 -0
- package/dist/src/MLAdapters/CooperativeGesturesHandler.d.ts +5 -0
- package/dist/src/MLAdapters/FullscreenControl.d.ts +5 -0
- package/dist/src/MLAdapters/GeoJSONSource.d.ts +5 -0
- package/dist/src/MLAdapters/GeolocateControl.d.ts +5 -0
- package/dist/src/MLAdapters/ImageSource.d.ts +5 -0
- package/dist/src/MLAdapters/KeyboardHandler.d.ts +5 -0
- package/dist/src/MLAdapters/LogoControl.d.ts +5 -0
- package/dist/src/MLAdapters/MapMouseEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapTouchEvent.d.ts +5 -0
- package/dist/src/MLAdapters/MapWheelEvent.d.ts +5 -0
- package/dist/src/MLAdapters/Marker.d.ts +5 -0
- package/dist/src/MLAdapters/NavigationControl.d.ts +5 -0
- package/dist/src/MLAdapters/Popup.d.ts +5 -0
- package/dist/src/MLAdapters/RasterDEMTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/RasterTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/ScaleControl.d.ts +5 -0
- package/dist/src/MLAdapters/ScrollZoomHandler.d.ts +5 -0
- package/dist/src/MLAdapters/Style.d.ts +5 -0
- package/dist/src/MLAdapters/TerrainControl.d.ts +5 -0
- package/dist/src/MLAdapters/TwoFingersTouchPitchHandler.d.ts +5 -0
- package/dist/src/MLAdapters/VectorTileSource.d.ts +5 -0
- package/dist/src/MLAdapters/VideoSource.d.ts +5 -0
- package/dist/src/Map.d.ts +480 -0
- package/dist/src/Point.d.ts +177 -0
- package/dist/src/Telemetry.d.ts +23 -0
- package/dist/src/caching.d.ts +4 -0
- package/dist/src/config.d.ts +85 -0
- package/dist/src/constants/defaults.d.ts +15 -0
- package/dist/src/controls/ImageViewerFitImageToBoundsControl.d.ts +13 -0
- package/dist/src/controls/MaptilerCustomControl.d.ts +17 -0
- package/dist/src/controls/MaptilerExternalControl.d.ts +25 -0
- package/dist/src/controls/MaptilerGeolocateControl.d.ts +21 -0
- package/dist/src/controls/MaptilerLogoControl.d.ts +19 -0
- package/dist/src/controls/MaptilerNavigationControl.d.ts +17 -0
- package/dist/src/controls/MaptilerProjectionControl.d.ts +15 -0
- package/dist/src/controls/MaptilerTerrainControl.d.ts +17 -0
- package/dist/src/controls/Minimap.d.ts +57 -0
- package/dist/src/controls/index.d.ts +8 -0
- package/dist/src/converters/index.d.ts +1 -0
- package/dist/src/converters/xml.d.ts +54 -0
- package/dist/src/custom-layers/CubemapLayer/CubemapLayer.d.ts +239 -0
- package/dist/src/custom-layers/CubemapLayer/constants.d.ts +3 -0
- package/dist/src/custom-layers/CubemapLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/CubemapLayer/loadCubemapTexture.d.ts +43 -0
- package/dist/src/custom-layers/CubemapLayer/types.d.ts +67 -0
- package/dist/src/custom-layers/RadialGradientLayer/RadialGradientLayer.d.ts +149 -0
- package/dist/src/custom-layers/RadialGradientLayer/index.d.ts +2 -0
- package/dist/src/custom-layers/RadialGradientLayer/types.d.ts +50 -0
- package/dist/src/custom-layers/extractCustomLayerStyle.d.ts +17 -0
- package/dist/src/custom-layers/index.d.ts +6 -0
- package/dist/src/helpers/index.d.ts +5 -0
- package/dist/src/helpers/screenshot.d.ts +18 -0
- package/dist/src/helpers/stylehelper.d.ts +28 -0
- package/dist/src/helpers/vectorlayerhelpers.d.ts +508 -0
- package/dist/src/index.d.ts +100 -0
- package/dist/src/language.d.ts +107 -0
- package/dist/src/mapstyle.d.ts +18 -0
- package/dist/src/ml-types.d.ts +634 -0
- package/dist/src/tools.d.ts +84 -0
- package/dist/src/types.d.ts +1 -0
- package/dist/src/utils/dom.d.ts +2 -0
- package/dist/src/utils/errors.d.ts +5 -0
- package/dist/src/utils/geo-utils.d.ts +6 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/logSDKVersion.d.ts +1 -0
- package/dist/src/utils/math-utils.d.ts +8 -0
- package/dist/src/utils/object.d.ts +1 -0
- package/dist/src/utils/webgl-utils.d.ts +49 -0
- package/package.json +3 -3
|
@@ -0,0 +1,508 @@
|
|
|
1
|
+
import { FeatureCollection } from 'geojson';
|
|
2
|
+
import { Map as SDKMap } from '../Map';
|
|
3
|
+
import { ColorRamp } from '../ColorRamp';
|
|
4
|
+
/**
|
|
5
|
+
* Array of string values that depend on zoom level
|
|
6
|
+
*/
|
|
7
|
+
export type ZoomStringValues = Array<{
|
|
8
|
+
/**
|
|
9
|
+
* Zoom level
|
|
10
|
+
*/
|
|
11
|
+
zoom: number;
|
|
12
|
+
/**
|
|
13
|
+
* Value for the given zoom level
|
|
14
|
+
*/
|
|
15
|
+
value: string;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
*
|
|
19
|
+
* Array of number values that depend on zoom level
|
|
20
|
+
*/
|
|
21
|
+
export type ZoomNumberValues = Array<{
|
|
22
|
+
/**
|
|
23
|
+
* Zoom level
|
|
24
|
+
*/
|
|
25
|
+
zoom: number;
|
|
26
|
+
/**
|
|
27
|
+
* Value for the given zoom level
|
|
28
|
+
*/
|
|
29
|
+
value: number;
|
|
30
|
+
}>;
|
|
31
|
+
export type PropertyValues = Array<{
|
|
32
|
+
/**
|
|
33
|
+
* Value of the property (input)
|
|
34
|
+
*/
|
|
35
|
+
propertyValue: number;
|
|
36
|
+
/**
|
|
37
|
+
* Value to associate it with (output)
|
|
38
|
+
*/
|
|
39
|
+
value: number;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Describes how to render a cluster of points
|
|
43
|
+
*/
|
|
44
|
+
export type DataDrivenStyle = Array<{
|
|
45
|
+
/**
|
|
46
|
+
* Numerical value to observe and apply the style upon.
|
|
47
|
+
* In case of clusters, the value to observe is automatically the number of elements in a cluster.
|
|
48
|
+
* In other cases, it can be a provided value.
|
|
49
|
+
*/
|
|
50
|
+
value: number;
|
|
51
|
+
/**
|
|
52
|
+
* Radius of the cluster circle
|
|
53
|
+
*/
|
|
54
|
+
pointRadius: number;
|
|
55
|
+
/**
|
|
56
|
+
* Color of the cluster
|
|
57
|
+
*/
|
|
58
|
+
color: string;
|
|
59
|
+
}>;
|
|
60
|
+
export type CommonShapeLayerOptions = {
|
|
61
|
+
/**
|
|
62
|
+
* ID to give to the layer.
|
|
63
|
+
* If not provided, an auto-generated ID of the for "maptiler-layer-xxxxxx" will be auto-generated,
|
|
64
|
+
* with "xxxxxx" being a random string.
|
|
65
|
+
*/
|
|
66
|
+
layerId?: string;
|
|
67
|
+
/**
|
|
68
|
+
* ID to give to the geojson source.
|
|
69
|
+
* If not provided, an auto-generated ID of the for "maptiler-source-xxxxxx" will be auto-generated,
|
|
70
|
+
* with "xxxxxx" being a random string.
|
|
71
|
+
*/
|
|
72
|
+
sourceId?: string;
|
|
73
|
+
/**
|
|
74
|
+
* A geojson Feature collection or a URL to a geojson or the UUID of a MapTiler Cloud dataset.
|
|
75
|
+
*/
|
|
76
|
+
data: FeatureCollection | string;
|
|
77
|
+
/**
|
|
78
|
+
* The ID of an existing layer to insert the new layer before, resulting in the new layer appearing
|
|
79
|
+
* visually beneath the existing layer. If this argument is not specified, the layer will be appended
|
|
80
|
+
* to the end of the layers array and appear visually above all other layers.
|
|
81
|
+
*/
|
|
82
|
+
beforeId?: string;
|
|
83
|
+
/**
|
|
84
|
+
* Zoom level at which it starts to show.
|
|
85
|
+
* Default: `0`
|
|
86
|
+
*/
|
|
87
|
+
minzoom?: number;
|
|
88
|
+
/**
|
|
89
|
+
* Zoom level after which it no longer show.
|
|
90
|
+
* Default: `22`
|
|
91
|
+
*/
|
|
92
|
+
maxzoom?: number;
|
|
93
|
+
/**
|
|
94
|
+
* Whether or not to add an outline.
|
|
95
|
+
* Default: `false`
|
|
96
|
+
*/
|
|
97
|
+
outline?: boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Color of the outline. This is can be a constant color string or a definition based on zoom levels.
|
|
100
|
+
* Applies only if `.outline` is `true`.
|
|
101
|
+
* Default: `white`
|
|
102
|
+
*/
|
|
103
|
+
outlineColor?: string | ZoomStringValues;
|
|
104
|
+
/**
|
|
105
|
+
* Width of the outline (relative to screen-space). This is can be a constant width or a definition based on zoom levels.
|
|
106
|
+
* Applies only if `.outline` is `true`.
|
|
107
|
+
* Default: `1`
|
|
108
|
+
*/
|
|
109
|
+
outlineWidth?: number | ZoomNumberValues;
|
|
110
|
+
/**
|
|
111
|
+
* Opacity of the outline. This is can be a constant opacity in [0, 1] or a definition based on zoom levels
|
|
112
|
+
* Applies only if `.outline` is `true`.
|
|
113
|
+
* Default: `1`
|
|
114
|
+
*/
|
|
115
|
+
outlineOpacity?: number | ZoomNumberValues;
|
|
116
|
+
};
|
|
117
|
+
export type PolylineLayerOptions = CommonShapeLayerOptions & {
|
|
118
|
+
/**
|
|
119
|
+
* Color of the line (or polyline). This is can be a constant color string or a definition based on zoom levels.
|
|
120
|
+
* Default: a color randomly pick from a list
|
|
121
|
+
*/
|
|
122
|
+
lineColor?: string | ZoomStringValues;
|
|
123
|
+
/**
|
|
124
|
+
* Width of the line (relative to screen-space). This is can be a constant width or a definition based on zoom levels
|
|
125
|
+
* Default: `3`
|
|
126
|
+
*/
|
|
127
|
+
lineWidth?: number | ZoomNumberValues;
|
|
128
|
+
/**
|
|
129
|
+
* Opacity of the line. This is can be a constant opacity in [0, 1] or a definition based on zoom levels.
|
|
130
|
+
* Default: `1`
|
|
131
|
+
*/
|
|
132
|
+
lineOpacity?: number | ZoomNumberValues;
|
|
133
|
+
/**
|
|
134
|
+
* How blury the line is, with `0` being no blur and `10` and beyond being quite blurry.
|
|
135
|
+
* Default: `0`
|
|
136
|
+
*/
|
|
137
|
+
lineBlur?: number | ZoomNumberValues;
|
|
138
|
+
/**
|
|
139
|
+
* Draws a line casing outside of a line's actual path. Value indicates the width of the inner gap.
|
|
140
|
+
* Default: `0`
|
|
141
|
+
*/
|
|
142
|
+
lineGapWidth?: number | ZoomNumberValues;
|
|
143
|
+
/**
|
|
144
|
+
* Sequence of line and void to create a dash pattern. The unit is the line width so that
|
|
145
|
+
* a dash array value of `[3, 1]` will create a segment worth 3 times the width of the line,
|
|
146
|
+
* followed by a spacing worth 1 time the line width, and then repeat.
|
|
147
|
+
*
|
|
148
|
+
* Alternatively, this property can be a string made of underscore and whitespace characters
|
|
149
|
+
* such as `"___ _ "` and internaly this will be translated into [3, 1, 1, 1]. Note that
|
|
150
|
+
* this way of describing dash arrays with a string only works for integer values.
|
|
151
|
+
*
|
|
152
|
+
* Dash arrays can contain more than 2 element to create more complex patters. For instance
|
|
153
|
+
* a dash array value of [3, 2, 1, 2] will create the following sequence:
|
|
154
|
+
* - a segment worth 3 times the width
|
|
155
|
+
* - a spacing worth 2 times the width
|
|
156
|
+
* - a segment worth 1 times the width
|
|
157
|
+
* - a spacing worth 2 times the width
|
|
158
|
+
* - repeat
|
|
159
|
+
*
|
|
160
|
+
* Default: no dash pattern
|
|
161
|
+
*/
|
|
162
|
+
lineDashArray?: Array<number> | string;
|
|
163
|
+
/**
|
|
164
|
+
* The display of line endings for both the line and the outline (if `.outline` is `true`)
|
|
165
|
+
* - "butt": A cap with a squared-off end which is drawn to the exact endpoint of the line.
|
|
166
|
+
* - "round": A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
167
|
+
* - "square": A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
168
|
+
* Default: "round"
|
|
169
|
+
*/
|
|
170
|
+
lineCap?: "butt" | "round" | "square";
|
|
171
|
+
/**
|
|
172
|
+
* The display of lines when joining for both the line and the outline (if `.outline` is `true`)
|
|
173
|
+
* - "bevel": A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
174
|
+
* - "round": A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
175
|
+
* - "miter": A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
|
|
176
|
+
* Default: "round"
|
|
177
|
+
*/
|
|
178
|
+
lineJoin?: "bevel" | "round" | "miter";
|
|
179
|
+
/**
|
|
180
|
+
* How blury the outline is, with `0` being no blur and `10` and beyond being quite blurry.
|
|
181
|
+
* Applies only if `.outline` is `true`.
|
|
182
|
+
* Default: `0`
|
|
183
|
+
*/
|
|
184
|
+
outlineBlur?: number | ZoomNumberValues;
|
|
185
|
+
};
|
|
186
|
+
export type PolygonLayerOptions = CommonShapeLayerOptions & {
|
|
187
|
+
/**
|
|
188
|
+
* Color of the polygon. This is can be a constant color string or a definition based on zoom levels.
|
|
189
|
+
* Default: a color randomly pick from a list
|
|
190
|
+
*/
|
|
191
|
+
fillColor?: string | ZoomStringValues;
|
|
192
|
+
/**
|
|
193
|
+
* Opacity of the polygon. This is can be a constant opacity in [0, 1] or a definition based on zoom levels
|
|
194
|
+
* Default: `1`
|
|
195
|
+
*/
|
|
196
|
+
fillOpacity?: ZoomNumberValues;
|
|
197
|
+
/**
|
|
198
|
+
* Position of the outline with regard to the polygon edge (when `.outline` is `true`)
|
|
199
|
+
* Default: `"center"`
|
|
200
|
+
*/
|
|
201
|
+
outlinePosition: "center" | "inside" | "outside";
|
|
202
|
+
/**
|
|
203
|
+
* Sequence of line and void to create a dash pattern. The unit is the line width so that
|
|
204
|
+
* a dash array value of `[3, 1]` will create a segment worth 3 times the width of the line,
|
|
205
|
+
* followed by a spacing worth 1 time the line width, and then repeat.
|
|
206
|
+
*
|
|
207
|
+
* Alternatively, this property can be a string made of underscore and whitespace characters
|
|
208
|
+
* such as `"___ _ "` and internaly this will be translated into [3, 1, 1, 1]. Note that
|
|
209
|
+
* this way of describing dash arrays with a string only works for integer values.
|
|
210
|
+
*
|
|
211
|
+
* Dash arrays can contain more than 2 element to create more complex patters. For instance
|
|
212
|
+
* a dash array value of [3, 2, 1, 2] will create the following sequence:
|
|
213
|
+
* - a segment worth 3 times the width
|
|
214
|
+
* - a spacing worth 2 times the width
|
|
215
|
+
* - a segment worth 1 times the width
|
|
216
|
+
* - a spacing worth 2 times the width
|
|
217
|
+
* - repeat
|
|
218
|
+
*
|
|
219
|
+
* Default: no dash pattern
|
|
220
|
+
*/
|
|
221
|
+
outlineDashArray?: Array<number> | string;
|
|
222
|
+
/**
|
|
223
|
+
* The display of line endings for both the line and the outline (if `.outline` is `true`)
|
|
224
|
+
* - "butt": A cap with a squared-off end which is drawn to the exact endpoint of the line.
|
|
225
|
+
* - "round": A cap with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
226
|
+
* - "square": A cap with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
227
|
+
* Default: "round"
|
|
228
|
+
*/
|
|
229
|
+
outlineCap?: "butt" | "round" | "square";
|
|
230
|
+
/**
|
|
231
|
+
* The display of lines when joining for both the line and the outline (if `.outline` is `true`)
|
|
232
|
+
* - "bevel": A join with a squared-off end which is drawn beyond the endpoint of the line at a distance of one-half of the line's width.
|
|
233
|
+
* - "round": A join with a rounded end which is drawn beyond the endpoint of the line at a radius of one-half of the line's width and centered on the endpoint of the line.
|
|
234
|
+
* - "miter": A join with a sharp, angled corner which is drawn with the outer sides beyond the endpoint of the path until they meet.
|
|
235
|
+
* Default: "round"
|
|
236
|
+
*/
|
|
237
|
+
outlineJoin?: "bevel" | "round" | "miter";
|
|
238
|
+
/**
|
|
239
|
+
* The pattern is an image URL to be put as a repeated background pattern of the polygon.
|
|
240
|
+
* Default: `null` (no pattern, `fillColor` will be used)
|
|
241
|
+
*/
|
|
242
|
+
pattern?: string | null;
|
|
243
|
+
/**
|
|
244
|
+
* How blury the outline is, with `0` being no blur and `10` and beyond being quite blurry.
|
|
245
|
+
* Applies only if `.outline` is `true`.
|
|
246
|
+
* Default: `0`
|
|
247
|
+
*/
|
|
248
|
+
outlineBlur?: number | ZoomNumberValues;
|
|
249
|
+
};
|
|
250
|
+
export type PointLayerOptions = CommonShapeLayerOptions & {
|
|
251
|
+
/**
|
|
252
|
+
* Can be a unique point color as a string (CSS color such as "#FF0000" or "red").
|
|
253
|
+
* Alternatively, the color can be a ColorRamp with a range.
|
|
254
|
+
* In case of `.cluster` being `true`, the range of the ColorRamp will be addressed with the number of elements in
|
|
255
|
+
* the cluster. If `.cluster` is `false`, the color will be addressed using the value of the `.property`.
|
|
256
|
+
* If no `.property` is given but `.pointColor` is a ColorRamp, the chosen color is the one at the lower bound of the ColorRamp.
|
|
257
|
+
* Default: a color randomly pick from a list
|
|
258
|
+
*/
|
|
259
|
+
pointColor?: string | ColorRamp;
|
|
260
|
+
/**
|
|
261
|
+
* Radius of the points. Can be a fixed size or a value dependant on the zoom.
|
|
262
|
+
* If `.pointRadius` is not provided, the radius will depend on the size of each cluster (if `.cluster` is `true`)
|
|
263
|
+
* or on the value of each point (if `.property` is provided and `.pointColor` is a ColorRamp).
|
|
264
|
+
* The radius will be between `.minPointRadius` and `.maxPointRadius`
|
|
265
|
+
*/
|
|
266
|
+
pointRadius?: number | ZoomNumberValues;
|
|
267
|
+
/**
|
|
268
|
+
* The minimum point radius posible.
|
|
269
|
+
* Default: `10`
|
|
270
|
+
*/
|
|
271
|
+
minPointRadius?: number;
|
|
272
|
+
/**
|
|
273
|
+
* The maximum point radius posible.
|
|
274
|
+
* Default: `40`
|
|
275
|
+
*/
|
|
276
|
+
maxPointRadius?: number;
|
|
277
|
+
/**
|
|
278
|
+
* The point property to observe and apply the radius and color upon.
|
|
279
|
+
* This is ignored if `.cluster` is `true` as the observed value will be fiorced to being the number
|
|
280
|
+
* of elements in each cluster.
|
|
281
|
+
*
|
|
282
|
+
* Default: none
|
|
283
|
+
*/
|
|
284
|
+
property?: string;
|
|
285
|
+
/**
|
|
286
|
+
* Opacity of the point or icon. This is can be a constant opacity in [0, 1] or a definition based on zoom levels.
|
|
287
|
+
* Alternatively, if not provided but the `.pointColor` is a ColorRamp, the opacity will be extracted from tha alpha
|
|
288
|
+
* component if present.
|
|
289
|
+
* Default: `1`
|
|
290
|
+
*/
|
|
291
|
+
pointOpacity?: number | ZoomNumberValues;
|
|
292
|
+
/**
|
|
293
|
+
* If `true`, the points will keep their circular shape align with the wiewport.
|
|
294
|
+
* If `false`, the points will be like flatten on the map. This difference shows
|
|
295
|
+
* when the map is tilted.
|
|
296
|
+
* Default: `true`
|
|
297
|
+
*/
|
|
298
|
+
alignOnViewport?: boolean;
|
|
299
|
+
/**
|
|
300
|
+
* Whether the points should cluster
|
|
301
|
+
*/
|
|
302
|
+
cluster?: boolean;
|
|
303
|
+
/**
|
|
304
|
+
* Shows a label with the numerical value id `true`.
|
|
305
|
+
* If `.cluster` is `true`, the value will be the numebr of elements in the cluster.
|
|
306
|
+
*
|
|
307
|
+
*
|
|
308
|
+
* Default: `true` if `cluster` or `dataDrivenStyleProperty` are used, `false` otherwise.
|
|
309
|
+
*/
|
|
310
|
+
showLabel?: boolean;
|
|
311
|
+
/**
|
|
312
|
+
* text color used for the number elements in each cluster.
|
|
313
|
+
* Applicable only when `cluster` is `true`.
|
|
314
|
+
* Default: `#000000` (black)
|
|
315
|
+
*/
|
|
316
|
+
labelColor?: string;
|
|
317
|
+
/**
|
|
318
|
+
* text size used for the number elements in each cluster.
|
|
319
|
+
* Applicable only when `cluster` is `true`.
|
|
320
|
+
* Default: `12`
|
|
321
|
+
*/
|
|
322
|
+
labelSize?: number;
|
|
323
|
+
/**
|
|
324
|
+
* Only if `.cluster` is `false`.
|
|
325
|
+
* If the radius is driven by a property, then it will also scale by zoomming if `.zoomCompensation` is `true`.
|
|
326
|
+
* If `false`, the radius will not adapt according to the zoom level.
|
|
327
|
+
* Default: `true`
|
|
328
|
+
*/
|
|
329
|
+
zoomCompensation?: boolean;
|
|
330
|
+
};
|
|
331
|
+
export type HeatmapLayerOptions = {
|
|
332
|
+
/**
|
|
333
|
+
* ID to give to the layer.
|
|
334
|
+
* If not provided, an auto-generated ID of the for "maptiler-layer-xxxxxx" will be auto-generated,
|
|
335
|
+
* with "xxxxxx" being a random string.
|
|
336
|
+
*/
|
|
337
|
+
layerId?: string;
|
|
338
|
+
/**
|
|
339
|
+
* ID to give to the geojson source.
|
|
340
|
+
* If not provided, an auto-generated ID of the for "maptiler-source-xxxxxx" will be auto-generated,
|
|
341
|
+
* with "xxxxxx" being a random string.
|
|
342
|
+
*/
|
|
343
|
+
sourceId?: string;
|
|
344
|
+
/**
|
|
345
|
+
* A geojson Feature collection or a URL to a geojson or the UUID of a MapTiler Cloud dataset.
|
|
346
|
+
*/
|
|
347
|
+
data: FeatureCollection | string;
|
|
348
|
+
/**
|
|
349
|
+
* The ID of an existing layer to insert the new layer before, resulting in the new layer appearing
|
|
350
|
+
* visually beneath the existing layer. If this argument is not specified, the layer will be appended
|
|
351
|
+
* to the end of the layers array and appear visually above all other layers.
|
|
352
|
+
*/
|
|
353
|
+
beforeId?: string;
|
|
354
|
+
/**
|
|
355
|
+
* Zoom level at which it starts to show.
|
|
356
|
+
* Default: `0`
|
|
357
|
+
*/
|
|
358
|
+
minzoom?: number;
|
|
359
|
+
/**
|
|
360
|
+
* Zoom level after which it no longer show.
|
|
361
|
+
* Default: `22`
|
|
362
|
+
*/
|
|
363
|
+
maxzoom?: number;
|
|
364
|
+
/**
|
|
365
|
+
* The ColorRamp instance to use for visualization. The color ramp is expected to be defined in the
|
|
366
|
+
* range `[0, 1]` or else will be forced to this range.
|
|
367
|
+
* Default: `ColorRampCollection.TURBO`
|
|
368
|
+
*/
|
|
369
|
+
colorRamp?: ColorRamp;
|
|
370
|
+
/**
|
|
371
|
+
* Use a property to apply a weight to each data point. Using a property requires also using
|
|
372
|
+
* the options `.propertyValueWeight` or otherwise will be ignored.
|
|
373
|
+
* Default: none, the points will all have a weight of `1`.
|
|
374
|
+
*/
|
|
375
|
+
property?: string;
|
|
376
|
+
/**
|
|
377
|
+
* The weight to give to each data point. If of type `PropertyValueWeights`, then the options `.property`
|
|
378
|
+
* must also be provided. If used a number, all data points will be weighted by the same number (which is of little interest)
|
|
379
|
+
*/
|
|
380
|
+
weight?: PropertyValues | number;
|
|
381
|
+
/**
|
|
382
|
+
* The radius (in screenspace) can be:
|
|
383
|
+
* - a fixed number that will be constant across zoom level
|
|
384
|
+
* - of type `ZoomNumberValues` to be ramped accoding to zoom level (`.zoomCompensation` will then be ignored)
|
|
385
|
+
* - of type `PropertyValues` to be driven by the value of a property.
|
|
386
|
+
* If so, the option `.property` must be provided and will still be resized according to zoom level,
|
|
387
|
+
* unless the option `.zoomCompensation` is set to `false`.
|
|
388
|
+
*
|
|
389
|
+
* Default:
|
|
390
|
+
*/
|
|
391
|
+
radius?: number | ZoomNumberValues | PropertyValues;
|
|
392
|
+
/**
|
|
393
|
+
* The opacity can be a fixed value or zoom-driven.
|
|
394
|
+
* Default: fades-in 0.25z after minzoom and fade-out 0.25z before maxzoom
|
|
395
|
+
*/
|
|
396
|
+
opacity?: number | ZoomNumberValues;
|
|
397
|
+
/**
|
|
398
|
+
* The intensity is zoom-dependent. By default, the intensity is going to be scaled by zoom to preserve
|
|
399
|
+
* a natural aspect or the data distribution.
|
|
400
|
+
*/
|
|
401
|
+
intensity?: number | ZoomNumberValues;
|
|
402
|
+
/**
|
|
403
|
+
* If the radius is driven by a property, then it will also scale by zoomming if `.zoomCompensation` is `true`.
|
|
404
|
+
* If `false`, the radius will not adapt according to the zoom level.
|
|
405
|
+
* Default: `true`
|
|
406
|
+
*/
|
|
407
|
+
zoomCompensation?: boolean;
|
|
408
|
+
};
|
|
409
|
+
/**
|
|
410
|
+
* Add a polyline to the map from various sources and with builtin styling.
|
|
411
|
+
* Compatible sources:
|
|
412
|
+
* - gpx content as string
|
|
413
|
+
* - gpx file from URL
|
|
414
|
+
* - kml content from string
|
|
415
|
+
* - kml from url
|
|
416
|
+
* - geojson from url
|
|
417
|
+
* - geojson content as string
|
|
418
|
+
* - geojson content as JS object
|
|
419
|
+
* - uuid of a MapTiler Cloud dataset
|
|
420
|
+
*
|
|
421
|
+
* The method also gives the possibility to add an outline layer (if `options.outline` is `true`)
|
|
422
|
+
* and if so , the returned property `polylineOutlineLayerId` will be a string. As a result, two layers
|
|
423
|
+
* would be added.
|
|
424
|
+
*
|
|
425
|
+
* The default styling creates a line layer of constant width of 3px, the color will be randomly picked
|
|
426
|
+
* from a curated list of colors and the opacity will be 1.
|
|
427
|
+
* If the outline is enabled, the outline width is of 1px at all zoom levels, the color is white and
|
|
428
|
+
* the opacity is 1.
|
|
429
|
+
*
|
|
430
|
+
* Those style properties can be changed and ramped according to zoom level using an easier syntax.
|
|
431
|
+
*
|
|
432
|
+
*/
|
|
433
|
+
export declare function addPolyline(
|
|
434
|
+
/**
|
|
435
|
+
* Map instance to add a polyline layer to
|
|
436
|
+
*/
|
|
437
|
+
map: SDKMap,
|
|
438
|
+
/**
|
|
439
|
+
* Options related to adding a polyline layer
|
|
440
|
+
*/
|
|
441
|
+
options: PolylineLayerOptions,
|
|
442
|
+
/**
|
|
443
|
+
* When the polyline data is loaded from a distant source, these options are propagated to the call of `fetch`
|
|
444
|
+
*/
|
|
445
|
+
fetchOptions?: RequestInit): Promise<{
|
|
446
|
+
polylineLayerId: string;
|
|
447
|
+
polylineOutlineLayerId: string;
|
|
448
|
+
polylineSourceId: string;
|
|
449
|
+
}>;
|
|
450
|
+
/**
|
|
451
|
+
* Add a polygon with styling options.
|
|
452
|
+
*/
|
|
453
|
+
export declare function addPolygon(map: SDKMap, options: PolygonLayerOptions): {
|
|
454
|
+
/**
|
|
455
|
+
* ID of the fill layer
|
|
456
|
+
*/
|
|
457
|
+
polygonLayerId: string;
|
|
458
|
+
/**
|
|
459
|
+
* ID of the outline layer (will be `""` if no outline)
|
|
460
|
+
*/
|
|
461
|
+
polygonOutlineLayerId: string;
|
|
462
|
+
/**
|
|
463
|
+
* ID of the source that contains the data
|
|
464
|
+
*/
|
|
465
|
+
polygonSourceId: string;
|
|
466
|
+
};
|
|
467
|
+
/**
|
|
468
|
+
* Add a point layer from a GeoJSON source (or an existing sourceId) with many styling options
|
|
469
|
+
*/
|
|
470
|
+
export declare function addPoint(
|
|
471
|
+
/**
|
|
472
|
+
* The Map instance to add a point layer to
|
|
473
|
+
*/
|
|
474
|
+
map: SDKMap, options: PointLayerOptions): {
|
|
475
|
+
/**
|
|
476
|
+
* ID of the unclustered point layer
|
|
477
|
+
*/
|
|
478
|
+
pointLayerId: string;
|
|
479
|
+
/**
|
|
480
|
+
* ID of the clustered point layer (empty if `cluster` options id `false`)
|
|
481
|
+
*/
|
|
482
|
+
clusterLayerId: string;
|
|
483
|
+
/**
|
|
484
|
+
* ID of the layer that shows the count of elements in each cluster (empty if `cluster` options id `false`)
|
|
485
|
+
*/
|
|
486
|
+
labelLayerId: string;
|
|
487
|
+
/**
|
|
488
|
+
* ID of the data source
|
|
489
|
+
*/
|
|
490
|
+
pointSourceId: string;
|
|
491
|
+
};
|
|
492
|
+
/**
|
|
493
|
+
* Add a polyline witgh optional outline from a GeoJSON object
|
|
494
|
+
*/
|
|
495
|
+
export declare function addHeatmap(
|
|
496
|
+
/**
|
|
497
|
+
* Map instance to add a heatmap layer to
|
|
498
|
+
*/
|
|
499
|
+
map: SDKMap, options: HeatmapLayerOptions): {
|
|
500
|
+
/**
|
|
501
|
+
* ID of the heatmap layer
|
|
502
|
+
*/
|
|
503
|
+
heatmapLayerId: string;
|
|
504
|
+
/**
|
|
505
|
+
* ID of the data source
|
|
506
|
+
*/
|
|
507
|
+
heatmapSourceId: string;
|
|
508
|
+
};
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { default as maplibregl } from 'maplibre-gl';
|
|
2
|
+
export type * from 'maplibre-gl';
|
|
3
|
+
/**
|
|
4
|
+
* Get the version of MapTiler SDK, this is declared in the vite config
|
|
5
|
+
* to avoid importing the entire package.json
|
|
6
|
+
*/
|
|
7
|
+
export declare function getVersion(): string;
|
|
8
|
+
declare const MapMLGL: typeof maplibregl.Map;
|
|
9
|
+
declare const MarkerMLGL: typeof maplibregl.Marker;
|
|
10
|
+
declare const PopupMLGL: typeof maplibregl.Popup;
|
|
11
|
+
declare const StyleMLGL: typeof maplibregl.Style;
|
|
12
|
+
declare const CanvasSourceMLGL: typeof maplibregl.CanvasSource;
|
|
13
|
+
declare const GeoJSONSourceMLGL: typeof maplibregl.GeoJSONSource;
|
|
14
|
+
declare const ImageSourceMLGL: typeof maplibregl.ImageSource;
|
|
15
|
+
declare const RasterTileSourceMLGL: typeof maplibregl.RasterTileSource;
|
|
16
|
+
declare const RasterDEMTileSourceMLGL: typeof maplibregl.RasterDEMTileSource;
|
|
17
|
+
declare const VectorTileSourceMLGL: typeof maplibregl.VectorTileSource;
|
|
18
|
+
declare const VideoSourceMLGL: typeof maplibregl.VideoSource;
|
|
19
|
+
declare const NavigationControMLGL: typeof maplibregl.NavigationControl;
|
|
20
|
+
declare const GeolocateControlMLGL: typeof maplibregl.GeolocateControl;
|
|
21
|
+
declare const AttributionControlMLGL: typeof maplibregl.AttributionControl;
|
|
22
|
+
declare const LogoControlMLGL: typeof maplibregl.LogoControl;
|
|
23
|
+
declare const ScaleControlMLGL: typeof maplibregl.ScaleControl;
|
|
24
|
+
declare const FullscreenControlMLGL: typeof maplibregl.FullscreenControl;
|
|
25
|
+
declare const TerrainControMLGL: typeof maplibregl.TerrainControl;
|
|
26
|
+
declare const BoxZoomHandlerMLGL: typeof maplibregl.BoxZoomHandler;
|
|
27
|
+
declare const ScrollZoomHandlerMLGL: typeof maplibregl.ScrollZoomHandler;
|
|
28
|
+
declare const CooperativeGesturesHandlerMLGL: typeof maplibregl.CooperativeGesturesHandler;
|
|
29
|
+
declare const KeyboardHandlerMLGL: typeof maplibregl.KeyboardHandler;
|
|
30
|
+
declare const TwoFingersTouchPitchHandlerMLGL: typeof maplibregl.TwoFingersTouchPitchHandler;
|
|
31
|
+
declare const MapWheelEventMLGL: typeof maplibregl.MapWheelEvent;
|
|
32
|
+
declare const MapTouchEventMLGL: typeof maplibregl.MapTouchEvent;
|
|
33
|
+
declare const MapMouseEventMLGL: typeof maplibregl.MapMouseEvent;
|
|
34
|
+
declare const configMLGL: {
|
|
35
|
+
MAX_PARALLEL_IMAGE_REQUESTS: number;
|
|
36
|
+
MAX_PARALLEL_IMAGE_REQUESTS_PER_FRAME: number;
|
|
37
|
+
MAX_TILE_CACHE_ZOOM_LEVELS: number;
|
|
38
|
+
REGISTERED_PROTOCOLS: {
|
|
39
|
+
[x: string]: maplibregl.AddProtocolAction;
|
|
40
|
+
};
|
|
41
|
+
WORKER_URL: string;
|
|
42
|
+
};
|
|
43
|
+
declare const getMapLibreVersion: typeof maplibregl.getVersion;
|
|
44
|
+
declare const setRTLTextPlugin: typeof maplibregl.setRTLTextPlugin, getRTLTextPluginStatus: typeof maplibregl.getRTLTextPluginStatus, LngLat: typeof maplibregl.LngLat, LngLatBounds: typeof maplibregl.LngLatBounds, MercatorCoordinate: typeof maplibregl.MercatorCoordinate, Evented: typeof maplibregl.Evented, AJAXError: typeof maplibregl.AJAXError, prewarm: typeof maplibregl.prewarm, clearPrewarmedResources: typeof maplibregl.clearPrewarmedResources, Hash: typeof maplibregl.Hash, Point: typeof maplibregl.Point, EdgeInsets: typeof maplibregl.EdgeInsets, DragRotateHandler: typeof maplibregl.DragRotateHandler, DragPanHandler: typeof maplibregl.DragPanHandler, TwoFingersTouchZoomRotateHandler: typeof maplibregl.TwoFingersTouchZoomRotateHandler, DoubleClickZoomHandler: typeof maplibregl.DoubleClickZoomHandler, TwoFingersTouchZoomHandler: typeof maplibregl.TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler: typeof maplibregl.TwoFingersTouchRotateHandler, getWorkerCount: typeof maplibregl.getWorkerCount, setWorkerCount: typeof maplibregl.setWorkerCount, getMaxParallelImageRequests: typeof maplibregl.getMaxParallelImageRequests, setMaxParallelImageRequests: typeof maplibregl.setMaxParallelImageRequests, getWorkerUrl: typeof maplibregl.getWorkerUrl, setWorkerUrl: typeof maplibregl.setWorkerUrl, addSourceType: (name: string, SourceType: maplibregl.SourceClass) => Promise<void>, importScriptInWorkers: typeof maplibregl.importScriptInWorkers, addProtocol: typeof maplibregl.addProtocol, removeProtocol: typeof maplibregl.removeProtocol;
|
|
45
|
+
export { setRTLTextPlugin, getRTLTextPluginStatus, LngLat, LngLatBounds, MercatorCoordinate, Evented, AJAXError, prewarm, clearPrewarmedResources, Hash, Point, EdgeInsets, DragRotateHandler, DragPanHandler, TwoFingersTouchZoomRotateHandler, DoubleClickZoomHandler, TwoFingersTouchZoomHandler, TwoFingersTouchRotateHandler, getWorkerCount, setWorkerCount, getMaxParallelImageRequests, setMaxParallelImageRequests, getWorkerUrl, setWorkerUrl, addSourceType, importScriptInWorkers, addProtocol, removeProtocol, getMapLibreVersion, MapMLGL, MarkerMLGL, PopupMLGL, StyleMLGL, CanvasSourceMLGL, GeoJSONSourceMLGL, ImageSourceMLGL, RasterTileSourceMLGL, RasterDEMTileSourceMLGL, VectorTileSourceMLGL, VideoSourceMLGL, NavigationControMLGL, GeolocateControlMLGL, AttributionControlMLGL, LogoControlMLGL, ScaleControlMLGL, FullscreenControlMLGL, TerrainControMLGL, BoxZoomHandlerMLGL, ScrollZoomHandlerMLGL, CooperativeGesturesHandlerMLGL, KeyboardHandlerMLGL, TwoFingersTouchPitchHandlerMLGL, MapWheelEventMLGL, MapTouchEventMLGL, MapMouseEventMLGL, configMLGL, };
|
|
46
|
+
export type LngLat = InstanceType<typeof LngLat>;
|
|
47
|
+
export type LngLatBounds = InstanceType<typeof LngLatBounds>;
|
|
48
|
+
export type MercatorCoordinate = InstanceType<typeof MercatorCoordinate>;
|
|
49
|
+
export type Evented = InstanceType<typeof Evented>;
|
|
50
|
+
export type AJAXError = InstanceType<typeof AJAXError>;
|
|
51
|
+
export type Hash = InstanceType<typeof Hash>;
|
|
52
|
+
export type Point = InstanceType<typeof Point>;
|
|
53
|
+
export type EdgeInsets = InstanceType<typeof EdgeInsets>;
|
|
54
|
+
export type DragRotateHandler = InstanceType<typeof DragRotateHandler>;
|
|
55
|
+
export type DragPanHandler = InstanceType<typeof DragPanHandler>;
|
|
56
|
+
export type TwoFingersTouchZoomRotateHandler = InstanceType<typeof TwoFingersTouchZoomRotateHandler>;
|
|
57
|
+
export type DoubleClickZoomHandler = InstanceType<typeof DoubleClickZoomHandler>;
|
|
58
|
+
export type TwoFingersTouchZoomHandler = InstanceType<typeof TwoFingersTouchZoomHandler>;
|
|
59
|
+
export type TwoFingersTouchRotateHandler = InstanceType<typeof TwoFingersTouchRotateHandler>;
|
|
60
|
+
export { Marker } from './MLAdapters/Marker';
|
|
61
|
+
export { Popup } from './MLAdapters/Popup';
|
|
62
|
+
export { Style } from './MLAdapters/Style';
|
|
63
|
+
export { CanvasSource } from './MLAdapters/CanvasSource';
|
|
64
|
+
export { GeoJSONSource } from './MLAdapters/GeoJSONSource';
|
|
65
|
+
export { ImageSource } from './MLAdapters/ImageSource';
|
|
66
|
+
export { RasterTileSource } from './MLAdapters/RasterTileSource';
|
|
67
|
+
export { RasterDEMTileSource } from './MLAdapters/RasterDEMTileSource';
|
|
68
|
+
export { VectorTileSource } from './MLAdapters/VectorTileSource';
|
|
69
|
+
export { VideoSource } from './MLAdapters/VideoSource';
|
|
70
|
+
export { NavigationControl } from './MLAdapters/NavigationControl';
|
|
71
|
+
export { GeolocateControl } from './MLAdapters/GeolocateControl';
|
|
72
|
+
export { AttributionControl } from './MLAdapters/AttributionControl';
|
|
73
|
+
export { LogoControl } from './MLAdapters/LogoControl';
|
|
74
|
+
export { ScaleControl } from './MLAdapters/ScaleControl';
|
|
75
|
+
export { FullscreenControl } from './MLAdapters/FullscreenControl';
|
|
76
|
+
export { TerrainControl } from './MLAdapters/TerrainControl';
|
|
77
|
+
export { BoxZoomHandler } from './MLAdapters/BoxZoomHandler';
|
|
78
|
+
export { ScrollZoomHandler } from './MLAdapters/ScrollZoomHandler';
|
|
79
|
+
export { CooperativeGesturesHandler } from './MLAdapters/CooperativeGesturesHandler';
|
|
80
|
+
export { KeyboardHandler } from './MLAdapters/KeyboardHandler';
|
|
81
|
+
export { TwoFingersTouchPitchHandler } from './MLAdapters/TwoFingersTouchPitchHandler';
|
|
82
|
+
export { MapWheelEvent } from './MLAdapters/MapWheelEvent';
|
|
83
|
+
export { MapTouchEvent } from './MLAdapters/MapTouchEvent';
|
|
84
|
+
export { MapMouseEvent } from './MLAdapters/MapMouseEvent';
|
|
85
|
+
export * from './ml-types';
|
|
86
|
+
export { Map, GeolocationType, type MapOptions, type LoadWithTerrainEvent } from './Map';
|
|
87
|
+
export * from './controls';
|
|
88
|
+
export { type AutomaticStaticMapOptions, type BoundedStaticMapOptions, type BufferToPixelDataFunction, type ByIdGeocodingOptions, type CenteredStaticMapOptions, type CommonForwardAndReverseGeocodingOptions, type CoordinateExport, type CoordinateGrid, type CoordinateId, type CoordinateSearch, type CoordinateSearchResult, type CoordinateTransformResult, type CoordinateTransformation, type Coordinates, type CoordinatesSearchOptions, type CoordinatesTransformOptions, type DefaultTransformation, type ElevationAtOptions, type ElevationBatchOptions, type FeatureHierarchy, type FetchFunction, type GeocodingFeature, type GeocodingOptions, type GeocodingSearchResult, type GeolocationInfoOptions, type GeolocationResult, type GetDataOptions, type LanguageGeocodingOptions, MapStyle, type MapStylePreset, type MapStyleType, MapStyleVariant, type PixelData, ReferenceMapStyle, type ReverseGeocodingOptions, ServiceError, type StaticMapBaseOptions, type StaticMapMarker, type TileJSON, type XYZ, bufferToPixelDataBrowser, circumferenceAtLatitude, coordinates, data, elevation, expandMapStyle, geocoding, geolocation, getBufferToPixelDataParser, getTileCache, mapStylePresetList, math, misc, staticMaps, styleToStyle, type LanguageInfo, areSameLanguages, toLanguageInfo, isLanguageInfo, getAutoLanguage, getLanguageInfoFromFlag, getLanguageInfoFromCode, getLanguageInfoFromKey, canParsePixelData, } from '@maptiler/client';
|
|
89
|
+
export * from './ImageViewer';
|
|
90
|
+
export { getWebGLSupportError, displayWebGLContextLostWarning } from './tools';
|
|
91
|
+
export { config, SdkConfig } from './config';
|
|
92
|
+
export * from './language';
|
|
93
|
+
export type { Unit } from './types';
|
|
94
|
+
export * from './converters';
|
|
95
|
+
export * as helpers from './helpers';
|
|
96
|
+
export type * from './helpers';
|
|
97
|
+
export * from './custom-layers/index';
|
|
98
|
+
export { ColorRamp, ColorRampCollection } from './ColorRamp';
|
|
99
|
+
export type { RgbaColor, ColorStop, ArrayColor, ArrayColorRampStop, ArrayColorRamp, ColorRampOptions } from './ColorRamp';
|
|
100
|
+
export * from './utils';
|