maplibre-gl 2.2.0-pre.2 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -8
- package/build/generate-debug-index-file.ts +19 -0
- package/build/generate-style-code.ts +6 -1
- package/build/generate-style-spec.ts +151 -35
- package/build/rollup_plugins.ts +4 -1
- package/dist/maplibre-gl-csp-worker.js +1 -1
- package/dist/maplibre-gl-csp-worker.js.map +1 -1
- package/dist/maplibre-gl-csp.js +1 -1
- package/dist/maplibre-gl-csp.js.map +1 -1
- package/dist/maplibre-gl-dev.js +1317 -4304
- package/dist/maplibre-gl.css +1 -1
- package/dist/maplibre-gl.d.ts +443 -145
- package/dist/maplibre-gl.js +4 -4
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +70 -67
- package/src/css/maplibre-gl.css +48 -32
- package/src/data/bucket/fill_bucket.test.ts +1 -0
- package/src/data/bucket/symbol_bucket.test.ts +2 -0
- package/src/data/bucket/symbol_bucket.ts +1 -1
- package/src/data/evaluation_feature.ts +1 -1
- package/src/data/program_configuration.ts +2 -2
- package/src/geo/transform.test.ts +34 -1
- package/src/geo/transform.ts +25 -15
- package/src/gl/vertex_buffer.ts +4 -4
- package/src/index.ts +1 -1
- package/src/render/draw_debug.ts +1 -1
- package/src/render/draw_symbol.test.ts +2 -23
- package/src/render/draw_terrain.ts +1 -1
- package/src/render/image_atlas.ts +1 -0
- package/src/render/image_manager.ts +1 -0
- package/src/render/program/debug_program.ts +1 -1
- package/src/render/render_to_texture.ts +3 -0
- package/src/render/terrain.test.ts +119 -17
- package/src/render/terrain.ts +39 -21
- package/src/shaders/README.md +2 -2
- package/src/shaders/shaders.ts +3 -1
- package/src/source/geojson_worker_source.test.ts +2 -2
- package/src/source/geojson_wrapper.test.ts +1 -1
- package/src/source/image_source.test.ts +8 -8
- package/src/source/image_source.ts +1 -1
- package/src/source/load_tilejson.ts +6 -1
- package/src/source/pixels_to_tile_units.ts +1 -1
- package/src/source/raster_tile_source.test.ts +1 -1
- package/src/source/source_cache.test.ts +12 -12
- package/src/source/source_cache.ts +1 -1
- package/src/source/terrain_source_cache.test.ts +17 -2
- package/src/source/terrain_source_cache.ts +16 -12
- package/src/source/vector_tile_source.test.ts +1 -1
- package/src/source/vector_tile_worker_source.test.ts +1 -1
- package/src/source/video_source.test.ts +2 -2
- package/src/style/light.test.ts +1 -1
- package/src/style/load_sprite.ts +1 -1
- package/src/style/parse_glyph_pbf.ts +1 -1
- package/src/style/style.test.ts +3 -3
- package/src/style/style.ts +2 -2
- package/src/style/style_layer/background_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/circle_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/fill_extrusion_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/fill_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/heatmap_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/hillshade_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/line_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/raster_style_layer_properties.g.ts +1 -0
- package/src/style/style_layer/symbol_style_layer.ts +16 -1
- package/src/style/style_layer/symbol_style_layer_properties.g.ts +4 -3
- package/src/style-spec/CHANGELOG.md +5 -0
- package/src/style-spec/composite.test.ts +2 -0
- package/src/style-spec/composite.ts +3 -2
- package/src/style-spec/diff.test.ts +3 -3
- package/src/style-spec/empty.ts +3 -2
- package/src/style-spec/expression/compound_expression.ts +0 -4
- package/src/style-spec/expression/definitions/assertion.ts +0 -18
- package/src/style-spec/expression/definitions/at.ts +0 -4
- package/src/style-spec/expression/definitions/case.ts +0 -6
- package/src/style-spec/expression/definitions/coalesce.ts +0 -6
- package/src/style-spec/expression/definitions/coercion.ts +13 -18
- package/src/style-spec/expression/definitions/collator.ts +0 -10
- package/src/style-spec/expression/definitions/comparison.ts +0 -6
- package/src/style-spec/expression/definitions/format.ts +0 -19
- package/src/style-spec/expression/definitions/image.ts +0 -4
- package/src/style-spec/expression/definitions/in.ts +0 -4
- package/src/style-spec/expression/definitions/index_of.ts +0 -8
- package/src/style-spec/expression/definitions/interpolate.ts +1 -25
- package/src/style-spec/expression/definitions/length.ts +0 -6
- package/src/style-spec/expression/definitions/let.ts +0 -9
- package/src/style-spec/expression/definitions/literal.ts +1 -23
- package/src/style-spec/expression/definitions/match.ts +0 -41
- package/src/style-spec/expression/definitions/number_format.ts +0 -17
- package/src/style-spec/expression/definitions/slice.ts +0 -8
- package/src/style-spec/expression/definitions/step.ts +0 -11
- package/src/style-spec/expression/definitions/var.ts +0 -4
- package/src/style-spec/expression/definitions/within.ts +0 -5
- package/src/style-spec/expression/expression.test.ts +1 -1
- package/src/style-spec/expression/expression.ts +3 -3
- package/src/style-spec/expression/index.ts +8 -2
- package/src/style-spec/expression/parsing_context.ts +2 -0
- package/src/style-spec/expression/types/formatted.ts +0 -23
- package/src/style-spec/expression/types/resolved_image.ts +0 -4
- package/src/style-spec/expression/types.ts +6 -1
- package/src/style-spec/expression/values.ts +9 -4
- package/src/style-spec/feature_filter/convert.ts +65 -65
- package/src/style-spec/feature_filter/feature_filter.test.ts +45 -4
- package/src/style-spec/feature_filter/index.ts +2 -1
- package/src/style-spec/function/index.test.ts +117 -1
- package/src/style-spec/function/index.ts +24 -12
- package/src/style-spec/migrate/expressions.ts +2 -2
- package/src/style-spec/migrate/v8.test.ts +2 -0
- package/src/style-spec/migrate/v8.ts +8 -7
- package/src/style-spec/migrate/v9.test.ts +6 -4
- package/src/style-spec/migrate/v9.ts +3 -2
- package/src/style-spec/migrate.test.ts +3 -1
- package/src/style-spec/migrate.ts +5 -4
- package/src/style-spec/package.json +1 -1
- package/src/style-spec/read_style.ts +2 -1
- package/src/style-spec/reference/latest.ts +1 -1
- package/src/style-spec/reference/v8.json +9 -6
- package/src/style-spec/style-spec.test.ts +2 -1
- package/src/style-spec/style-spec.ts +8 -0
- package/src/style-spec/types.g.ts +152 -36
- package/src/style-spec/util/extend.ts +1 -1
- package/src/style-spec/util/interpolate.test.ts +5 -0
- package/src/style-spec/util/interpolate.ts +12 -0
- package/src/style-spec/util/padding.test.ts +27 -0
- package/src/style-spec/util/padding.ts +64 -0
- package/src/style-spec/util/ref_properties.ts +2 -1
- package/src/style-spec/validate/validate.ts +3 -1
- package/src/style-spec/validate/validate_expression.ts +2 -1
- package/src/style-spec/validate/validate_function.ts +2 -2
- package/src/style-spec/validate/validate_glyphs_url.ts +1 -1
- package/src/style-spec/validate/validate_object.ts +2 -2
- package/src/style-spec/validate/validate_padding.test.ts +82 -0
- package/src/style-spec/validate/validate_padding.ts +36 -0
- package/src/style-spec/validate_style.min.ts +4 -3
- package/src/style-spec/validate_style.ts +4 -3
- package/src/symbol/check_max_angle.test.ts +5 -5
- package/src/symbol/collision_feature.test.ts +22 -5
- package/src/symbol/collision_feature.ts +7 -5
- package/src/symbol/collision_index.ts +1 -1
- package/src/symbol/get_anchors.test.ts +4 -4
- package/src/symbol/{mergelines.test.ts → merge_lines.test.ts} +1 -1
- package/src/symbol/{mergelines.ts → merge_lines.ts} +1 -1
- package/src/symbol/projection.ts +1 -1
- package/src/symbol/quads.test.ts +1 -1
- package/src/symbol/shaping.ts +10 -10
- package/src/symbol/symbol_layout.ts +5 -4
- package/src/symbol/symbol_style_layer.test.ts +1 -1
- package/src/symbol/transform_text.ts +3 -3
- package/src/ui/camera.test.ts +11 -11
- package/src/ui/control/geolocate_control.ts +1 -1
- package/src/ui/control/terrain_control.ts +4 -4
- package/src/ui/handler/cooperative_gestures.test.ts +167 -0
- package/src/ui/handler/drag_pan.test.ts +2 -1
- package/src/ui/handler/scroll_zoom.ts +7 -0
- package/src/ui/handler/touch_pan.ts +22 -2
- package/src/ui/handler/touch_zoom_rotate.ts +18 -1
- package/src/ui/handler_manager.ts +2 -2
- package/src/ui/map.test.ts +17 -17
- package/src/ui/map.ts +76 -8
- package/src/ui/map_events.test.ts +33 -32
- package/src/ui/popup.test.ts +2 -2
- package/src/util/ajax.test.ts +5 -5
- package/src/util/ajax.ts +1 -1
- package/src/util/classify_rings.test.ts +27 -27
- package/src/util/find_pole_of_inaccessibility.ts +1 -1
- package/src/util/primitives.ts +4 -4
- package/src/util/resolve_tokens.test.ts +1 -1
- package/src/util/smart_wrap.ts +1 -1
- package/src/util/tile_request_cache.test.ts +5 -5
- package/src/util/util.test.ts +5 -5
package/dist/maplibre-gl.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v6.
|
|
1
|
+
// Generated by dts-bundle-generator v6.12.0
|
|
2
2
|
|
|
3
3
|
import Point from '@mapbox/point-geometry';
|
|
4
4
|
import TinySDF from '@mapbox/tiny-sdf';
|
|
@@ -74,7 +74,7 @@ export declare class AJAXError extends Error {
|
|
|
74
74
|
}
|
|
75
75
|
export declare type ExpiryData = {
|
|
76
76
|
cacheControl?: string | null;
|
|
77
|
-
expires?: string | null;
|
|
77
|
+
expires?: Date | string | null;
|
|
78
78
|
};
|
|
79
79
|
export declare type GetImageCallback = (error?: Error | null, image?: HTMLImageElement | ImageBitmap | null, expiry?: ExpiryData | null) => void;
|
|
80
80
|
export declare type ResourceTypeEnum = keyof IResourceType;
|
|
@@ -188,103 +188,406 @@ export declare class ZoomHistory {
|
|
|
188
188
|
update(z: number, now: number): boolean;
|
|
189
189
|
}
|
|
190
190
|
export declare type ColorSpecification = string;
|
|
191
|
+
export declare type PaddingSpecification = number | number[];
|
|
191
192
|
export declare type FormattedSpecification = string;
|
|
192
193
|
export declare type ResolvedImageSpecification = string;
|
|
193
194
|
export declare type PromoteIdSpecification = {
|
|
194
195
|
[_: string]: string;
|
|
195
196
|
} | string;
|
|
196
|
-
export declare type
|
|
197
|
-
export declare type
|
|
197
|
+
export declare type ExpressionInputType = string | number | boolean;
|
|
198
|
+
export declare type CollatorExpressionSpecification = [
|
|
199
|
+
"collator",
|
|
200
|
+
{
|
|
201
|
+
"case-sensitive"?: boolean | ExpressionSpecification;
|
|
202
|
+
"diacritic-sensitive"?: boolean | ExpressionSpecification;
|
|
203
|
+
locale?: string | ExpressionSpecification;
|
|
204
|
+
}
|
|
205
|
+
];
|
|
206
|
+
export declare type InterpolationSpecification = [
|
|
207
|
+
"linear"
|
|
208
|
+
] | [
|
|
209
|
+
"exponential",
|
|
210
|
+
number | ExpressionSpecification
|
|
211
|
+
] | [
|
|
212
|
+
"cubic-bezier",
|
|
213
|
+
number | ExpressionSpecification,
|
|
214
|
+
number | ExpressionSpecification,
|
|
215
|
+
number | ExpressionSpecification,
|
|
216
|
+
number | ExpressionSpecification
|
|
217
|
+
];
|
|
218
|
+
export declare type ExpressionSpecification = [
|
|
219
|
+
"array",
|
|
220
|
+
unknown | ExpressionSpecification
|
|
221
|
+
] | [
|
|
222
|
+
"array",
|
|
223
|
+
ExpressionInputType | ExpressionSpecification,
|
|
224
|
+
unknown | ExpressionSpecification
|
|
225
|
+
] | [
|
|
226
|
+
"array",
|
|
227
|
+
ExpressionInputType | ExpressionSpecification,
|
|
228
|
+
number | ExpressionSpecification,
|
|
229
|
+
unknown | ExpressionSpecification
|
|
230
|
+
] | [
|
|
231
|
+
"boolean",
|
|
232
|
+
...(unknown | ExpressionSpecification)[],
|
|
233
|
+
unknown | ExpressionSpecification
|
|
234
|
+
] | CollatorExpressionSpecification | [
|
|
235
|
+
"format",
|
|
236
|
+
...(string | [
|
|
237
|
+
"image",
|
|
238
|
+
ExpressionSpecification
|
|
239
|
+
] | ExpressionSpecification | {
|
|
240
|
+
"font-scale"?: number | ExpressionSpecification;
|
|
241
|
+
"text-font"?: string[] | ExpressionSpecification;
|
|
242
|
+
"text-color": ColorSpecification | ExpressionSpecification;
|
|
243
|
+
})[]
|
|
244
|
+
] | [
|
|
245
|
+
"image",
|
|
246
|
+
unknown | ExpressionSpecification
|
|
247
|
+
] | [
|
|
248
|
+
"literal",
|
|
249
|
+
unknown
|
|
250
|
+
] | [
|
|
251
|
+
"number",
|
|
252
|
+
unknown | ExpressionSpecification,
|
|
253
|
+
...(unknown | ExpressionSpecification)[]
|
|
254
|
+
] | [
|
|
255
|
+
"number-format",
|
|
256
|
+
number | ExpressionSpecification,
|
|
257
|
+
{
|
|
258
|
+
"locale"?: string | ExpressionSpecification;
|
|
259
|
+
"currency"?: string | ExpressionSpecification;
|
|
260
|
+
"min-fraction-digits"?: number | ExpressionSpecification;
|
|
261
|
+
"max-fraction-digits"?: number | ExpressionSpecification;
|
|
262
|
+
}
|
|
263
|
+
] | [
|
|
264
|
+
"object",
|
|
265
|
+
unknown | ExpressionSpecification,
|
|
266
|
+
...(unknown | ExpressionSpecification)[]
|
|
267
|
+
] | [
|
|
268
|
+
"string",
|
|
269
|
+
unknown | ExpressionSpecification,
|
|
270
|
+
...(unknown | ExpressionSpecification)[]
|
|
271
|
+
] | [
|
|
272
|
+
"to-boolean",
|
|
273
|
+
unknown | ExpressionSpecification
|
|
274
|
+
] | [
|
|
275
|
+
"to-color",
|
|
276
|
+
unknown | ExpressionSpecification,
|
|
277
|
+
...(unknown | ExpressionSpecification)[]
|
|
278
|
+
] | [
|
|
279
|
+
"to-number",
|
|
280
|
+
unknown | ExpressionSpecification,
|
|
281
|
+
...(unknown | ExpressionSpecification)[]
|
|
282
|
+
] | [
|
|
283
|
+
"to-string",
|
|
284
|
+
unknown | ExpressionSpecification
|
|
285
|
+
] | [
|
|
286
|
+
"accumulated"
|
|
287
|
+
] | [
|
|
288
|
+
"feature-state",
|
|
289
|
+
string
|
|
290
|
+
] | [
|
|
291
|
+
"geometry-type"
|
|
292
|
+
] | [
|
|
293
|
+
"id"
|
|
294
|
+
] | [
|
|
295
|
+
"line-progress"
|
|
296
|
+
] | [
|
|
297
|
+
"properties"
|
|
298
|
+
] | [
|
|
198
299
|
"at",
|
|
199
|
-
number,
|
|
200
|
-
|
|
300
|
+
number | ExpressionSpecification,
|
|
301
|
+
ExpressionSpecification
|
|
201
302
|
] | [
|
|
202
303
|
"get",
|
|
203
|
-
string,
|
|
204
|
-
Record<string, unknown
|
|
304
|
+
string | ExpressionSpecification,
|
|
305
|
+
(Record<string, unknown> | ExpressionSpecification)?
|
|
205
306
|
] | [
|
|
206
307
|
"has",
|
|
207
|
-
string,
|
|
208
|
-
Record<string, unknown
|
|
308
|
+
string | ExpressionSpecification,
|
|
309
|
+
(Record<string, unknown> | ExpressionSpecification)?
|
|
209
310
|
] | [
|
|
210
311
|
"in",
|
|
211
|
-
|
|
212
|
-
|
|
312
|
+
ExpressionInputType | ExpressionSpecification,
|
|
313
|
+
ExpressionInputType | ExpressionSpecification
|
|
213
314
|
] | [
|
|
214
315
|
"index-of",
|
|
215
|
-
|
|
216
|
-
|
|
316
|
+
ExpressionInputType | ExpressionSpecification,
|
|
317
|
+
ExpressionInputType | ExpressionSpecification
|
|
217
318
|
] | [
|
|
218
319
|
"length",
|
|
219
|
-
string |
|
|
320
|
+
string | ExpressionSpecification
|
|
220
321
|
] | [
|
|
221
322
|
"slice",
|
|
222
|
-
string |
|
|
223
|
-
number
|
|
323
|
+
string | ExpressionSpecification,
|
|
324
|
+
number | ExpressionSpecification
|
|
224
325
|
] | [
|
|
225
326
|
"!",
|
|
226
|
-
|
|
327
|
+
boolean | ExpressionSpecification
|
|
227
328
|
] | [
|
|
228
329
|
"!=",
|
|
229
|
-
|
|
230
|
-
|
|
330
|
+
ExpressionInputType | ExpressionSpecification,
|
|
331
|
+
ExpressionInputType | ExpressionSpecification,
|
|
332
|
+
CollatorExpressionSpecification?
|
|
231
333
|
] | [
|
|
232
334
|
"<",
|
|
233
|
-
|
|
234
|
-
|
|
335
|
+
ExpressionInputType | ExpressionSpecification,
|
|
336
|
+
ExpressionInputType | ExpressionSpecification,
|
|
337
|
+
CollatorExpressionSpecification?
|
|
235
338
|
] | [
|
|
236
339
|
"<=",
|
|
237
|
-
|
|
238
|
-
|
|
340
|
+
ExpressionInputType | ExpressionSpecification,
|
|
341
|
+
ExpressionInputType | ExpressionSpecification,
|
|
342
|
+
CollatorExpressionSpecification?
|
|
239
343
|
] | [
|
|
240
344
|
"==",
|
|
241
|
-
|
|
242
|
-
|
|
345
|
+
ExpressionInputType | ExpressionSpecification,
|
|
346
|
+
ExpressionInputType | ExpressionSpecification,
|
|
347
|
+
CollatorExpressionSpecification?
|
|
243
348
|
] | [
|
|
244
349
|
">",
|
|
245
|
-
|
|
246
|
-
|
|
350
|
+
ExpressionInputType | ExpressionSpecification,
|
|
351
|
+
ExpressionInputType | ExpressionSpecification,
|
|
352
|
+
CollatorExpressionSpecification?
|
|
247
353
|
] | [
|
|
248
354
|
">=",
|
|
249
|
-
|
|
250
|
-
|
|
355
|
+
ExpressionInputType | ExpressionSpecification,
|
|
356
|
+
ExpressionInputType | ExpressionSpecification,
|
|
357
|
+
CollatorExpressionSpecification?
|
|
251
358
|
] | [
|
|
252
359
|
"all",
|
|
253
|
-
...
|
|
254
|
-
FilterSpecificationInputType
|
|
360
|
+
...(boolean | ExpressionSpecification)[]
|
|
255
361
|
] | [
|
|
256
362
|
"any",
|
|
257
|
-
...
|
|
258
|
-
FilterSpecificationInputType
|
|
363
|
+
...(boolean | ExpressionSpecification)[]
|
|
259
364
|
] | [
|
|
260
365
|
"case",
|
|
261
|
-
|
|
262
|
-
|
|
366
|
+
boolean | ExpressionSpecification,
|
|
367
|
+
ExpressionInputType | ExpressionSpecification,
|
|
368
|
+
...(boolean | ExpressionInputType | ExpressionSpecification)[],
|
|
369
|
+
ExpressionInputType | ExpressionSpecification
|
|
263
370
|
] | [
|
|
264
371
|
"coalesce",
|
|
265
|
-
|
|
266
|
-
|
|
372
|
+
ExpressionInputType | ExpressionSpecification,
|
|
373
|
+
ExpressionInputType | ExpressionSpecification,
|
|
374
|
+
...(ExpressionInputType | ExpressionSpecification)[]
|
|
267
375
|
] | [
|
|
268
376
|
"match",
|
|
269
|
-
|
|
270
|
-
|
|
377
|
+
ExpressionInputType | ExpressionSpecification,
|
|
378
|
+
ExpressionInputType | ExpressionInputType[],
|
|
379
|
+
ExpressionInputType | ExpressionSpecification,
|
|
380
|
+
...(ExpressionInputType | ExpressionInputType[] | ExpressionSpecification)[],
|
|
381
|
+
ExpressionInputType
|
|
271
382
|
] | [
|
|
272
383
|
"within",
|
|
273
|
-
|
|
274
|
-
FilterSpecificationInputType
|
|
384
|
+
unknown | ExpressionSpecification
|
|
275
385
|
] | [
|
|
276
|
-
"
|
|
277
|
-
|
|
278
|
-
|
|
386
|
+
"interpolate",
|
|
387
|
+
InterpolationSpecification,
|
|
388
|
+
number | ExpressionSpecification,
|
|
389
|
+
number | ExpressionSpecification,
|
|
390
|
+
ExpressionInputType | ExpressionSpecification,
|
|
391
|
+
...(number | ExpressionInputType | ExpressionSpecification)[]
|
|
392
|
+
] | [
|
|
393
|
+
"interpolate-hcl",
|
|
394
|
+
InterpolationSpecification,
|
|
395
|
+
number | ExpressionSpecification,
|
|
396
|
+
number | ExpressionSpecification,
|
|
397
|
+
ExpressionInputType | ExpressionSpecification,
|
|
398
|
+
...(number | ColorSpecification | ExpressionSpecification)[]
|
|
399
|
+
] | [
|
|
400
|
+
"interpolate-lab",
|
|
401
|
+
InterpolationSpecification,
|
|
402
|
+
number | ExpressionSpecification,
|
|
403
|
+
number | ExpressionSpecification,
|
|
404
|
+
ExpressionInputType | ExpressionSpecification,
|
|
405
|
+
...(number | ColorSpecification | ExpressionSpecification)[]
|
|
406
|
+
] | [
|
|
407
|
+
"step",
|
|
408
|
+
number | ExpressionSpecification,
|
|
409
|
+
number | ExpressionSpecification,
|
|
410
|
+
ExpressionInputType | ExpressionSpecification,
|
|
411
|
+
...(number | ExpressionInputType | ExpressionSpecification)[]
|
|
412
|
+
] | [
|
|
413
|
+
"let",
|
|
414
|
+
string,
|
|
415
|
+
ExpressionInputType | ExpressionSpecification,
|
|
416
|
+
...(string | ExpressionInputType | ExpressionSpecification)[]
|
|
417
|
+
] | [
|
|
418
|
+
"var",
|
|
419
|
+
string
|
|
420
|
+
] | [
|
|
421
|
+
"concat",
|
|
422
|
+
ExpressionInputType | ExpressionSpecification,
|
|
423
|
+
ExpressionInputType | ExpressionSpecification,
|
|
424
|
+
...(ExpressionInputType | ExpressionSpecification)[]
|
|
425
|
+
] | [
|
|
426
|
+
"downcase",
|
|
427
|
+
string | ExpressionSpecification
|
|
428
|
+
] | [
|
|
429
|
+
"is-supported-script",
|
|
430
|
+
string | ExpressionSpecification
|
|
431
|
+
] | [
|
|
432
|
+
"resolved-locale",
|
|
433
|
+
CollatorExpressionSpecification
|
|
434
|
+
] | [
|
|
435
|
+
"upcase",
|
|
436
|
+
string | ExpressionSpecification
|
|
437
|
+
] | [
|
|
438
|
+
"rgb",
|
|
439
|
+
number | ExpressionSpecification,
|
|
440
|
+
number | ExpressionSpecification,
|
|
441
|
+
number | ExpressionSpecification
|
|
442
|
+
] | [
|
|
443
|
+
"rgba",
|
|
444
|
+
number | ExpressionSpecification,
|
|
445
|
+
number | ExpressionSpecification,
|
|
446
|
+
number | ExpressionSpecification,
|
|
447
|
+
number | ExpressionSpecification
|
|
448
|
+
] | [
|
|
449
|
+
"to-rgba",
|
|
450
|
+
ColorSpecification | ExpressionSpecification
|
|
451
|
+
] | [
|
|
452
|
+
"-",
|
|
453
|
+
number | ExpressionSpecification,
|
|
454
|
+
(number | ExpressionSpecification)?
|
|
455
|
+
] | [
|
|
456
|
+
"*",
|
|
457
|
+
number | ExpressionSpecification,
|
|
458
|
+
number | ExpressionSpecification,
|
|
459
|
+
...(number | ExpressionSpecification)[]
|
|
460
|
+
] | [
|
|
461
|
+
"/",
|
|
462
|
+
number | ExpressionSpecification,
|
|
463
|
+
number | ExpressionSpecification
|
|
464
|
+
] | [
|
|
465
|
+
"%",
|
|
466
|
+
number | ExpressionSpecification,
|
|
467
|
+
number | ExpressionSpecification
|
|
468
|
+
] | [
|
|
469
|
+
"^",
|
|
470
|
+
number | ExpressionSpecification,
|
|
471
|
+
number | ExpressionSpecification
|
|
472
|
+
] | [
|
|
473
|
+
"+",
|
|
474
|
+
number | ExpressionSpecification,
|
|
475
|
+
number | ExpressionSpecification,
|
|
476
|
+
...(number | ExpressionSpecification)[]
|
|
477
|
+
] | [
|
|
478
|
+
"abs",
|
|
479
|
+
number | ExpressionSpecification
|
|
480
|
+
] | [
|
|
481
|
+
"acos",
|
|
482
|
+
number | ExpressionSpecification
|
|
483
|
+
] | [
|
|
484
|
+
"asin",
|
|
485
|
+
number | ExpressionSpecification
|
|
486
|
+
] | [
|
|
487
|
+
"atan",
|
|
488
|
+
number | ExpressionSpecification
|
|
489
|
+
] | [
|
|
490
|
+
"ceil",
|
|
491
|
+
number | ExpressionSpecification
|
|
492
|
+
] | [
|
|
493
|
+
"cos",
|
|
494
|
+
number | ExpressionSpecification
|
|
495
|
+
] | [
|
|
496
|
+
"distance",
|
|
497
|
+
Record<string, unknown> | ExpressionSpecification
|
|
498
|
+
] | [
|
|
499
|
+
"ExpressionSpecification"
|
|
500
|
+
] | [
|
|
501
|
+
"floor",
|
|
502
|
+
number | ExpressionSpecification
|
|
503
|
+
] | [
|
|
504
|
+
"ln",
|
|
505
|
+
number | ExpressionSpecification
|
|
506
|
+
] | [
|
|
507
|
+
"ln2"
|
|
508
|
+
] | [
|
|
509
|
+
"log10",
|
|
510
|
+
number | ExpressionSpecification
|
|
511
|
+
] | [
|
|
512
|
+
"log2",
|
|
513
|
+
number | ExpressionSpecification
|
|
514
|
+
] | [
|
|
515
|
+
"max",
|
|
516
|
+
number | ExpressionSpecification,
|
|
517
|
+
...(number | ExpressionSpecification)[]
|
|
518
|
+
] | [
|
|
519
|
+
"min",
|
|
520
|
+
number | ExpressionSpecification,
|
|
521
|
+
...(number | ExpressionSpecification)[]
|
|
522
|
+
] | [
|
|
523
|
+
"pi"
|
|
524
|
+
] | [
|
|
525
|
+
"round",
|
|
526
|
+
number | ExpressionSpecification
|
|
527
|
+
] | [
|
|
528
|
+
"sin",
|
|
529
|
+
number | ExpressionSpecification
|
|
530
|
+
] | [
|
|
531
|
+
"sqrt",
|
|
532
|
+
number | ExpressionSpecification
|
|
533
|
+
] | [
|
|
534
|
+
"tan",
|
|
535
|
+
number | ExpressionSpecification
|
|
536
|
+
] | [
|
|
537
|
+
"zoom"
|
|
538
|
+
] | [
|
|
539
|
+
"heatmap-density"
|
|
540
|
+
];
|
|
541
|
+
export declare type ExpressionFilterSpecification = boolean | ExpressionSpecification;
|
|
542
|
+
export declare type LegacyFilterSpecification = [
|
|
543
|
+
"has",
|
|
544
|
+
string
|
|
279
545
|
] | [
|
|
280
546
|
"!has",
|
|
281
|
-
|
|
282
|
-
|
|
547
|
+
string
|
|
548
|
+
] | [
|
|
549
|
+
"==",
|
|
550
|
+
string,
|
|
551
|
+
string | number | boolean
|
|
552
|
+
] | [
|
|
553
|
+
"!=",
|
|
554
|
+
string,
|
|
555
|
+
string | number | boolean
|
|
556
|
+
] | [
|
|
557
|
+
">",
|
|
558
|
+
string,
|
|
559
|
+
string | number | boolean
|
|
560
|
+
] | [
|
|
561
|
+
">=",
|
|
562
|
+
string,
|
|
563
|
+
string | number | boolean
|
|
564
|
+
] | [
|
|
565
|
+
"<",
|
|
566
|
+
string,
|
|
567
|
+
string | number | boolean
|
|
568
|
+
] | [
|
|
569
|
+
"<=",
|
|
570
|
+
string,
|
|
571
|
+
string | number | boolean
|
|
572
|
+
] | [
|
|
573
|
+
"in",
|
|
574
|
+
string,
|
|
575
|
+
...(string | number | boolean)[]
|
|
576
|
+
] | [
|
|
577
|
+
"!in",
|
|
578
|
+
string,
|
|
579
|
+
...(string | number | boolean)[]
|
|
580
|
+
] | [
|
|
581
|
+
"all",
|
|
582
|
+
...LegacyFilterSpecification[]
|
|
583
|
+
] | [
|
|
584
|
+
"any",
|
|
585
|
+
...LegacyFilterSpecification[]
|
|
283
586
|
] | [
|
|
284
587
|
"none",
|
|
285
|
-
...
|
|
286
|
-
|
|
287
|
-
|
|
588
|
+
...LegacyFilterSpecification[]
|
|
589
|
+
];
|
|
590
|
+
export declare type FilterSpecification = ExpressionFilterSpecification | LegacyFilterSpecification;
|
|
288
591
|
export declare type TransitionSpecification = {
|
|
289
592
|
duration?: number;
|
|
290
593
|
delay?: number;
|
|
@@ -365,9 +668,8 @@ export declare type CompositeFunctionSpecification<T> = {
|
|
|
365
668
|
property: string;
|
|
366
669
|
default?: T;
|
|
367
670
|
};
|
|
368
|
-
export declare type
|
|
369
|
-
export declare type
|
|
370
|
-
export declare type DataDrivenPropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecificationArray;
|
|
671
|
+
export declare type PropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | ExpressionSpecification;
|
|
672
|
+
export declare type DataDrivenPropertyValueSpecification<T> = T | CameraFunctionSpecification<T> | SourceFunctionSpecification<T> | CompositeFunctionSpecification<T> | ExpressionSpecification;
|
|
371
673
|
export declare type StyleSpecification = {
|
|
372
674
|
"version": 8;
|
|
373
675
|
"name"?: string;
|
|
@@ -571,7 +873,7 @@ export declare type LineLayerSpecification = {
|
|
|
571
873
|
"line-blur"?: DataDrivenPropertyValueSpecification<number>;
|
|
572
874
|
"line-dasharray"?: PropertyValueSpecification<Array<number>>;
|
|
573
875
|
"line-pattern"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
|
|
574
|
-
"line-gradient"?:
|
|
876
|
+
"line-gradient"?: ExpressionSpecification;
|
|
575
877
|
};
|
|
576
878
|
};
|
|
577
879
|
export declare type SymbolLayerSpecification = {
|
|
@@ -604,7 +906,7 @@ export declare type SymbolLayerSpecification = {
|
|
|
604
906
|
]>;
|
|
605
907
|
"icon-image"?: DataDrivenPropertyValueSpecification<ResolvedImageSpecification>;
|
|
606
908
|
"icon-rotate"?: DataDrivenPropertyValueSpecification<number>;
|
|
607
|
-
"icon-padding"?:
|
|
909
|
+
"icon-padding"?: DataDrivenPropertyValueSpecification<PaddingSpecification>;
|
|
608
910
|
"icon-keep-upright"?: PropertyValueSpecification<boolean>;
|
|
609
911
|
"icon-offset"?: DataDrivenPropertyValueSpecification<[
|
|
610
912
|
number,
|
|
@@ -709,7 +1011,7 @@ export declare type HeatmapLayerSpecification = {
|
|
|
709
1011
|
"heatmap-radius"?: DataDrivenPropertyValueSpecification<number>;
|
|
710
1012
|
"heatmap-weight"?: DataDrivenPropertyValueSpecification<number>;
|
|
711
1013
|
"heatmap-intensity"?: PropertyValueSpecification<number>;
|
|
712
|
-
"heatmap-color"?:
|
|
1014
|
+
"heatmap-color"?: ExpressionSpecification;
|
|
713
1015
|
"heatmap-opacity"?: PropertyValueSpecification<number>;
|
|
714
1016
|
};
|
|
715
1017
|
};
|
|
@@ -1180,7 +1482,6 @@ export declare class ResolvedImage {
|
|
|
1180
1482
|
constructor(options: ResolvedImageOptions);
|
|
1181
1483
|
toString(): string;
|
|
1182
1484
|
static fromString(name: string): ResolvedImage | null;
|
|
1183
|
-
serialize(): Array<string>;
|
|
1184
1485
|
}
|
|
1185
1486
|
export declare class FormattedSection {
|
|
1186
1487
|
text: string;
|
|
@@ -1197,9 +1498,29 @@ export declare class Formatted {
|
|
|
1197
1498
|
isEmpty(): boolean;
|
|
1198
1499
|
static factory(text: Formatted | string): Formatted;
|
|
1199
1500
|
toString(): string;
|
|
1200
|
-
serialize(): Array<unknown>;
|
|
1201
1501
|
}
|
|
1202
|
-
export declare
|
|
1502
|
+
export declare class Padding {
|
|
1503
|
+
/** Padding values are in CSS order: top, right, bottom, left */
|
|
1504
|
+
values: [
|
|
1505
|
+
number,
|
|
1506
|
+
number,
|
|
1507
|
+
number,
|
|
1508
|
+
number
|
|
1509
|
+
];
|
|
1510
|
+
constructor(values: [
|
|
1511
|
+
number,
|
|
1512
|
+
number,
|
|
1513
|
+
number,
|
|
1514
|
+
number
|
|
1515
|
+
]);
|
|
1516
|
+
/**
|
|
1517
|
+
* Numeric padding values
|
|
1518
|
+
* @returns A `Padding` instance, or `undefined` if the input is not a valid padding value.
|
|
1519
|
+
*/
|
|
1520
|
+
static parse(input?: number | number[] | Padding | null): Padding | void;
|
|
1521
|
+
toString(): string;
|
|
1522
|
+
}
|
|
1523
|
+
export declare type Value = null | string | boolean | number | Color | Collator | Formatted | Padding | ResolvedImage | ReadonlyArray<Value> | {
|
|
1203
1524
|
readonly [x: string]: Value;
|
|
1204
1525
|
};
|
|
1205
1526
|
export declare type InterpolationType = {
|
|
@@ -1328,6 +1649,12 @@ export declare type StylePropertySpecification = {
|
|
|
1328
1649
|
length?: number;
|
|
1329
1650
|
transition: boolean;
|
|
1330
1651
|
default?: Array<string>;
|
|
1652
|
+
} | {
|
|
1653
|
+
type: "padding";
|
|
1654
|
+
"property-type": ExpressionType;
|
|
1655
|
+
expression?: ExpressionSpecification;
|
|
1656
|
+
transition: boolean;
|
|
1657
|
+
default?: number | Array<number>;
|
|
1331
1658
|
};
|
|
1332
1659
|
export declare type TimePoint = number;
|
|
1333
1660
|
export declare type CrossFaded<T> = {
|
|
@@ -4771,7 +5098,7 @@ export declare class SourceCache extends Evented {
|
|
|
4771
5098
|
* are inside the viewport.
|
|
4772
5099
|
* @private
|
|
4773
5100
|
*/
|
|
4774
|
-
update(transform: Transform, terrain
|
|
5101
|
+
update(transform: Transform, terrain?: Terrain): void;
|
|
4775
5102
|
releaseSymbolFadeTiles(): void;
|
|
4776
5103
|
_updateRetainedTiles(idealTileIDs: Array<OverscaledTileID>, zoom: number): {
|
|
4777
5104
|
[_: string]: OverscaledTileID;
|
|
@@ -4862,7 +5189,7 @@ export declare type SymbolLayoutProps = {
|
|
|
4862
5189
|
]>;
|
|
4863
5190
|
"icon-image": DataDrivenProperty<ResolvedImage>;
|
|
4864
5191
|
"icon-rotate": DataDrivenProperty<number>;
|
|
4865
|
-
"icon-padding":
|
|
5192
|
+
"icon-padding": DataDrivenProperty<Padding>;
|
|
4866
5193
|
"icon-keep-upright": DataConstantProperty<boolean>;
|
|
4867
5194
|
"icon-offset": DataDrivenProperty<[
|
|
4868
5195
|
number,
|
|
@@ -4918,7 +5245,7 @@ export declare type SymbolLayoutPropsPossiblyEvaluated = {
|
|
|
4918
5245
|
];
|
|
4919
5246
|
"icon-image": PossiblyEvaluatedPropertyValue<ResolvedImage>;
|
|
4920
5247
|
"icon-rotate": PossiblyEvaluatedPropertyValue<number>;
|
|
4921
|
-
"icon-padding":
|
|
5248
|
+
"icon-padding": PossiblyEvaluatedPropertyValue<Padding>;
|
|
4922
5249
|
"icon-keep-upright": boolean;
|
|
4923
5250
|
"icon-offset": PossiblyEvaluatedPropertyValue<[
|
|
4924
5251
|
number,
|
|
@@ -5512,13 +5839,11 @@ export declare class TerrainSourceCache extends Evented {
|
|
|
5512
5839
|
*/
|
|
5513
5840
|
getTileByID(id: string): Tile;
|
|
5514
5841
|
/**
|
|
5515
|
-
*
|
|
5842
|
+
* Searches for the corresponding current renderable terrain-tiles
|
|
5516
5843
|
* @param {OverscaledTileID} tileID - the tile to look for
|
|
5517
|
-
* @returns {
|
|
5844
|
+
* @returns {Record<string, OverscaledTileID>} - the tiles that were found
|
|
5518
5845
|
*/
|
|
5519
|
-
getTerrainCoords(tileID: OverscaledTileID):
|
|
5520
|
-
[_: string]: OverscaledTileID;
|
|
5521
|
-
};
|
|
5846
|
+
getTerrainCoords(tileID: OverscaledTileID): Record<string, OverscaledTileID>;
|
|
5522
5847
|
/**
|
|
5523
5848
|
* find the covering raster-dem tile
|
|
5524
5849
|
* @param {OverscaledTileID} tileID - the tile to look for
|
|
@@ -5533,33 +5858,6 @@ export declare class TerrainSourceCache extends Evented {
|
|
|
5533
5858
|
*/
|
|
5534
5859
|
tilesAfterTime(time?: number): Array<Tile>;
|
|
5535
5860
|
}
|
|
5536
|
-
/**
|
|
5537
|
-
* This is the main class which handles most of the 3D Terrain logic. It has the follwing topics:
|
|
5538
|
-
* 1) loads raster-dem tiles via the internal sourceCache this.sourceCache
|
|
5539
|
-
* 2) creates a depth-framebuffer, which is used to calculate the visibility of coordinates
|
|
5540
|
-
* 3) creates a coords-framebuffer, which is used the get to tile-coordinate for a screen-pixel
|
|
5541
|
-
* 4) stores all render-to-texture tiles in the this.sourceCache._tiles
|
|
5542
|
-
* 5) calculates the elevation for a spezific tile-coordinate
|
|
5543
|
-
* 6) creates a terrain-mesh
|
|
5544
|
-
*
|
|
5545
|
-
* A note about the GPU resource-usage:
|
|
5546
|
-
* Framebuffers:
|
|
5547
|
-
* - one for the depth & coords framebuffer with the size of the map-div.
|
|
5548
|
-
* - one for rendering a tile to texture with the size of tileSize (= 512x512).
|
|
5549
|
-
* Textures:
|
|
5550
|
-
* - one texture for an empty raster-dem tile with size 1x1
|
|
5551
|
-
* - one texture for an empty depth-buffer, when terrain is disabled with size 1x1
|
|
5552
|
-
* - one texture for an each loaded raster-dem with size of the source.tileSize
|
|
5553
|
-
* - one texture for the coords-framebuffer with the size of the map-div.
|
|
5554
|
-
* - one texture for the depth-framebuffer with the size of the map-div.
|
|
5555
|
-
* - one texture for the encoded tile-coords with the size 2*tileSize (=1024x1024)
|
|
5556
|
-
* - finally for each render-to-texture tile (= this._tiles) a set of textures
|
|
5557
|
-
* for each render stack (The stack-concept is documented in painter.ts).
|
|
5558
|
-
* Normally there exists 1-3 Textures per tile, depending on the stylesheet.
|
|
5559
|
-
* Each Textures has the size 2*tileSize (= 1024x1024). Also there exists a
|
|
5560
|
-
* cache of the last 150 newest rendered tiles.
|
|
5561
|
-
*
|
|
5562
|
-
*/
|
|
5563
5861
|
export declare type TerrainData = {
|
|
5564
5862
|
"u_depth": number;
|
|
5565
5863
|
"u_terrain": number;
|
|
@@ -5669,6 +5967,18 @@ export declare class Terrain {
|
|
|
5669
5967
|
* @returns {TerrainMesh} - the created regular mesh
|
|
5670
5968
|
*/
|
|
5671
5969
|
getTerrainMesh(): TerrainMesh;
|
|
5970
|
+
/**
|
|
5971
|
+
* Get the minimum and maximum elevation contained in a tile. This includes any elevation offset
|
|
5972
|
+
* and exaggeration included in the terrain.
|
|
5973
|
+
*
|
|
5974
|
+
* @param tileID Id of the tile to be used as a source for the min/max elevation
|
|
5975
|
+
* @returns {Object} Minimum and maximum elevation found in the tile, including the terrain's
|
|
5976
|
+
* elevation offset and exaggeration
|
|
5977
|
+
*/
|
|
5978
|
+
getMinMaxElevation(tileID: OverscaledTileID): {
|
|
5979
|
+
minElevation: number | null;
|
|
5980
|
+
maxElevation: number | null;
|
|
5981
|
+
};
|
|
5672
5982
|
}
|
|
5673
5983
|
export declare class Transform {
|
|
5674
5984
|
tileSize: number;
|
|
@@ -5835,7 +6145,7 @@ export declare class Transform {
|
|
|
5835
6145
|
* get the elevation from terrain for the current zoomlevel.
|
|
5836
6146
|
* @param lnglat the location
|
|
5837
6147
|
* @param terrain the terrain
|
|
5838
|
-
* @returns {
|
|
6148
|
+
* @returns {number} elevation in meters
|
|
5839
6149
|
*/
|
|
5840
6150
|
getElevation(lnglat: LngLat, terrain: Terrain): number;
|
|
5841
6151
|
/**
|
|
@@ -5896,8 +6206,8 @@ export declare class Transform {
|
|
|
5896
6206
|
/**
|
|
5897
6207
|
* Given a coordinate, return the screen point that corresponds to it
|
|
5898
6208
|
* @param {Coordinate} coord
|
|
5899
|
-
* @
|
|
5900
|
-
* @
|
|
6209
|
+
* @param {number} elevation default = 0
|
|
6210
|
+
* @param {mat4} pixelMatrix, default = this.pixelMatrix
|
|
5901
6211
|
* @returns {Point} screen point
|
|
5902
6212
|
* @private
|
|
5903
6213
|
*/
|
|
@@ -7123,7 +7433,7 @@ export declare class CollisionIndex {
|
|
|
7123
7433
|
queryRenderedSymbols(viewportQueryGeometry: Array<Point>): {};
|
|
7124
7434
|
insertCollisionBox(collisionBox: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
|
|
7125
7435
|
insertCollisionCircles(collisionCircles: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
|
|
7126
|
-
projectAndGetPerspectiveRatio(posMatrix: mat4, x: number, y: number, getElevation
|
|
7436
|
+
projectAndGetPerspectiveRatio(posMatrix: mat4, x: number, y: number, getElevation?: (x: number, y: number) => number): {
|
|
7127
7437
|
point: Point;
|
|
7128
7438
|
perspectiveRatio: number;
|
|
7129
7439
|
};
|
|
@@ -7597,9 +7907,12 @@ export declare class TouchPanHandler {
|
|
|
7597
7907
|
_minTouches: number;
|
|
7598
7908
|
_clickTolerance: number;
|
|
7599
7909
|
_sum: Point;
|
|
7910
|
+
_map: Map;
|
|
7911
|
+
_cancelCooperativeMessage: boolean;
|
|
7600
7912
|
constructor(options: {
|
|
7601
7913
|
clickTolerance: number;
|
|
7602
|
-
|
|
7914
|
+
cooperativeGestures: boolean | GestureOptions;
|
|
7915
|
+
}, map: Map);
|
|
7603
7916
|
reset(): void;
|
|
7604
7917
|
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): {
|
|
7605
7918
|
around: Point;
|
|
@@ -8640,7 +8953,11 @@ export declare class TouchPitchHandler extends TwoTouchHandler {
|
|
|
8640
8953
|
Point,
|
|
8641
8954
|
Point
|
|
8642
8955
|
];
|
|
8956
|
+
_map: Map;
|
|
8957
|
+
_currentTouchCount: number;
|
|
8958
|
+
constructor(map: Map);
|
|
8643
8959
|
reset(): void;
|
|
8960
|
+
touchstart(e: TouchEvent, points: Array<Point>, mapTouches: Array<Touch>): void;
|
|
8644
8961
|
_start(points: [
|
|
8645
8962
|
Point,
|
|
8646
8963
|
Point
|
|
@@ -9048,6 +9365,7 @@ export declare type MapOptions = {
|
|
|
9048
9365
|
doubleClickZoom?: boolean;
|
|
9049
9366
|
touchZoomRotate?: boolean;
|
|
9050
9367
|
touchPitch?: boolean;
|
|
9368
|
+
cooperativeGestures?: boolean | GestureOptions;
|
|
9051
9369
|
trackResize?: boolean;
|
|
9052
9370
|
center?: LngLatLike;
|
|
9053
9371
|
zoom?: number;
|
|
@@ -9068,6 +9386,11 @@ export declare type MapOptions = {
|
|
|
9068
9386
|
pitchWithRotate?: boolean;
|
|
9069
9387
|
pixelRatio?: number;
|
|
9070
9388
|
};
|
|
9389
|
+
export declare type GestureOptions = {
|
|
9390
|
+
windowsHelpText?: string;
|
|
9391
|
+
macHelpText?: string;
|
|
9392
|
+
mobileHelpText?: string;
|
|
9393
|
+
};
|
|
9071
9394
|
export declare type Complete<T> = {
|
|
9072
9395
|
[P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);
|
|
9073
9396
|
};
|
|
@@ -9083,6 +9406,9 @@ export declare class Map extends Camera {
|
|
|
9083
9406
|
[_: string]: HTMLElement;
|
|
9084
9407
|
};
|
|
9085
9408
|
_interactive: boolean;
|
|
9409
|
+
_cooperativeGestures: boolean | GestureOptions;
|
|
9410
|
+
_cooperativeGesturesScreen: HTMLElement;
|
|
9411
|
+
_metaPress: boolean;
|
|
9086
9412
|
_showTileBoundaries: boolean;
|
|
9087
9413
|
_showCollisionBoxes: boolean;
|
|
9088
9414
|
_showPadding: boolean;
|
|
@@ -9485,7 +9811,7 @@ export declare class Map extends Camera {
|
|
|
9485
9811
|
* | [`dataabort`](#map.event:dataabort) | |
|
|
9486
9812
|
* | [`sourcedataabort`](#map.event:sourcedataabort) | |
|
|
9487
9813
|
*
|
|
9488
|
-
* @param {string | Listener}
|
|
9814
|
+
* @param {string | Listener} layer The ID of a style layer or a listener if no ID is provided. Event will only be triggered if its location
|
|
9489
9815
|
* is within a visible feature in this layer. The event will have a `features` property containing
|
|
9490
9816
|
* an array of the matching features. If `layerIdOrListener` is not supplied, the event will not have a `features` property.
|
|
9491
9817
|
* Please note that many event types are not compatible with the optional `layerIdOrListener` parameter.
|
|
@@ -9552,7 +9878,7 @@ export declare class Map extends Camera {
|
|
|
9552
9878
|
* a visible portion of the specified layer from outside that layer or outside the map canvas. `mouseleave`
|
|
9553
9879
|
* and `mouseout` events are triggered when the cursor leaves a visible portion of the specified layer, or leaves
|
|
9554
9880
|
* the map canvas.
|
|
9555
|
-
* @param {string}
|
|
9881
|
+
* @param {string} layer The ID of a style layer or a listener if no ID is provided. Only events whose location is within a visible
|
|
9556
9882
|
* feature in this layer will trigger the listener. The event will have a `features` property containing
|
|
9557
9883
|
* an array of the matching features.
|
|
9558
9884
|
* @param {Function} listener The function to be called when the event is fired.
|
|
@@ -9576,7 +9902,7 @@ export declare class Map extends Camera {
|
|
|
9576
9902
|
* Removes an event listener for layer-specific events previously added with `Map#on`.
|
|
9577
9903
|
*
|
|
9578
9904
|
* @param {string} type The event type previously used to install the listener.
|
|
9579
|
-
* @param {string}
|
|
9905
|
+
* @param {string} layer The layer ID or listener previously used to install the listener.
|
|
9580
9906
|
* @param {Function} listener The function previously installed as a listener.
|
|
9581
9907
|
* @returns {Map} `this`
|
|
9582
9908
|
*/
|
|
@@ -10013,7 +10339,10 @@ export declare class Map extends Camera {
|
|
|
10013
10339
|
* A layer defines how data from a specified source will be styled. Read more about layer types
|
|
10014
10340
|
* and available paint and layout properties in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layers).
|
|
10015
10341
|
*
|
|
10016
|
-
* @param {
|
|
10342
|
+
* TODO: JSDoc can't pass @param {(LayerSpecification & {source?: string | SourceSpecification}) | CustomLayerInterface} layer The layer to add,
|
|
10343
|
+
* @param {Object} layer
|
|
10344
|
+
* conforming to either the MapLibre Style Specification's [layer definition](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layers) or,
|
|
10345
|
+
* less commonly, the {@link CustomLayerInterface} specification.
|
|
10017
10346
|
* The MapLibre Style Specification's layer definition is appropriate for most layers.
|
|
10018
10347
|
*
|
|
10019
10348
|
* @param {string} layer.id A unique identifer that you define.
|
|
@@ -10021,10 +10350,10 @@ export declare class Map extends Camera {
|
|
|
10021
10350
|
* A list of layer types is available in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/layers/#type).
|
|
10022
10351
|
*
|
|
10023
10352
|
* (This can also be `custom`. For more information, see {@link CustomLayerInterface}.)
|
|
10024
|
-
* @param {string |
|
|
10353
|
+
* @param {string | SourceSpecification} [layer.source] The data source for the layer.
|
|
10025
10354
|
* Reference a source that has _already been defined_ using the source's unique id.
|
|
10026
10355
|
* Reference a _new source_ using a source object (as defined in the [MapLibre Style Specification](https://maplibre.org/maplibre-gl-js-docs/style-spec/sources/)) directly.
|
|
10027
|
-
* This is **required** for all `layer.type` options _except_ for `custom`.
|
|
10356
|
+
* This is **required** for all `layer.type` options _except_ for `custom` and `background`.
|
|
10028
10357
|
* @param {string} [layer.sourceLayer] (optional) The name of the source layer within the specified `layer.source` to use for this style layer.
|
|
10029
10358
|
* This is only applicable for vector tile sources and is **required** when `layer.source` is of the type `vector`.
|
|
10030
10359
|
* @param {array} [layer.filter] (optional) An expression specifying conditions on source features.
|
|
@@ -10115,7 +10444,9 @@ export declare class Map extends Camera {
|
|
|
10115
10444
|
* @see [Add a vector tile source](https://maplibre.org/maplibre-gl-js-docs/example/vector-source/)
|
|
10116
10445
|
* @see [Add a WMS source](https://maplibre.org/maplibre-gl-js-docs/example/wms/)
|
|
10117
10446
|
*/
|
|
10118
|
-
addLayer(layer: LayerSpecification
|
|
10447
|
+
addLayer(layer: (LayerSpecification & {
|
|
10448
|
+
source?: string | SourceSpecification;
|
|
10449
|
+
}) | CustomLayerInterface, beforeId?: string): this;
|
|
10119
10450
|
/**
|
|
10120
10451
|
* Moves a layer to a different z-position.
|
|
10121
10452
|
*
|
|
@@ -10421,11 +10752,13 @@ export declare class Map extends Camera {
|
|
|
10421
10752
|
getCanvas(): HTMLCanvasElement;
|
|
10422
10753
|
_containerDimensions(): number[];
|
|
10423
10754
|
_setupContainer(): void;
|
|
10755
|
+
_setupCooperativeGestures(): void;
|
|
10424
10756
|
_resizeCanvas(width: number, height: number, pixelRatio: number): void;
|
|
10425
10757
|
_setupPainter(): void;
|
|
10426
10758
|
_contextLost(event: any): void;
|
|
10427
10759
|
_contextRestored(event: any): void;
|
|
10428
10760
|
_onMapScroll(event: any): boolean;
|
|
10761
|
+
_onCooperativeGesture(event: any, metaPress: any, touches: any): boolean;
|
|
10429
10762
|
/**
|
|
10430
10763
|
* Returns a Boolean indicating whether the map is fully loaded.
|
|
10431
10764
|
*
|
|
@@ -11384,45 +11717,10 @@ declare const exported: {
|
|
|
11384
11717
|
*/
|
|
11385
11718
|
removeProtocol(customProtocol: string): void;
|
|
11386
11719
|
};
|
|
11387
|
-
|
|
11388
|
-
|
|
11389
|
-
|
|
11390
|
-
|
|
11391
|
-
* @param {Object} [options]
|
|
11392
|
-
* @param {boolean} [options.failIfMajorPerformanceCaveat=false] If `true`,
|
|
11393
|
-
* the function will return `false` if the performance of MapLibre GL JS would
|
|
11394
|
-
* be dramatically worse than expected (e.g. a software WebGL renderer would be used).
|
|
11395
|
-
* @return {boolean}
|
|
11396
|
-
* @example
|
|
11397
|
-
* // Show an alert if the browser does not support MapLibre GL
|
|
11398
|
-
* if (!maplibregl.supported()) {
|
|
11399
|
-
* alert('Your browser does not support MapLibre GL');
|
|
11400
|
-
* }
|
|
11401
|
-
* @see [Check for browser support](https://maplibre.org/maplibre-gl-js-docs/example/check-for-support/)
|
|
11402
|
-
*/
|
|
11403
|
-
/**
|
|
11404
|
-
* Sets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text).
|
|
11405
|
-
* Necessary for supporting the Arabic and Hebrew languages, which are written right-to-left.
|
|
11406
|
-
*
|
|
11407
|
-
* @function setRTLTextPlugin
|
|
11408
|
-
* @param {string} pluginURL URL pointing to the Mapbox RTL text plugin source.
|
|
11409
|
-
* @param {Function} callback Called with an error argument if there is an error.
|
|
11410
|
-
* @param {boolean} lazy If set to `true`, mapboxgl will defer loading the plugin until rtl text is encountered,
|
|
11411
|
-
* rtl text will then be rendered only after the plugin finishes loading.
|
|
11412
|
-
* @example
|
|
11413
|
-
* maplibregl.setRTLTextPlugin('https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.0/mapbox-gl-rtl-text.js');
|
|
11414
|
-
* @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js-docs/example/mapbox-gl-rtl-text/)
|
|
11415
|
-
*/
|
|
11416
|
-
/**
|
|
11417
|
-
* Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.
|
|
11418
|
-
* The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.
|
|
11419
|
-
* If the status is `loaded` and the plugin is requested again, an error will be thrown.
|
|
11420
|
-
*
|
|
11421
|
-
* @function getRTLTextPluginStatus
|
|
11422
|
-
* @example
|
|
11423
|
-
* const pluginStatus = maplibregl.getRTLTextPluginStatus();
|
|
11424
|
-
*/
|
|
11425
|
-
export default exported;
|
|
11720
|
+
|
|
11721
|
+
export {
|
|
11722
|
+
exported as default,
|
|
11723
|
+
};
|
|
11426
11724
|
|
|
11427
11725
|
export as namespace maplibregl;
|
|
11428
11726
|
|