maplibre-gl 2.0.5 → 2.1.3
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/build/{banner.js → banner.ts} +1 -1
- package/build/generate-query-test-fixtures.ts +123 -0
- package/build/generate-shaders.ts +35 -0
- package/build/generate-struct-arrays.ts +7 -7
- package/build/generate-style-code.ts +8 -8
- package/build/generate-style-spec.ts +5 -4
- package/build/generate-typings.ts +16 -0
- package/build/readme.md +8 -18
- package/build/release-notes.js +9 -13
- package/build/{rollup_plugin_minify_style_spec.js → rollup_plugin_minify_style_spec.ts} +4 -3
- package/build/{rollup_plugins.js → rollup_plugins.ts} +12 -26
- package/dist/maplibre-gl-dev.js +54885 -0
- package/dist/maplibre-gl.css +1 -1
- package/dist/maplibre-gl.d.ts +1574 -1022
- package/dist/maplibre-gl.js +3 -3
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +94 -131
- package/src/css/maplibre-gl.css +49 -49
- package/src/data/{array_types.ts → array_types.g.ts} +0 -0
- package/src/data/bucket/circle_bucket.ts +1 -1
- package/src/data/bucket/fill_bucket.test.ts +1 -1
- package/src/data/bucket/fill_bucket.ts +4 -4
- package/src/data/bucket/fill_extrusion_bucket.ts +1 -1
- package/src/data/bucket/line_bucket.test.ts +1 -1
- package/src/data/bucket/line_bucket.ts +6 -6
- package/src/data/bucket/symbol_bucket.test.ts +16 -16
- package/src/data/bucket/symbol_bucket.ts +56 -56
- package/src/data/bucket.ts +43 -43
- package/src/data/dem_data.ts +12 -12
- package/src/data/evaluation_feature.ts +10 -10
- package/src/data/feature_index.ts +37 -37
- package/src/data/feature_position_map.ts +5 -5
- package/src/data/index_array_type.ts +1 -1
- package/src/data/load_geometry.test.ts +1 -1
- package/src/data/program_configuration.ts +47 -47
- package/src/data/segment.ts +14 -14
- package/src/geo/edge_insets.ts +2 -2
- package/src/geo/lng_lat.ts +4 -4
- package/src/geo/lng_lat_bounds.ts +35 -35
- package/src/geo/mercator_coordinate.ts +5 -5
- package/src/geo/transform.test.ts +1 -1
- package/src/geo/transform.ts +14 -14
- package/src/gl/context.ts +3 -3
- package/src/gl/types.ts +19 -19
- package/src/gl/value.ts +6 -6
- package/src/gl/vertex_buffer.test.ts +1 -1
- package/src/index.ts +24 -9
- package/src/render/draw_circle.ts +8 -8
- package/src/render/draw_collision_debug.ts +5 -5
- package/src/render/draw_debug.ts +1 -1
- package/src/render/draw_line.ts +4 -4
- package/src/render/draw_symbol.ts +21 -21
- package/src/render/glyph_atlas.ts +12 -12
- package/src/render/glyph_manager.test.ts +10 -21
- package/src/render/glyph_manager.ts +34 -33
- package/src/render/image_manager.ts +4 -4
- package/src/render/painter.ts +16 -14
- package/src/render/program/background_program.ts +29 -29
- package/src/render/program/circle_program.ts +11 -11
- package/src/render/program/clipping_mask_program.ts +1 -1
- package/src/render/program/collision_program.ts +9 -9
- package/src/render/program/debug_program.ts +4 -4
- package/src/render/program/fill_extrusion_program.ts +31 -31
- package/src/render/program/fill_program.ts +29 -29
- package/src/render/program/heatmap_program.ts +12 -12
- package/src/render/program/hillshade_program.ts +12 -12
- package/src/render/program/line_program.ts +41 -41
- package/src/render/program/pattern.ts +28 -28
- package/src/render/program/raster_program.ts +21 -21
- package/src/render/program/symbol_program.ts +97 -97
- package/src/render/program.ts +25 -25
- package/src/render/texture.ts +9 -9
- package/src/render/uniform_binding.ts +1 -1
- package/src/render/vertex_array_object.ts +13 -13
- package/src/shaders/_prelude.fragment.glsl.g.ts +2 -0
- package/src/shaders/_prelude.vertex.glsl.g.ts +2 -0
- package/src/shaders/background.fragment.glsl.g.ts +2 -0
- package/src/shaders/background.vertex.glsl.g.ts +2 -0
- package/src/shaders/background_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/background_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/circle.fragment.glsl.g.ts +2 -0
- package/src/shaders/circle.vertex.glsl.g.ts +2 -0
- package/src/shaders/clipping_mask.fragment.glsl.g.ts +2 -0
- package/src/shaders/clipping_mask.vertex.glsl.g.ts +2 -0
- package/src/shaders/collision_box.fragment.glsl.g.ts +2 -0
- package/src/shaders/collision_box.vertex.glsl.g.ts +2 -0
- package/src/shaders/collision_circle.fragment.glsl.g.ts +2 -0
- package/src/shaders/collision_circle.vertex.glsl.g.ts +2 -0
- package/src/shaders/debug.fragment.glsl.g.ts +2 -0
- package/src/shaders/debug.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_extrusion_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_outline.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_outline.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_outline_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_outline_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/fill_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/fill_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/heatmap.fragment.glsl.g.ts +2 -0
- package/src/shaders/heatmap.vertex.glsl.g.ts +2 -0
- package/src/shaders/heatmap_texture.fragment.glsl.g.ts +2 -0
- package/src/shaders/heatmap_texture.vertex.glsl.g.ts +2 -0
- package/src/shaders/hillshade.fragment.glsl.g.ts +2 -0
- package/src/shaders/hillshade.vertex.glsl.g.ts +2 -0
- package/src/shaders/hillshade_prepare.fragment.glsl.g.ts +2 -0
- package/src/shaders/hillshade_prepare.vertex.glsl.g.ts +2 -0
- package/src/shaders/line.fragment.glsl.g.ts +2 -0
- package/src/shaders/line.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_gradient.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_gradient.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_pattern.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_pattern.vertex.glsl.g.ts +2 -0
- package/src/shaders/line_sdf.fragment.glsl.g.ts +2 -0
- package/src/shaders/line_sdf.vertex.glsl.g.ts +2 -0
- package/src/shaders/raster.fragment.glsl.g.ts +2 -0
- package/src/shaders/raster.vertex.glsl.g.ts +2 -0
- package/src/shaders/shaders.ts +52 -55
- package/src/shaders/symbol_icon.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_icon.vertex.glsl.g.ts +2 -0
- package/src/shaders/symbol_sdf.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_sdf.vertex.glsl.g.ts +2 -0
- package/src/shaders/symbol_text_and_icon.fragment.glsl.g.ts +2 -0
- package/src/shaders/symbol_text_and_icon.vertex.glsl.g.ts +2 -0
- package/src/source/canvas_source.test.ts +11 -12
- package/src/source/canvas_source.ts +4 -4
- package/src/source/geojson_source.test.ts +2 -1
- package/src/source/geojson_source.ts +1 -1
- package/src/source/geojson_worker_source.ts +23 -23
- package/src/source/geojson_wrapper.ts +8 -8
- package/src/source/image_source.test.ts +2 -2
- package/src/source/image_source.ts +6 -6
- package/src/source/pixels_to_tile_units.ts +6 -6
- package/src/source/query_features.ts +20 -20
- package/src/source/raster_dem_tile_source.test.ts +4 -3
- package/src/source/raster_dem_tile_source.ts +1 -1
- package/src/source/raster_tile_source.test.ts +4 -3
- package/src/source/raster_tile_source.ts +1 -1
- package/src/source/rtl_text_plugin.ts +10 -10
- package/src/source/source.ts +29 -29
- package/src/source/source_cache.test.ts +33 -1
- package/src/source/source_cache.ts +7 -5
- package/src/source/source_state.ts +1 -1
- package/src/source/tile.test.ts +3 -3
- package/src/source/tile.ts +15 -15
- package/src/source/tile_cache.test.ts +6 -4
- package/src/source/tile_cache.ts +6 -6
- package/src/source/tile_id.test.ts +10 -13
- package/src/source/tile_id.ts +2 -2
- package/src/source/vector_tile_source.test.ts +17 -5
- package/src/source/vector_tile_source.ts +4 -5
- package/src/source/vector_tile_worker_source.test.ts +4 -4
- package/src/source/vector_tile_worker_source.ts +5 -5
- package/src/source/worker.test.ts +1 -1
- package/src/source/worker.ts +22 -22
- package/src/source/worker_source.ts +56 -56
- package/src/source/worker_tile.ts +4 -4
- package/src/style/evaluation_parameters.ts +3 -3
- package/src/style/format_section_override.test.ts +1 -1
- package/src/style/light.ts +10 -10
- package/src/style/load_glyph_range.test.ts +3 -5
- package/src/style/load_glyph_range.ts +6 -6
- package/src/style/load_sprite.ts +5 -4
- package/src/style/pauseable_placement.ts +1 -1
- package/src/style/properties.ts +70 -70
- package/src/style/query_utils.ts +7 -7
- package/src/style/style.test.ts +26 -15
- package/src/style/style.ts +30 -30
- package/src/style/style_glyph.ts +8 -8
- package/src/style/style_image.ts +58 -58
- package/src/style/style_layer/background_style_layer.ts +2 -2
- package/src/style/style_layer/{background_style_layer_properties.ts → background_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/circle_style_layer.ts +10 -10
- package/src/style/style_layer/{circle_style_layer_properties.ts → circle_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/custom_style_layer.ts +19 -19
- package/src/style/style_layer/fill_extrusion_style_layer.ts +11 -11
- package/src/style/style_layer/{fill_extrusion_style_layer_properties.ts → fill_extrusion_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/fill_style_layer.ts +9 -9
- package/src/style/style_layer/{fill_style_layer_properties.ts → fill_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/heatmap_style_layer.ts +2 -2
- package/src/style/style_layer/{heatmap_style_layer_properties.ts → heatmap_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/hillshade_style_layer.ts +2 -2
- package/src/style/style_layer/{hillshade_style_layer_properties.ts → hillshade_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/line_style_layer.ts +9 -9
- package/src/style/style_layer/{line_style_layer_properties.ts → line_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/raster_style_layer.ts +2 -2
- package/src/style/style_layer/{raster_style_layer_properties.ts → raster_style_layer_properties.g.ts} +0 -0
- package/src/style/style_layer/symbol_style_layer.ts +26 -7
- package/src/style/style_layer/{symbol_style_layer_properties.ts → symbol_style_layer_properties.g.ts} +6 -0
- package/src/style/style_layer.ts +10 -10
- package/src/style/style_layer_index.ts +3 -3
- package/src/style/validate_style.ts +15 -15
- package/src/style-spec/CHANGELOG.md +6 -0
- package/src/style-spec/error/validation_error.ts +1 -1
- package/src/style-spec/expression/compound_expression.ts +3 -3
- package/src/style-spec/expression/definitions/format.ts +11 -11
- package/src/style-spec/expression/definitions/interpolate.ts +5 -5
- package/src/style-spec/expression/definitions/match.ts +2 -2
- package/src/style-spec/expression/definitions/number_format.ts +11 -11
- package/src/style-spec/expression/expression.ts +8 -8
- package/src/style-spec/expression/index.ts +97 -97
- package/src/style-spec/expression/parsing_context.ts +11 -11
- package/src/style-spec/expression/types/collator.ts +9 -9
- package/src/style-spec/expression/types/resolved_image.ts +2 -2
- package/src/style-spec/expression/types.ts +14 -14
- package/src/style-spec/expression/values.ts +1 -1
- package/src/style-spec/feature_filter/index.ts +66 -66
- package/src/style-spec/function/convert.ts +3 -3
- package/src/style-spec/package.json +1 -1
- package/src/style-spec/reference/v8.json +68 -2
- package/src/style-spec/style-spec.ts +44 -44
- package/src/style-spec/types.ts +2 -0
- package/src/style-spec/util/color_spaces.ts +8 -8
- package/src/style-spec/util/result.ts +4 -4
- package/src/style-spec/validate/validate_filter.ts +58 -58
- package/src/style-spec/validate/validate_source.ts +63 -63
- package/src/style-spec/visit.ts +11 -11
- package/src/symbol/collision_feature.test.ts +1 -1
- package/src/symbol/collision_feature.ts +10 -10
- package/src/symbol/collision_index.ts +43 -43
- package/src/symbol/cross_tile_symbol_index.ts +17 -17
- package/src/symbol/get_anchors.ts +16 -16
- package/src/symbol/grid_index.test.ts +42 -19
- package/src/symbol/grid_index.ts +69 -40
- package/src/symbol/placement.ts +124 -95
- package/src/symbol/projection.ts +30 -30
- package/src/symbol/quads.ts +30 -30
- package/src/symbol/shaping.ts +160 -160
- package/src/symbol/symbol_layout.ts +119 -119
- package/src/symbol/symbol_size.ts +29 -29
- package/src/symbol/symbol_style_layer.test.ts +49 -2
- package/src/types/cancelable.ts +1 -1
- package/src/types/tilejson.ts +13 -13
- package/src/ui/anchor.ts +1 -1
- package/src/ui/camera.test.ts +9 -9
- package/src/ui/camera.ts +18 -18
- package/src/ui/control/attribution_control.test.ts +51 -16
- package/src/ui/control/attribution_control.ts +35 -16
- package/src/ui/control/control.ts +40 -40
- package/src/ui/control/fullscreen_control.ts +1 -1
- package/src/ui/control/geolocate_control.test.ts +1 -1
- package/src/ui/control/geolocate_control.ts +102 -102
- package/src/ui/control/logo_control.test.ts +5 -4
- package/src/ui/control/navigation_control.ts +3 -3
- package/src/ui/control/scale_control.test.ts +2 -2
- package/src/ui/control/scale_control.ts +5 -5
- package/src/ui/events.ts +289 -200
- package/src/ui/handler/box_zoom.test.ts +1 -1
- package/src/ui/handler/box_zoom.ts +1 -1
- package/src/ui/handler/dblclick_zoom.test.ts +1 -1
- package/src/ui/handler/drag_pan.test.ts +1 -1
- package/src/ui/handler/drag_rotate.test.ts +1 -1
- package/src/ui/handler/keyboard.test.ts +1 -1
- package/src/ui/handler/keyboard.ts +51 -51
- package/src/ui/handler/map_event.test.ts +1 -1
- package/src/ui/handler/map_event.ts +1 -1
- package/src/ui/handler/mouse.ts +1 -1
- package/src/ui/handler/mouse_rotate.test.ts +1 -1
- package/src/ui/handler/scroll_zoom.test.ts +3 -2
- package/src/ui/handler/scroll_zoom.ts +9 -9
- package/src/ui/handler/shim/drag_pan.ts +4 -4
- package/src/ui/handler/shim/drag_rotate.ts +1 -1
- package/src/ui/handler/shim/touch_zoom_rotate.ts +1 -1
- package/src/ui/handler/tap_recognizer.ts +4 -4
- package/src/ui/handler/touch_pan.ts +2 -2
- package/src/ui/handler/touch_zoom_rotate.test.ts +1 -1
- package/src/ui/handler/touch_zoom_rotate.ts +1 -1
- package/src/ui/handler_inertia.ts +6 -6
- package/src/ui/handler_manager.ts +44 -44
- package/src/ui/map/isMoving.test.ts +1 -1
- package/src/ui/map/isRotating.test.ts +1 -1
- package/src/ui/map/isZooming.test.ts +1 -1
- package/src/ui/map.test.ts +87 -14
- package/src/ui/map.ts +136 -106
- package/src/ui/map_events.test.ts +1 -1
- package/src/ui/marker.test.ts +12 -12
- package/src/ui/marker.ts +37 -37
- package/src/ui/popup.test.ts +7 -7
- package/src/ui/popup.ts +9 -9
- package/src/util/actor.test.ts +41 -10
- package/src/util/actor.ts +8 -8
- package/src/util/ajax.test.ts +29 -21
- package/src/util/ajax.ts +51 -30
- package/src/util/browser.ts +1 -1
- package/src/util/classify_rings.test.ts +1 -1
- package/src/util/color_ramp.ts +5 -5
- package/src/util/config.ts +2 -2
- package/src/util/dispatcher.ts +1 -1
- package/src/util/dom.ts +2 -2
- package/src/util/evented.ts +1 -1
- package/src/util/find_pole_of_inaccessibility.ts +3 -3
- package/src/util/image.ts +5 -5
- package/src/util/performance.ts +7 -7
- package/src/util/request_manager.ts +4 -4
- package/src/util/resolve_tokens.ts +4 -4
- package/src/util/struct_array.test.ts +1 -1
- package/src/util/struct_array.ts +15 -15
- package/src/util/task_queue.ts +3 -3
- package/src/util/tile_request_cache.ts +3 -3
- package/src/util/transferable_grid_index.ts +4 -4
- package/src/util/util.ts +8 -8
- package/src/util/web_worker.ts +4 -68
- package/src/util/web_worker_transfer.test.ts +3 -0
- package/src/util/web_worker_transfer.ts +21 -17
- package/src/util/worker_pool.ts +1 -1
- package/build/.eslintrc +0 -21
- package/build/glsl_to_js.js +0 -12
- package/build/post-ts-build.js +0 -43
- package/build/release-notes.md.ejs +0 -8
- package/build/test/build-tape.js +0 -17
- package/build/web_worker_replacement.js +0 -5
- package/dist/package.json +0 -1
- package/src/style-spec/validate_spec.test.ts +0 -29
- package/src/symbol/shaping.test.ts +0 -392
- package/src/types/glsl.d.ts +0 -4
package/src/ui/events.ts
CHANGED
|
@@ -15,40 +15,40 @@ export type MapLayerTouchEvent = MapTouchEvent & { features?: GeoJSON.Feature[]
|
|
|
15
15
|
export type MapSourceDataType = 'content' | 'metadata';
|
|
16
16
|
|
|
17
17
|
export type MapLayerEventType = {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
click: MapLayerMouseEvent;
|
|
19
|
+
dblclick: MapLayerMouseEvent;
|
|
20
|
+
mousedown: MapLayerMouseEvent;
|
|
21
|
+
mouseup: MapLayerMouseEvent;
|
|
22
|
+
mousemove: MapLayerMouseEvent;
|
|
23
|
+
mouseenter: MapLayerMouseEvent;
|
|
24
|
+
mouseleave: MapLayerMouseEvent;
|
|
25
|
+
mouseover: MapLayerMouseEvent;
|
|
26
|
+
mouseout: MapLayerMouseEvent;
|
|
27
|
+
contextmenu: MapLayerMouseEvent;
|
|
28
|
+
|
|
29
|
+
touchstart: MapLayerTouchEvent;
|
|
30
|
+
touchend: MapLayerTouchEvent;
|
|
31
|
+
touchcancel: MapLayerTouchEvent;
|
|
32
|
+
};
|
|
33
33
|
|
|
34
34
|
export interface MapLibreEvent<TOrig = undefined> {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
type: string;
|
|
36
|
+
target: Map;
|
|
37
|
+
originalEvent: TOrig;
|
|
38
|
+
}
|
|
39
39
|
|
|
40
40
|
export interface MapStyleDataEvent extends MapLibreEvent {
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
dataType: 'style';
|
|
42
|
+
}
|
|
43
43
|
|
|
44
44
|
export interface MapSourceDataEvent extends MapLibreEvent {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
45
|
+
dataType: 'source';
|
|
46
|
+
isSourceLoaded: boolean;
|
|
47
|
+
source: SourceSpecification;
|
|
48
|
+
sourceId: string;
|
|
49
|
+
sourceDataType: MapSourceDataType;
|
|
50
|
+
tile: any;
|
|
51
|
+
}
|
|
52
52
|
/**
|
|
53
53
|
* `MapMouseEvent` is the event type for mouse-related map events.
|
|
54
54
|
* @extends {Event}
|
|
@@ -272,9 +272,9 @@ export class MapWheelEvent extends Event {
|
|
|
272
272
|
* @property {Map} target The `Map` instance that triggerred the event
|
|
273
273
|
*/
|
|
274
274
|
export type MapLibreZoomEvent = {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
275
|
+
type: 'boxzoomstart' | 'boxzoomend' | 'boxzoomcancel';
|
|
276
|
+
target: Map;
|
|
277
|
+
originalEvent: MouseEvent;
|
|
278
278
|
};
|
|
279
279
|
|
|
280
280
|
/**
|
|
@@ -306,87 +306,90 @@ export type MapLibreZoomEvent = {
|
|
|
306
306
|
* });
|
|
307
307
|
*/
|
|
308
308
|
export type MapDataEvent = {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
309
|
+
type: string;
|
|
310
|
+
dataType: string;
|
|
311
|
+
sourceDataType: MapSourceDataType;
|
|
312
312
|
};
|
|
313
313
|
|
|
314
314
|
export type MapContextEvent = {
|
|
315
|
-
|
|
316
|
-
|
|
315
|
+
type: 'webglcontextlost' | 'webglcontextrestored';
|
|
316
|
+
originalEvent: WebGLContextEvent;
|
|
317
317
|
};
|
|
318
318
|
|
|
319
319
|
export interface MapStyleImageMissingEvent extends MapLibreEvent {
|
|
320
|
-
|
|
321
|
-
|
|
320
|
+
type: 'styleimagemissing';
|
|
321
|
+
id: string;
|
|
322
322
|
}
|
|
323
323
|
|
|
324
324
|
/**
|
|
325
|
-
* MapEventType - a mapping between the event name and the event value
|
|
326
|
-
*/
|
|
325
|
+
* MapEventType - a mapping between the event name and the event value
|
|
326
|
+
*/
|
|
327
327
|
export type MapEventType = {
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
328
|
+
error: ErrorEvent;
|
|
329
|
+
|
|
330
|
+
load: MapLibreEvent;
|
|
331
|
+
idle: MapLibreEvent;
|
|
332
|
+
remove: MapLibreEvent;
|
|
333
|
+
render: MapLibreEvent;
|
|
334
|
+
resize: MapLibreEvent;
|
|
335
|
+
|
|
336
|
+
webglcontextlost: MapContextEvent;
|
|
337
|
+
webglcontextrestored: MapContextEvent;
|
|
338
|
+
|
|
339
|
+
dataloading: MapDataEvent;
|
|
340
|
+
data: MapDataEvent;
|
|
341
|
+
tiledataloading: MapDataEvent;
|
|
342
|
+
sourcedataloading: MapSourceDataEvent;
|
|
343
|
+
styledataloading: MapStyleDataEvent;
|
|
344
|
+
sourcedata: MapSourceDataEvent;
|
|
345
|
+
styledata: MapStyleDataEvent;
|
|
346
|
+
styleimagemissing: MapStyleImageMissingEvent;
|
|
347
|
+
dataabort: MapDataEvent;
|
|
348
|
+
sourcedataabort: MapSourceDataEvent;
|
|
349
|
+
|
|
350
|
+
boxzoomcancel: MapLibreZoomEvent;
|
|
351
|
+
boxzoomstart: MapLibreZoomEvent;
|
|
352
|
+
boxzoomend: MapLibreZoomEvent;
|
|
353
|
+
|
|
354
|
+
touchcancel: MapTouchEvent;
|
|
355
|
+
touchmove: MapTouchEvent;
|
|
356
|
+
touchend: MapTouchEvent;
|
|
357
|
+
touchstart: MapTouchEvent;
|
|
358
|
+
|
|
359
|
+
click: MapMouseEvent;
|
|
360
|
+
contextmenu: MapMouseEvent;
|
|
361
|
+
dblclick: MapMouseEvent;
|
|
362
|
+
mousemove: MapMouseEvent;
|
|
363
|
+
mouseup: MapMouseEvent;
|
|
364
|
+
mousedown: MapMouseEvent;
|
|
365
|
+
mouseout: MapMouseEvent;
|
|
366
|
+
mouseover: MapMouseEvent;
|
|
367
|
+
|
|
368
|
+
movestart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
|
369
|
+
move: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
|
370
|
+
moveend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
|
371
|
+
|
|
372
|
+
zoomstart: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
|
373
|
+
zoom: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
|
374
|
+
zoomend: MapLibreEvent<MouseEvent | TouchEvent | WheelEvent | undefined>;
|
|
375
|
+
|
|
376
|
+
rotatestart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
377
|
+
rotate: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
378
|
+
rotateend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
379
|
+
|
|
380
|
+
dragstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
381
|
+
drag: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
382
|
+
dragend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
383
|
+
|
|
384
|
+
pitchstart: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
385
|
+
pitch: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
386
|
+
pitchend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
387
|
+
|
|
388
|
+
wheel: MapWheelEvent;
|
|
387
389
|
};
|
|
388
390
|
|
|
389
|
-
export type MapEvent =
|
|
391
|
+
export type MapEvent =
|
|
392
|
+
/**
|
|
390
393
|
* Fired when a pointing device (usually a mouse) is pressed within the map.
|
|
391
394
|
*
|
|
392
395
|
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
@@ -413,9 +416,9 @@ export type MapEvent = /**
|
|
|
413
416
|
* });
|
|
414
417
|
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
415
418
|
*/
|
|
416
|
-
'mousedown'
|
|
419
|
+
'mousedown'
|
|
417
420
|
|
|
418
|
-
/**
|
|
421
|
+
/**
|
|
419
422
|
* Fired when a pointing device (usually a mouse) is released within the map.
|
|
420
423
|
*
|
|
421
424
|
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
@@ -441,9 +444,10 @@ export type MapEvent = /**
|
|
|
441
444
|
* console.log('A mouseup event has occurred on a visible portion of the poi-label layer.');
|
|
442
445
|
* });
|
|
443
446
|
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
444
|
-
*/
|
|
447
|
+
*/
|
|
448
|
+
| 'mouseup'
|
|
445
449
|
|
|
446
|
-
/**
|
|
450
|
+
/**
|
|
447
451
|
* Fired when a pointing device (usually a mouse) is moved within the map.
|
|
448
452
|
* As you move the cursor across a web page containing a map,
|
|
449
453
|
* the event will fire each time it enters the map or any child elements.
|
|
@@ -473,9 +477,10 @@ export type MapEvent = /**
|
|
|
473
477
|
* @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
|
|
474
478
|
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
|
|
475
479
|
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
|
|
476
|
-
*/
|
|
480
|
+
*/
|
|
481
|
+
| 'mouseover'
|
|
477
482
|
|
|
478
|
-
/**
|
|
483
|
+
/**
|
|
479
484
|
* Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map.
|
|
480
485
|
* As you move the cursor across the map, the event will fire every time the cursor changes position within the map.
|
|
481
486
|
*
|
|
@@ -504,9 +509,10 @@ export type MapEvent = /**
|
|
|
504
509
|
* @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
|
|
505
510
|
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
|
|
506
511
|
* @see [Display a popup on over](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
|
|
507
|
-
*/
|
|
512
|
+
*/
|
|
513
|
+
| 'mousemove'
|
|
508
514
|
|
|
509
|
-
/**
|
|
515
|
+
/**
|
|
510
516
|
* Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.
|
|
511
517
|
*
|
|
512
518
|
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
@@ -533,9 +539,10 @@ export type MapEvent = /**
|
|
|
533
539
|
* });
|
|
534
540
|
* @see [Measure distances](https://maplibre.org/maplibre-gl-js-docs/example/measure/)
|
|
535
541
|
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
|
|
536
|
-
*/
|
|
542
|
+
*/
|
|
543
|
+
| 'click'
|
|
537
544
|
|
|
538
|
-
/**
|
|
545
|
+
/**
|
|
539
546
|
* Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on
|
|
540
547
|
* the map in rapid succession.
|
|
541
548
|
*
|
|
@@ -561,9 +568,10 @@ export type MapEvent = /**
|
|
|
561
568
|
* map.on('dblclick', 'poi-label', function(e) {
|
|
562
569
|
* console.log('A dblclick event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
|
|
563
570
|
* });
|
|
564
|
-
*/
|
|
571
|
+
*/
|
|
572
|
+
| 'dblclick'
|
|
565
573
|
|
|
566
|
-
/**
|
|
574
|
+
/**
|
|
567
575
|
* Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from
|
|
568
576
|
* outside that layer or outside the map canvas.
|
|
569
577
|
*
|
|
@@ -583,9 +591,10 @@ export type MapEvent = /**
|
|
|
583
591
|
* });
|
|
584
592
|
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
|
|
585
593
|
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
|
|
586
|
-
*/
|
|
594
|
+
*/
|
|
595
|
+
| 'mouseenter'
|
|
587
596
|
|
|
588
|
-
/**
|
|
597
|
+
/**
|
|
589
598
|
* Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves
|
|
590
599
|
* the map canvas.
|
|
591
600
|
*
|
|
@@ -607,9 +616,10 @@ export type MapEvent = /**
|
|
|
607
616
|
* });
|
|
608
617
|
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
|
|
609
618
|
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
|
|
610
|
-
*/
|
|
619
|
+
*/
|
|
620
|
+
| 'mouseleave'
|
|
611
621
|
|
|
612
|
-
/**
|
|
622
|
+
/**
|
|
613
623
|
* Fired when a point device (usually a mouse) leaves the map's canvas.
|
|
614
624
|
*
|
|
615
625
|
* @event mouseout
|
|
@@ -625,9 +635,10 @@ export type MapEvent = /**
|
|
|
625
635
|
* map.on('mouseout', function() {
|
|
626
636
|
* console.log('A mouseout event occurred.');
|
|
627
637
|
* });
|
|
628
|
-
*/
|
|
638
|
+
*/
|
|
639
|
+
| 'mouseout'
|
|
629
640
|
|
|
630
|
-
/**
|
|
641
|
+
/**
|
|
631
642
|
* Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.
|
|
632
643
|
*
|
|
633
644
|
* @event contextmenu
|
|
@@ -643,9 +654,10 @@ export type MapEvent = /**
|
|
|
643
654
|
* map.on('contextmenu', function() {
|
|
644
655
|
* console.log('A contextmenu event occurred.');
|
|
645
656
|
* });
|
|
646
|
-
*/
|
|
657
|
+
*/
|
|
658
|
+
| 'contextmenu'
|
|
647
659
|
|
|
648
|
-
/**
|
|
660
|
+
/**
|
|
649
661
|
* Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.
|
|
650
662
|
*
|
|
651
663
|
* @event wheel
|
|
@@ -660,9 +672,10 @@ export type MapEvent = /**
|
|
|
660
672
|
* map.on('wheel', function() {
|
|
661
673
|
* console.log('A wheel event occurred.');
|
|
662
674
|
* });
|
|
663
|
-
*/
|
|
675
|
+
*/
|
|
676
|
+
| 'wheel'
|
|
664
677
|
|
|
665
|
-
/**
|
|
678
|
+
/**
|
|
666
679
|
* Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.
|
|
667
680
|
*
|
|
668
681
|
* @event touchstart
|
|
@@ -677,9 +690,10 @@ export type MapEvent = /**
|
|
|
677
690
|
* console.log('A touchstart event occurred.');
|
|
678
691
|
* });
|
|
679
692
|
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
680
|
-
*/
|
|
693
|
+
*/
|
|
694
|
+
| 'touchstart'
|
|
681
695
|
|
|
682
|
-
/**
|
|
696
|
+
/**
|
|
683
697
|
* Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.
|
|
684
698
|
*
|
|
685
699
|
* @event touchend
|
|
@@ -695,9 +709,10 @@ export type MapEvent = /**
|
|
|
695
709
|
* console.log('A touchstart event occurred.');
|
|
696
710
|
* });
|
|
697
711
|
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
698
|
-
*/
|
|
712
|
+
*/
|
|
713
|
+
| 'touchend'
|
|
699
714
|
|
|
700
|
-
/**
|
|
715
|
+
/**
|
|
701
716
|
* Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.
|
|
702
717
|
*
|
|
703
718
|
* @event touchmove
|
|
@@ -713,9 +728,10 @@ export type MapEvent = /**
|
|
|
713
728
|
* console.log('A touchmove event occurred.');
|
|
714
729
|
* });
|
|
715
730
|
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
716
|
-
*/
|
|
731
|
+
*/
|
|
732
|
+
| 'touchmove'
|
|
717
733
|
|
|
718
|
-
/**
|
|
734
|
+
/**
|
|
719
735
|
* Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.
|
|
720
736
|
*
|
|
721
737
|
* @event touchcancel
|
|
@@ -730,9 +746,10 @@ export type MapEvent = /**
|
|
|
730
746
|
* map.on('touchcancel', function() {
|
|
731
747
|
* console.log('A touchcancel event occurred.');
|
|
732
748
|
* });
|
|
733
|
-
*/
|
|
749
|
+
*/
|
|
750
|
+
| 'touchcancel'
|
|
734
751
|
|
|
735
|
-
/**
|
|
752
|
+
/**
|
|
736
753
|
* Fired just before the map begins a transition from one
|
|
737
754
|
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
|
|
738
755
|
*
|
|
@@ -749,9 +766,10 @@ export type MapEvent = /**
|
|
|
749
766
|
* map.on('movestart', function() {
|
|
750
767
|
* console.log('A movestart` event occurred.');
|
|
751
768
|
* });
|
|
752
|
-
*/
|
|
769
|
+
*/
|
|
770
|
+
| 'movestart'
|
|
753
771
|
|
|
754
|
-
/**
|
|
772
|
+
/**
|
|
755
773
|
* Fired repeatedly during an animated transition from one view to
|
|
756
774
|
* another, as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
757
775
|
*
|
|
@@ -768,9 +786,10 @@ export type MapEvent = /**
|
|
|
768
786
|
* console.log('A move event occurred.');
|
|
769
787
|
* });
|
|
770
788
|
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
|
|
771
|
-
*/
|
|
789
|
+
*/
|
|
790
|
+
| 'move'
|
|
772
791
|
|
|
773
|
-
/**
|
|
792
|
+
/**
|
|
774
793
|
* Fired just after the map completes a transition from one
|
|
775
794
|
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
|
|
776
795
|
*
|
|
@@ -787,9 +806,10 @@ export type MapEvent = /**
|
|
|
787
806
|
* console.log('A moveend event occurred.');
|
|
788
807
|
* });
|
|
789
808
|
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
|
|
790
|
-
*/
|
|
809
|
+
*/
|
|
810
|
+
| 'moveend'
|
|
791
811
|
|
|
792
|
-
/**
|
|
812
|
+
/**
|
|
793
813
|
* Fired when a "drag to pan" interaction starts. See {@link DragPanHandler}.
|
|
794
814
|
*
|
|
795
815
|
* @event dragstart
|
|
@@ -804,9 +824,10 @@ export type MapEvent = /**
|
|
|
804
824
|
* map.on('dragstart', function() {
|
|
805
825
|
* console.log('A dragstart event occurred.');
|
|
806
826
|
* });
|
|
807
|
-
*/
|
|
827
|
+
*/
|
|
828
|
+
| 'dragstart'
|
|
808
829
|
|
|
809
|
-
/**
|
|
830
|
+
/**
|
|
810
831
|
* Fired repeatedly during a "drag to pan" interaction. See {@link DragPanHandler}.
|
|
811
832
|
*
|
|
812
833
|
* @event drag
|
|
@@ -821,9 +842,10 @@ export type MapEvent = /**
|
|
|
821
842
|
* map.on('drag', function() {
|
|
822
843
|
* console.log('A drag event occurred.');
|
|
823
844
|
* });
|
|
824
|
-
*/
|
|
845
|
+
*/
|
|
846
|
+
| 'drag'
|
|
825
847
|
|
|
826
|
-
/**
|
|
848
|
+
/**
|
|
827
849
|
* Fired when a "drag to pan" interaction ends. See {@link DragPanHandler}.
|
|
828
850
|
*
|
|
829
851
|
* @event dragend
|
|
@@ -839,9 +861,10 @@ export type MapEvent = /**
|
|
|
839
861
|
* console.log('A dragend event occurred.');
|
|
840
862
|
* });
|
|
841
863
|
* @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
|
|
842
|
-
*/
|
|
864
|
+
*/
|
|
865
|
+
| 'dragend'
|
|
843
866
|
|
|
844
|
-
/**
|
|
867
|
+
/**
|
|
845
868
|
* Fired just before the map begins a transition from one zoom level to another,
|
|
846
869
|
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
847
870
|
*
|
|
@@ -857,9 +880,10 @@ export type MapEvent = /**
|
|
|
857
880
|
* map.on('zoomstart', function() {
|
|
858
881
|
* console.log('A zoomstart event occurred.');
|
|
859
882
|
* });
|
|
860
|
-
*/
|
|
883
|
+
*/
|
|
884
|
+
| 'zoomstart'
|
|
861
885
|
|
|
862
|
-
/**
|
|
886
|
+
/**
|
|
863
887
|
* Fired repeatedly during an animated transition from one zoom level to another,
|
|
864
888
|
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
865
889
|
*
|
|
@@ -875,9 +899,10 @@ export type MapEvent = /**
|
|
|
875
899
|
* map.on('zoom', function() {
|
|
876
900
|
* console.log('A zoom event occurred.');
|
|
877
901
|
* });
|
|
878
|
-
*/
|
|
902
|
+
*/
|
|
903
|
+
| 'zoom'
|
|
879
904
|
|
|
880
|
-
/**
|
|
905
|
+
/**
|
|
881
906
|
* Fired just after the map completes a transition from one zoom level to another,
|
|
882
907
|
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
883
908
|
*
|
|
@@ -893,9 +918,10 @@ export type MapEvent = /**
|
|
|
893
918
|
* map.on('zoomend', function() {
|
|
894
919
|
* console.log('A zoomend event occurred.');
|
|
895
920
|
* });
|
|
896
|
-
*/
|
|
921
|
+
*/
|
|
922
|
+
| 'zoomend'
|
|
897
923
|
|
|
898
|
-
/**
|
|
924
|
+
/**
|
|
899
925
|
* Fired when a "drag to rotate" interaction starts. See {@link DragRotateHandler}.
|
|
900
926
|
*
|
|
901
927
|
* @event rotatestart
|
|
@@ -910,9 +936,10 @@ export type MapEvent = /**
|
|
|
910
936
|
* map.on('rotatestart', function() {
|
|
911
937
|
* console.log('A rotatestart event occurred.');
|
|
912
938
|
* });
|
|
913
|
-
*/
|
|
939
|
+
*/
|
|
940
|
+
| 'rotatestart'
|
|
914
941
|
|
|
915
|
-
/**
|
|
942
|
+
/**
|
|
916
943
|
* Fired repeatedly during a "drag to rotate" interaction. See {@link DragRotateHandler}.
|
|
917
944
|
*
|
|
918
945
|
* @event rotate
|
|
@@ -927,9 +954,10 @@ export type MapEvent = /**
|
|
|
927
954
|
* map.on('rotate', function() {
|
|
928
955
|
* console.log('A rotate event occurred.');
|
|
929
956
|
* });
|
|
930
|
-
*/
|
|
957
|
+
*/
|
|
958
|
+
| 'rotate'
|
|
931
959
|
|
|
932
|
-
/**
|
|
960
|
+
/**
|
|
933
961
|
* Fired when a "drag to rotate" interaction ends. See {@link DragRotateHandler}.
|
|
934
962
|
*
|
|
935
963
|
* @event rotateend
|
|
@@ -944,9 +972,10 @@ export type MapEvent = /**
|
|
|
944
972
|
* map.on('rotateend', function() {
|
|
945
973
|
* console.log('A rotateend event occurred.');
|
|
946
974
|
* });
|
|
947
|
-
*/
|
|
975
|
+
*/
|
|
976
|
+
| 'rotateend'
|
|
948
977
|
|
|
949
|
-
/**
|
|
978
|
+
/**
|
|
950
979
|
* Fired whenever the map's pitch (tilt) begins a change as
|
|
951
980
|
* the result of either user interaction or methods such as {@link Map#flyTo} .
|
|
952
981
|
*
|
|
@@ -962,9 +991,10 @@ export type MapEvent = /**
|
|
|
962
991
|
* map.on('pitchstart', function() {
|
|
963
992
|
* console.log('A pitchstart event occurred.');
|
|
964
993
|
* });
|
|
965
|
-
*/
|
|
994
|
+
*/
|
|
995
|
+
| 'pitchstart'
|
|
966
996
|
|
|
967
|
-
/**
|
|
997
|
+
/**
|
|
968
998
|
* Fired repeatedly during the map's pitch (tilt) animation between
|
|
969
999
|
* one state and another as the result of either user interaction
|
|
970
1000
|
* or methods such as {@link Map#flyTo}.
|
|
@@ -981,9 +1011,10 @@ export type MapEvent = /**
|
|
|
981
1011
|
* map.on('pitch', function() {
|
|
982
1012
|
* console.log('A pitch event occurred.');
|
|
983
1013
|
* });
|
|
984
|
-
*/
|
|
1014
|
+
*/
|
|
1015
|
+
| 'pitch'
|
|
985
1016
|
|
|
986
|
-
/**
|
|
1017
|
+
/**
|
|
987
1018
|
* Fired immediately after the map's pitch (tilt) finishes changing as
|
|
988
1019
|
* the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
989
1020
|
*
|
|
@@ -999,9 +1030,10 @@ export type MapEvent = /**
|
|
|
999
1030
|
* map.on('pitchend', function() {
|
|
1000
1031
|
* console.log('A pitchend event occurred.');
|
|
1001
1032
|
* });
|
|
1002
|
-
*/
|
|
1033
|
+
*/
|
|
1034
|
+
| 'pitchend'
|
|
1003
1035
|
|
|
1004
|
-
/**
|
|
1036
|
+
/**
|
|
1005
1037
|
* Fired when a "box zoom" interaction starts. See {@link BoxZoomHandler}.
|
|
1006
1038
|
*
|
|
1007
1039
|
* @event boxzoomstart
|
|
@@ -1016,9 +1048,10 @@ export type MapEvent = /**
|
|
|
1016
1048
|
* map.on('boxzoomstart', function() {
|
|
1017
1049
|
* console.log('A boxzoomstart event occurred.');
|
|
1018
1050
|
* });
|
|
1019
|
-
*/
|
|
1051
|
+
*/
|
|
1052
|
+
| 'boxzoomstart'
|
|
1020
1053
|
|
|
1021
|
-
/**
|
|
1054
|
+
/**
|
|
1022
1055
|
* Fired when a "box zoom" interaction ends. See {@link BoxZoomHandler}.
|
|
1023
1056
|
*
|
|
1024
1057
|
* @event boxzoomend
|
|
@@ -1034,9 +1067,10 @@ export type MapEvent = /**
|
|
|
1034
1067
|
* map.on('boxzoomend', function() {
|
|
1035
1068
|
* console.log('A boxzoomend event occurred.');
|
|
1036
1069
|
* });
|
|
1037
|
-
*/
|
|
1070
|
+
*/
|
|
1071
|
+
| 'boxzoomend'
|
|
1038
1072
|
|
|
1039
|
-
/**
|
|
1073
|
+
/**
|
|
1040
1074
|
* Fired when the user cancels a "box zoom" interaction, or when the bounding box does not meet the minimum size threshold.
|
|
1041
1075
|
* See {@link BoxZoomHandler}.
|
|
1042
1076
|
*
|
|
@@ -1052,9 +1086,10 @@ export type MapEvent = /**
|
|
|
1052
1086
|
* map.on('boxzoomcancel', function() {
|
|
1053
1087
|
* console.log('A boxzoomcancel event occurred.');
|
|
1054
1088
|
* });
|
|
1055
|
-
*/
|
|
1089
|
+
*/
|
|
1090
|
+
| 'boxzoomcancel'
|
|
1056
1091
|
|
|
1057
|
-
/**
|
|
1092
|
+
/**
|
|
1058
1093
|
* Fired immediately after the map has been resized.
|
|
1059
1094
|
*
|
|
1060
1095
|
* @event resize
|
|
@@ -1068,9 +1103,10 @@ export type MapEvent = /**
|
|
|
1068
1103
|
* map.on('resize', function() {
|
|
1069
1104
|
* console.log('A resize event occurred.');
|
|
1070
1105
|
* });
|
|
1071
|
-
*/
|
|
1106
|
+
*/
|
|
1107
|
+
| 'resize'
|
|
1072
1108
|
|
|
1073
|
-
/**
|
|
1109
|
+
/**
|
|
1074
1110
|
* Fired when the WebGL context is lost.
|
|
1075
1111
|
*
|
|
1076
1112
|
* @event webglcontextlost
|
|
@@ -1084,9 +1120,10 @@ export type MapEvent = /**
|
|
|
1084
1120
|
* map.on('webglcontextlost', function() {
|
|
1085
1121
|
* console.log('A webglcontextlost event occurred.');
|
|
1086
1122
|
* });
|
|
1087
|
-
*/
|
|
1123
|
+
*/
|
|
1124
|
+
| 'webglcontextlost'
|
|
1088
1125
|
|
|
1089
|
-
/**
|
|
1126
|
+
/**
|
|
1090
1127
|
* Fired when the WebGL context is restored.
|
|
1091
1128
|
*
|
|
1092
1129
|
* @event webglcontextrestored
|
|
@@ -1100,9 +1137,10 @@ export type MapEvent = /**
|
|
|
1100
1137
|
* map.on('webglcontextrestored', function() {
|
|
1101
1138
|
* console.log('A webglcontextrestored event occurred.');
|
|
1102
1139
|
* });
|
|
1103
|
-
*/
|
|
1140
|
+
*/
|
|
1141
|
+
| 'webglcontextrestored'
|
|
1104
1142
|
|
|
1105
|
-
/**
|
|
1143
|
+
/**
|
|
1106
1144
|
* Fired immediately after all necessary resources have been downloaded
|
|
1107
1145
|
* and the first visually complete rendering of the map has occurred.
|
|
1108
1146
|
*
|
|
@@ -1121,9 +1159,10 @@ export type MapEvent = /**
|
|
|
1121
1159
|
* @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js-docs/example/geojson-markers/)
|
|
1122
1160
|
* @see [Add live realtime data](https://maplibre.org/maplibre-gl-js-docs/example/live-geojson/)
|
|
1123
1161
|
* @see [Animate a point](https://maplibre.org/maplibre-gl-js-docs/example/animate-point-along-line/)
|
|
1124
|
-
*/
|
|
1162
|
+
*/
|
|
1163
|
+
| 'load'
|
|
1125
1164
|
|
|
1126
|
-
/**
|
|
1165
|
+
/**
|
|
1127
1166
|
* Fired whenever the map is drawn to the screen, as the result of
|
|
1128
1167
|
*
|
|
1129
1168
|
* - a change to the map's position, zoom, pitch, or bearing
|
|
@@ -1142,9 +1181,10 @@ export type MapEvent = /**
|
|
|
1142
1181
|
* map.on('render', function() {
|
|
1143
1182
|
* console.log('A render event occurred.');
|
|
1144
1183
|
* });
|
|
1145
|
-
*/
|
|
1184
|
+
*/
|
|
1185
|
+
| 'render'
|
|
1146
1186
|
|
|
1147
|
-
/**
|
|
1187
|
+
/**
|
|
1148
1188
|
* Fired after the last frame rendered before the map enters an
|
|
1149
1189
|
* "idle" state:
|
|
1150
1190
|
*
|
|
@@ -1163,9 +1203,10 @@ export type MapEvent = /**
|
|
|
1163
1203
|
* map.on('idle', function() {
|
|
1164
1204
|
* console.log('A idle event occurred.');
|
|
1165
1205
|
* });
|
|
1166
|
-
*/
|
|
1206
|
+
*/
|
|
1207
|
+
| 'idle'
|
|
1167
1208
|
|
|
1168
|
-
/**
|
|
1209
|
+
/**
|
|
1169
1210
|
* Fired immediately after the map has been removed with {@link Map.event:remove}.
|
|
1170
1211
|
*
|
|
1171
1212
|
* @event remove
|
|
@@ -1179,9 +1220,10 @@ export type MapEvent = /**
|
|
|
1179
1220
|
* map.on('remove', function() {
|
|
1180
1221
|
* console.log('A remove event occurred.');
|
|
1181
1222
|
* });
|
|
1182
|
-
*/
|
|
1223
|
+
*/
|
|
1224
|
+
| 'remove'
|
|
1183
1225
|
|
|
1184
|
-
/**
|
|
1226
|
+
/**
|
|
1185
1227
|
* Fired when an error occurs. This is GL JS's primary error reporting
|
|
1186
1228
|
* mechanism. We use an event instead of `throw` to better accommodate
|
|
1187
1229
|
* asyncronous operations. If no listeners are bound to the `error` event, the
|
|
@@ -1199,9 +1241,10 @@ export type MapEvent = /**
|
|
|
1199
1241
|
* map.on('error', function() {
|
|
1200
1242
|
* console.log('A error event occurred.');
|
|
1201
1243
|
* });
|
|
1202
|
-
*/
|
|
1244
|
+
*/
|
|
1245
|
+
| 'error'
|
|
1203
1246
|
|
|
1204
|
-
/**
|
|
1247
|
+
/**
|
|
1205
1248
|
* Fired when any map data loads or changes. See {@link MapDataEvent}
|
|
1206
1249
|
* for more information.
|
|
1207
1250
|
*
|
|
@@ -1218,9 +1261,10 @@ export type MapEvent = /**
|
|
|
1218
1261
|
* console.log('A data event occurred.');
|
|
1219
1262
|
* });
|
|
1220
1263
|
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
|
|
1221
|
-
*/
|
|
1264
|
+
*/
|
|
1265
|
+
| 'data'
|
|
1222
1266
|
|
|
1223
|
-
/**
|
|
1267
|
+
/**
|
|
1224
1268
|
* Fired when the map's style loads or changes. See
|
|
1225
1269
|
* {@link MapDataEvent} for more information.
|
|
1226
1270
|
*
|
|
@@ -1236,9 +1280,10 @@ export type MapEvent = /**
|
|
|
1236
1280
|
* map.on('styledata', function() {
|
|
1237
1281
|
* console.log('A styledata event occurred.');
|
|
1238
1282
|
* });
|
|
1239
|
-
*/
|
|
1283
|
+
*/
|
|
1284
|
+
| 'styledata'
|
|
1240
1285
|
|
|
1241
|
-
/**
|
|
1286
|
+
/**
|
|
1242
1287
|
* Fired when one of the map's sources loads or changes, including if a tile belonging
|
|
1243
1288
|
* to a source loads or changes. See {@link MapDataEvent} for more information.
|
|
1244
1289
|
*
|
|
@@ -1254,12 +1299,13 @@ export type MapEvent = /**
|
|
|
1254
1299
|
* map.on('sourcedata', function() {
|
|
1255
1300
|
* console.log('A sourcedata event occurred.');
|
|
1256
1301
|
* });
|
|
1257
|
-
*/
|
|
1302
|
+
*/
|
|
1303
|
+
| 'sourcedata'
|
|
1258
1304
|
|
|
1259
|
-
/**
|
|
1305
|
+
/**
|
|
1260
1306
|
* Fired when any map data (style, source, tile, etc) begins loading or
|
|
1261
|
-
* changing asyncronously. All `dataloading` events are followed by a `data
|
|
1262
|
-
* or `error` event. See {@link MapDataEvent} for more information.
|
|
1307
|
+
* changing asyncronously. All `dataloading` events are followed by a `data`,
|
|
1308
|
+
* `dataabort` or `error` event. See {@link MapDataEvent} for more information.
|
|
1263
1309
|
*
|
|
1264
1310
|
* @event dataloading
|
|
1265
1311
|
* @memberof Map
|
|
@@ -1274,9 +1320,10 @@ export type MapEvent = /**
|
|
|
1274
1320
|
* map.on('dataloading', function() {
|
|
1275
1321
|
* console.log('A dataloading event occurred.');
|
|
1276
1322
|
* });
|
|
1277
|
-
*/
|
|
1323
|
+
*/
|
|
1324
|
+
| 'dataloading'
|
|
1278
1325
|
|
|
1279
|
-
/**
|
|
1326
|
+
/**
|
|
1280
1327
|
* Fired when the map's style begins loading or changing asyncronously.
|
|
1281
1328
|
* All `styledataloading` events are followed by a `styledata`
|
|
1282
1329
|
* or `error` event. See {@link MapDataEvent} for more information.
|
|
@@ -1294,11 +1341,12 @@ export type MapEvent = /**
|
|
|
1294
1341
|
* map.on('styledataloading', function() {
|
|
1295
1342
|
* console.log('A styledataloading event occurred.');
|
|
1296
1343
|
* });
|
|
1297
|
-
*/
|
|
1344
|
+
*/
|
|
1345
|
+
| 'styledataloading'
|
|
1298
1346
|
|
|
1299
|
-
/**
|
|
1347
|
+
/**
|
|
1300
1348
|
* Fired when one of the map's sources begins loading or changing asyncronously.
|
|
1301
|
-
* All `sourcedataloading` events are followed by a `sourcedata` or `error` event.
|
|
1349
|
+
* All `sourcedataloading` events are followed by a `sourcedata`, `sourcedataabort` or `error` event.
|
|
1302
1350
|
* See {@link MapDataEvent} for more information.
|
|
1303
1351
|
*
|
|
1304
1352
|
* @event sourcedataloading
|
|
@@ -1314,9 +1362,10 @@ export type MapEvent = /**
|
|
|
1314
1362
|
* map.on('sourcedataloading', function() {
|
|
1315
1363
|
* console.log('A sourcedataloading event occurred.');
|
|
1316
1364
|
* });
|
|
1317
|
-
*/
|
|
1365
|
+
*/
|
|
1366
|
+
| 'sourcedataloading'
|
|
1318
1367
|
|
|
1319
|
-
/**
|
|
1368
|
+
/**
|
|
1320
1369
|
* Fired when an icon or pattern needed by the style is missing. The missing image can
|
|
1321
1370
|
* be added with {@link Map#addImage} within this event listener callback to prevent the image from
|
|
1322
1371
|
* being skipped. This event can be used to dynamically generate icons and patterns.
|
|
@@ -1334,11 +1383,51 @@ export type MapEvent = /**
|
|
|
1334
1383
|
* console.log('A styleimagemissing event occurred.');
|
|
1335
1384
|
* });
|
|
1336
1385
|
* @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-missing-generated/)
|
|
1337
|
-
*/
|
|
1386
|
+
*/
|
|
1387
|
+
| 'styleimagemissing'
|
|
1338
1388
|
|
|
1339
|
-
/**
|
|
1389
|
+
/**
|
|
1340
1390
|
* @event style.load
|
|
1341
1391
|
* @memberof Map
|
|
1342
1392
|
* @instance
|
|
1343
1393
|
* @private
|
|
1344
|
-
*/
|
|
1394
|
+
*/
|
|
1395
|
+
| 'style.load'
|
|
1396
|
+
|
|
1397
|
+
/**
|
|
1398
|
+
* Fired when a request for one of the map's sources' tiles is aborted.
|
|
1399
|
+
* See {@link MapDataEvent} for more information.
|
|
1400
|
+
*
|
|
1401
|
+
* @event dataabort
|
|
1402
|
+
* @memberof Map
|
|
1403
|
+
* @instance
|
|
1404
|
+
* @property {MapDataEvent} data
|
|
1405
|
+
* @example
|
|
1406
|
+
* // Initialize the map
|
|
1407
|
+
* var map = new maplibregl.Map({ // map options });
|
|
1408
|
+
* // Set an event listener that fires
|
|
1409
|
+
* // when a request for one of the map's sources' tiles is aborted.
|
|
1410
|
+
* map.on('dataabort', function() {
|
|
1411
|
+
* console.log('A dataabort event occurred.');
|
|
1412
|
+
* });
|
|
1413
|
+
*/
|
|
1414
|
+
| 'dataabort'
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Fired when a request for one of the map's sources' tiles is aborted.
|
|
1418
|
+
* See {@link MapDataEvent} for more information.
|
|
1419
|
+
*
|
|
1420
|
+
* @event sourcedataabort
|
|
1421
|
+
* @memberof Map
|
|
1422
|
+
* @instance
|
|
1423
|
+
* @property {MapDataEvent} data
|
|
1424
|
+
* @example
|
|
1425
|
+
* // Initialize the map
|
|
1426
|
+
* var map = new maplibregl.Map({ // map options });
|
|
1427
|
+
* // Set an event listener that fires
|
|
1428
|
+
* // when a request for one of the map's sources' tiles is aborted.
|
|
1429
|
+
* map.on('sourcedataabort', function() {
|
|
1430
|
+
* console.log('A sourcedataabort event occurred.');
|
|
1431
|
+
* });
|
|
1432
|
+
*/
|
|
1433
|
+
| 'sourcedataabort';
|