maplibre-gl 2.1.1 → 2.1.2
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} +11 -26
- package/dist/maplibre-gl-dev.js +522 -226
- package/dist/maplibre-gl.css +1 -1
- package/dist/maplibre-gl.d.ts +1536 -1010
- package/dist/maplibre-gl.js +3 -3
- package/dist/maplibre-gl.js.map +1 -1
- package/package.json +40 -61
- 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 +53 -53
- 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 +46 -46
- 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_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 +33 -32
- package/src/render/image_manager.ts +4 -4
- package/src/render/painter.ts +11 -11
- package/src/render/program/background_program.ts +29 -29
- package/src/render/program/circle_program.ts +10 -10
- 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 +38 -38
- package/src/render/program/pattern.ts +28 -28
- package/src/render/program/raster_program.ts +21 -21
- package/src/render/program/symbol_program.ts +96 -96
- 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_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 +2 -2
- package/src/source/raster_tile_source.test.ts +2 -2
- package/src/source/rtl_text_plugin.ts +10 -10
- package/src/source/source.ts +29 -29
- package/src/source/source_cache.test.ts +32 -0
- 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.ts +6 -6
- package/src/source/tile_id.test.ts +0 -1
- package/src/source/vector_tile_source.test.ts +3 -3
- package/src/source/vector_tile_source.ts +1 -1
- 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 -3
- package/src/style/load_glyph_range.ts +6 -6
- package/src/style/load_sprite.ts +4 -4
- package/src/style/pauseable_placement.ts +1 -1
- package/src/style/properties.ts +69 -69
- package/src/style/query_utils.ts +7 -7
- package/src/style/style.test.ts +2 -2
- package/src/style/style.ts +29 -29
- 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 +17 -17
- package/src/style/style_layer/fill_extrusion_style_layer.ts +10 -10
- 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 +7 -7
- package/src/style/style_layer/{symbol_style_layer_properties.ts → symbol_style_layer_properties.g.ts} +0 -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/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/style-spec.ts +44 -44
- 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 +26 -26
- package/src/symbol/cross_tile_symbol_index.ts +17 -17
- package/src/symbol/get_anchors.ts +16 -16
- package/src/symbol/grid_index.ts +7 -7
- package/src/symbol/placement.ts +72 -72
- 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 +1 -1
- 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 +5 -5
- 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 +4 -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 +1 -1
- 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 +10 -4
- package/src/ui/map.ts +106 -101
- 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/dist/maplibre-gl.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated by dts-bundle-generator v6.
|
|
1
|
+
// Generated by dts-bundle-generator v6.5.0
|
|
2
2
|
|
|
3
3
|
import Point from '@mapbox/point-geometry';
|
|
4
4
|
import TinySDF from '@mapbox/tiny-sdf';
|
|
@@ -53,6 +53,25 @@ export declare type RequestParameters = {
|
|
|
53
53
|
collectResourceTiming?: boolean;
|
|
54
54
|
};
|
|
55
55
|
export declare type ResponseCallback<T> = (error?: Error | null, data?: T | null, cacheControl?: string | null, expires?: string | null) => void;
|
|
56
|
+
export declare class AJAXError extends Error {
|
|
57
|
+
/**
|
|
58
|
+
* The response's HTTP status code.
|
|
59
|
+
*/
|
|
60
|
+
status: number;
|
|
61
|
+
/**
|
|
62
|
+
* The response's HTTP status text.
|
|
63
|
+
*/
|
|
64
|
+
statusText: string;
|
|
65
|
+
/**
|
|
66
|
+
* The request's URL.
|
|
67
|
+
*/
|
|
68
|
+
url: string;
|
|
69
|
+
/**
|
|
70
|
+
* The response's body.
|
|
71
|
+
*/
|
|
72
|
+
body: Blob;
|
|
73
|
+
constructor(status: number, statusText: string, url: string, body: Blob);
|
|
74
|
+
}
|
|
56
75
|
export declare type ResourceTypeEnum = keyof IResourceType;
|
|
57
76
|
export declare type RequestTransformFunction = (url: string, resourceType?: ResourceTypeEnum) => RequestParameters;
|
|
58
77
|
export declare class RequestManager {
|
|
@@ -826,45 +845,45 @@ export declare class LngLatBounds {
|
|
|
826
845
|
*/
|
|
827
846
|
getSouthWest(): LngLat;
|
|
828
847
|
/**
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
848
|
+
* Returns the northeast corner of the bounding box.
|
|
849
|
+
*
|
|
850
|
+
* @returns {LngLat} The northeast corner of the bounding box.
|
|
832
851
|
*/
|
|
833
852
|
getNorthEast(): LngLat;
|
|
834
853
|
/**
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
854
|
+
* Returns the northwest corner of the bounding box.
|
|
855
|
+
*
|
|
856
|
+
* @returns {LngLat} The northwest corner of the bounding box.
|
|
838
857
|
*/
|
|
839
858
|
getNorthWest(): LngLat;
|
|
840
859
|
/**
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
860
|
+
* Returns the southeast corner of the bounding box.
|
|
861
|
+
*
|
|
862
|
+
* @returns {LngLat} The southeast corner of the bounding box.
|
|
844
863
|
*/
|
|
845
864
|
getSouthEast(): LngLat;
|
|
846
865
|
/**
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
866
|
+
* Returns the west edge of the bounding box.
|
|
867
|
+
*
|
|
868
|
+
* @returns {number} The west edge of the bounding box.
|
|
850
869
|
*/
|
|
851
870
|
getWest(): number;
|
|
852
871
|
/**
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
872
|
+
* Returns the south edge of the bounding box.
|
|
873
|
+
*
|
|
874
|
+
* @returns {number} The south edge of the bounding box.
|
|
856
875
|
*/
|
|
857
876
|
getSouth(): number;
|
|
858
877
|
/**
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
878
|
+
* Returns the east edge of the bounding box.
|
|
879
|
+
*
|
|
880
|
+
* @returns {number} The east edge of the bounding box.
|
|
862
881
|
*/
|
|
863
882
|
getEast(): number;
|
|
864
883
|
/**
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
884
|
+
* Returns the north edge of the bounding box.
|
|
885
|
+
*
|
|
886
|
+
* @returns {number} The north edge of the bounding box.
|
|
868
887
|
*/
|
|
869
888
|
getNorth(): number;
|
|
870
889
|
/**
|
|
@@ -894,20 +913,20 @@ export declare class LngLatBounds {
|
|
|
894
913
|
*/
|
|
895
914
|
isEmpty(): boolean;
|
|
896
915
|
/**
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
916
|
+
* Check if the point is within the bounding box.
|
|
917
|
+
*
|
|
918
|
+
* @param {LngLatLike} lnglat geographic point to check against.
|
|
919
|
+
* @returns {boolean} True if the point is within the bounding box.
|
|
920
|
+
* @example
|
|
921
|
+
* var llb = new maplibregl.LngLatBounds(
|
|
922
|
+
* new maplibregl.LngLat(-73.9876, 40.7661),
|
|
923
|
+
* new maplibregl.LngLat(-73.9397, 40.8002)
|
|
924
|
+
* );
|
|
925
|
+
*
|
|
926
|
+
* var ll = new maplibregl.LngLat(-73.9567, 40.7789);
|
|
927
|
+
*
|
|
928
|
+
* console.log(llb.contains(ll)); // = true
|
|
929
|
+
*/
|
|
911
930
|
contains(lnglat: LngLatLike): boolean;
|
|
912
931
|
/**
|
|
913
932
|
* Converts an array to a `LngLatBounds` object.
|
|
@@ -1581,6 +1600,13 @@ export declare class StructArrayLayout2i4 extends StructArray {
|
|
|
1581
1600
|
emplaceBack(v0: number, v1: number): number;
|
|
1582
1601
|
emplace(i: number, v0: number, v1: number): number;
|
|
1583
1602
|
}
|
|
1603
|
+
export declare class StructArrayLayout4i8 extends StructArray {
|
|
1604
|
+
uint8: Uint8Array;
|
|
1605
|
+
int16: Int16Array;
|
|
1606
|
+
_refreshViews(): void;
|
|
1607
|
+
emplaceBack(v0: number, v1: number, v2: number, v3: number): number;
|
|
1608
|
+
emplace(i: number, v0: number, v1: number, v2: number, v3: number): number;
|
|
1609
|
+
}
|
|
1584
1610
|
export declare class StructArrayLayout2i4i12 extends StructArray {
|
|
1585
1611
|
uint8: Uint8Array;
|
|
1586
1612
|
int16: Int16Array;
|
|
@@ -1818,6 +1844,8 @@ export declare class FeatureIndexArray extends StructArrayLayout1ul2ui8 {
|
|
|
1818
1844
|
*/
|
|
1819
1845
|
get(index: number): FeatureIndexStruct;
|
|
1820
1846
|
}
|
|
1847
|
+
export declare class RasterBoundsArray extends StructArrayLayout4i8 {
|
|
1848
|
+
}
|
|
1821
1849
|
export declare class CircleLayoutArray extends StructArrayLayout2i4 {
|
|
1822
1850
|
}
|
|
1823
1851
|
export declare class FillLayoutArray extends StructArrayLayout2i4 {
|
|
@@ -2353,12 +2381,12 @@ export interface StyleImageInterface {
|
|
|
2353
2381
|
*/
|
|
2354
2382
|
width: number;
|
|
2355
2383
|
/**
|
|
2356
|
-
|
|
2357
|
-
|
|
2384
|
+
* @property {number} height
|
|
2385
|
+
*/
|
|
2358
2386
|
height: number;
|
|
2359
2387
|
/**
|
|
2360
2388
|
* @property {Uint8Array | Uint8ClampedArray} data
|
|
2361
|
-
|
|
2389
|
+
*/
|
|
2362
2390
|
data: Uint8Array | Uint8ClampedArray;
|
|
2363
2391
|
/**
|
|
2364
2392
|
* This method is called once before every frame where the icon will be used.
|
|
@@ -2685,8 +2713,8 @@ export declare class EdgeInsets {
|
|
|
2685
2713
|
*/
|
|
2686
2714
|
export declare type PaddingOptions = {
|
|
2687
2715
|
/**
|
|
2688
|
-
|
|
2689
|
-
|
|
2716
|
+
* @property {number} top Padding in pixels from the top of the map canvas.
|
|
2717
|
+
*/
|
|
2690
2718
|
top: number;
|
|
2691
2719
|
/**
|
|
2692
2720
|
* @property {number} bottom Padding in pixels from the bottom of the map canvas.
|
|
@@ -4211,12 +4239,12 @@ export interface Bucket {
|
|
|
4211
4239
|
upload(context: Context): void;
|
|
4212
4240
|
uploadPending(): boolean;
|
|
4213
4241
|
/**
|
|
4214
|
-
|
|
4215
|
-
|
|
4216
|
-
|
|
4217
|
-
|
|
4218
|
-
|
|
4219
|
-
|
|
4242
|
+
* Release the WebGL resources associated with the buffers. Note that because
|
|
4243
|
+
* buckets are shared between layers having the same layout properties, they
|
|
4244
|
+
* must be destroyed in groups (all buckets for a tile, or all symbol buckets).
|
|
4245
|
+
*
|
|
4246
|
+
* @private
|
|
4247
|
+
*/
|
|
4220
4248
|
destroy(): void;
|
|
4221
4249
|
}
|
|
4222
4250
|
export declare type CustomRenderMethod = (gl: WebGLRenderingContext, matrix: mat4) => void;
|
|
@@ -4358,16 +4386,16 @@ export interface CustomLayerInterface {
|
|
|
4358
4386
|
*/
|
|
4359
4387
|
onAdd(map: Map, gl: WebGLRenderingContext): void;
|
|
4360
4388
|
/**
|
|
4361
|
-
|
|
4362
|
-
|
|
4363
|
-
|
|
4364
|
-
|
|
4365
|
-
|
|
4366
|
-
|
|
4367
|
-
|
|
4368
|
-
|
|
4369
|
-
|
|
4370
|
-
|
|
4389
|
+
* Optional method called when the layer has been removed from the Map with {@link Map#removeLayer}. This
|
|
4390
|
+
* gives the layer a chance to clean up gl resources and event listeners.
|
|
4391
|
+
*
|
|
4392
|
+
* @function
|
|
4393
|
+
* @memberof CustomLayerInterface
|
|
4394
|
+
* @instance
|
|
4395
|
+
* @name onRemove
|
|
4396
|
+
* @param {Map} map The Map this custom layer was just added to.
|
|
4397
|
+
* @param {WebGLRenderingContext} gl The gl context for the map.
|
|
4398
|
+
*/
|
|
4371
4399
|
onRemove(map: Map, gl: WebGLRenderingContext): void;
|
|
4372
4400
|
}
|
|
4373
4401
|
declare abstract class StyleLayer extends Evented {
|
|
@@ -4528,19 +4556,6 @@ export declare class LineAtlas {
|
|
|
4528
4556
|
};
|
|
4529
4557
|
bind(context: Context): void;
|
|
4530
4558
|
}
|
|
4531
|
-
declare const status: {
|
|
4532
|
-
unavailable: string;
|
|
4533
|
-
deferred: string;
|
|
4534
|
-
loading: string;
|
|
4535
|
-
loaded: string;
|
|
4536
|
-
error: string;
|
|
4537
|
-
};
|
|
4538
|
-
export declare type PluginState = {
|
|
4539
|
-
pluginStatus: typeof status[keyof typeof status];
|
|
4540
|
-
pluginURL: string;
|
|
4541
|
-
};
|
|
4542
|
-
export declare type PluginStateSyncCallback = (state: PluginState) => void;
|
|
4543
|
-
declare const registerForPluginStateChange: (callback: PluginStateSyncCallback) => PluginStateSyncCallback;
|
|
4544
4559
|
export declare type MessageListener = (a: {
|
|
4545
4560
|
data: any;
|
|
4546
4561
|
target: any;
|
|
@@ -4584,6 +4599,112 @@ export declare class Dispatcher {
|
|
|
4584
4599
|
getActor(): Actor;
|
|
4585
4600
|
remove(): void;
|
|
4586
4601
|
}
|
|
4602
|
+
export declare class TileBounds {
|
|
4603
|
+
bounds: LngLatBounds;
|
|
4604
|
+
minzoom: number;
|
|
4605
|
+
maxzoom: number;
|
|
4606
|
+
constructor(bounds: [
|
|
4607
|
+
number,
|
|
4608
|
+
number,
|
|
4609
|
+
number,
|
|
4610
|
+
number
|
|
4611
|
+
], minzoom?: number | null, maxzoom?: number | null);
|
|
4612
|
+
validateBounds(bounds: [
|
|
4613
|
+
number,
|
|
4614
|
+
number,
|
|
4615
|
+
number,
|
|
4616
|
+
number
|
|
4617
|
+
]): LngLatBoundsLike;
|
|
4618
|
+
contains(tileID: CanonicalTileID): boolean;
|
|
4619
|
+
}
|
|
4620
|
+
export declare class VectorTileSource extends Evented implements Source {
|
|
4621
|
+
type: "vector";
|
|
4622
|
+
id: string;
|
|
4623
|
+
minzoom: number;
|
|
4624
|
+
maxzoom: number;
|
|
4625
|
+
url: string;
|
|
4626
|
+
scheme: string;
|
|
4627
|
+
tileSize: number;
|
|
4628
|
+
promoteId: PromoteIdSpecification;
|
|
4629
|
+
_options: VectorSourceSpecification;
|
|
4630
|
+
_collectResourceTiming: boolean;
|
|
4631
|
+
dispatcher: Dispatcher;
|
|
4632
|
+
map: Map;
|
|
4633
|
+
bounds: [
|
|
4634
|
+
number,
|
|
4635
|
+
number,
|
|
4636
|
+
number,
|
|
4637
|
+
number
|
|
4638
|
+
];
|
|
4639
|
+
tiles: Array<string>;
|
|
4640
|
+
tileBounds: TileBounds;
|
|
4641
|
+
reparseOverscaled: boolean;
|
|
4642
|
+
isTileClipped: boolean;
|
|
4643
|
+
_tileJSONRequest: Cancelable;
|
|
4644
|
+
_loaded: boolean;
|
|
4645
|
+
constructor(id: string, options: VectorSourceSpecification & {
|
|
4646
|
+
collectResourceTiming: boolean;
|
|
4647
|
+
}, dispatcher: Dispatcher, eventedParent: Evented);
|
|
4648
|
+
load(): void;
|
|
4649
|
+
loaded(): boolean;
|
|
4650
|
+
hasTile(tileID: OverscaledTileID): boolean;
|
|
4651
|
+
onAdd(map: Map): void;
|
|
4652
|
+
setSourceProperty(callback: Function): void;
|
|
4653
|
+
/**
|
|
4654
|
+
* Sets the source `tiles` property and re-renders the map.
|
|
4655
|
+
*
|
|
4656
|
+
* @param {string[]} tiles An array of one or more tile source URLs, as in the TileJSON spec.
|
|
4657
|
+
* @returns {VectorTileSource} this
|
|
4658
|
+
*/
|
|
4659
|
+
setTiles(tiles: Array<string>): this;
|
|
4660
|
+
/**
|
|
4661
|
+
* Sets the source `url` property and re-renders the map.
|
|
4662
|
+
*
|
|
4663
|
+
* @param {string} url A URL to a TileJSON resource. Supported protocols are `http:` and `https:`.
|
|
4664
|
+
* @returns {VectorTileSource} this
|
|
4665
|
+
*/
|
|
4666
|
+
setUrl(url: string): this;
|
|
4667
|
+
onRemove(): void;
|
|
4668
|
+
serialize(): any;
|
|
4669
|
+
loadTile(tile: Tile, callback: Callback<void>): void;
|
|
4670
|
+
abortTile(tile: Tile): void;
|
|
4671
|
+
unloadTile(tile: Tile): void;
|
|
4672
|
+
hasTransition(): boolean;
|
|
4673
|
+
}
|
|
4674
|
+
export declare class RasterTileSource extends Evented implements Source {
|
|
4675
|
+
type: "raster" | "raster-dem";
|
|
4676
|
+
id: string;
|
|
4677
|
+
minzoom: number;
|
|
4678
|
+
maxzoom: number;
|
|
4679
|
+
url: string;
|
|
4680
|
+
scheme: string;
|
|
4681
|
+
tileSize: number;
|
|
4682
|
+
bounds: [
|
|
4683
|
+
number,
|
|
4684
|
+
number,
|
|
4685
|
+
number,
|
|
4686
|
+
number
|
|
4687
|
+
];
|
|
4688
|
+
tileBounds: TileBounds;
|
|
4689
|
+
roundZoom: boolean;
|
|
4690
|
+
dispatcher: Dispatcher;
|
|
4691
|
+
map: Map;
|
|
4692
|
+
tiles: Array<string>;
|
|
4693
|
+
_loaded: boolean;
|
|
4694
|
+
_options: RasterSourceSpecification | RasterDEMSourceSpecification;
|
|
4695
|
+
_tileJSONRequest: Cancelable;
|
|
4696
|
+
constructor(id: string, options: RasterSourceSpecification | RasterDEMSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
|
|
4697
|
+
load(): void;
|
|
4698
|
+
loaded(): boolean;
|
|
4699
|
+
onAdd(map: Map): void;
|
|
4700
|
+
onRemove(): void;
|
|
4701
|
+
serialize(): any;
|
|
4702
|
+
hasTile(tileID: OverscaledTileID): boolean;
|
|
4703
|
+
loadTile(tile: Tile, callback: Callback<void>): void;
|
|
4704
|
+
abortTile(tile: Tile, callback: Callback<void>): void;
|
|
4705
|
+
unloadTile(tile: Tile, callback: Callback<void>): void;
|
|
4706
|
+
hasTransition(): boolean;
|
|
4707
|
+
}
|
|
4587
4708
|
export declare type MapLayerMouseEvent = MapMouseEvent & {
|
|
4588
4709
|
features?: GeoJSON.Feature[];
|
|
4589
4710
|
};
|
|
@@ -4813,8 +4934,8 @@ export interface MapStyleImageMissingEvent extends MapLibreEvent {
|
|
|
4813
4934
|
id: string;
|
|
4814
4935
|
}
|
|
4815
4936
|
/**
|
|
4816
|
-
* MapEventType - a mapping between the event name and the event value
|
|
4817
|
-
*/
|
|
4937
|
+
* MapEventType - a mapping between the event name and the event value
|
|
4938
|
+
*/
|
|
4818
4939
|
export declare type MapEventType = {
|
|
4819
4940
|
error: ErrorEvent;
|
|
4820
4941
|
load: MapLibreEvent;
|
|
@@ -4832,6 +4953,8 @@ export declare type MapEventType = {
|
|
|
4832
4953
|
sourcedata: MapSourceDataEvent;
|
|
4833
4954
|
styledata: MapStyleDataEvent;
|
|
4834
4955
|
styleimagemissing: MapStyleImageMissingEvent;
|
|
4956
|
+
dataabort: MapDataEvent;
|
|
4957
|
+
sourcedataabort: MapSourceDataEvent;
|
|
4835
4958
|
boxzoomcancel: MapLibreZoomEvent;
|
|
4836
4959
|
boxzoomstart: MapLibreZoomEvent;
|
|
4837
4960
|
boxzoomend: MapLibreZoomEvent;
|
|
@@ -4864,913 +4987,1225 @@ export declare type MapEventType = {
|
|
|
4864
4987
|
pitchend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
|
|
4865
4988
|
wheel: MapWheelEvent;
|
|
4866
4989
|
};
|
|
4867
|
-
export declare type MapEvent =
|
|
4868
|
-
* Fired when a pointing device (usually a mouse) is pressed within the map.
|
|
4869
|
-
*
|
|
4870
|
-
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
4871
|
-
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
|
|
4872
|
-
* the cursor is pressed while inside a visible portion of the specifed layer.
|
|
4873
|
-
*
|
|
4874
|
-
* @event mousedown
|
|
4875
|
-
* @memberof Map
|
|
4876
|
-
* @instance
|
|
4877
|
-
* @property {MapMouseEvent} data
|
|
4878
|
-
* @example
|
|
4879
|
-
* // Initialize the map
|
|
4880
|
-
* var map = new maplibregl.Map({ // map options });
|
|
4881
|
-
* // Set an event listener
|
|
4882
|
-
* map.on('mousedown', function() {
|
|
4883
|
-
* console.log('A mousedown event has occurred.');
|
|
4884
|
-
* });
|
|
4885
|
-
* @example
|
|
4886
|
-
* // Initialize the map
|
|
4887
|
-
* var map = new maplibregl.Map({ // map options });
|
|
4888
|
-
* // Set an event listener for a specific layer
|
|
4889
|
-
* map.on('mousedown', 'poi-label', function() {
|
|
4890
|
-
* console.log('A mousedown event has occurred on a visible portion of the poi-label layer.');
|
|
4891
|
-
* });
|
|
4892
|
-
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
4893
|
-
*/ "mousedown"
|
|
4990
|
+
export declare type MapEvent =
|
|
4894
4991
|
/**
|
|
4895
|
-
|
|
4896
|
-
|
|
4897
|
-
|
|
4898
|
-
|
|
4899
|
-
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4913
|
-
|
|
4914
|
-
|
|
4915
|
-
|
|
4916
|
-
|
|
4917
|
-
|
|
4918
|
-
|
|
4919
|
-
|
|
4920
|
-
|
|
4992
|
+
* Fired when a pointing device (usually a mouse) is pressed within the map.
|
|
4993
|
+
*
|
|
4994
|
+
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
4995
|
+
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
|
|
4996
|
+
* the cursor is pressed while inside a visible portion of the specifed layer.
|
|
4997
|
+
*
|
|
4998
|
+
* @event mousedown
|
|
4999
|
+
* @memberof Map
|
|
5000
|
+
* @instance
|
|
5001
|
+
* @property {MapMouseEvent} data
|
|
5002
|
+
* @example
|
|
5003
|
+
* // Initialize the map
|
|
5004
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5005
|
+
* // Set an event listener
|
|
5006
|
+
* map.on('mousedown', function() {
|
|
5007
|
+
* console.log('A mousedown event has occurred.');
|
|
5008
|
+
* });
|
|
5009
|
+
* @example
|
|
5010
|
+
* // Initialize the map
|
|
5011
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5012
|
+
* // Set an event listener for a specific layer
|
|
5013
|
+
* map.on('mousedown', 'poi-label', function() {
|
|
5014
|
+
* console.log('A mousedown event has occurred on a visible portion of the poi-label layer.');
|
|
5015
|
+
* });
|
|
5016
|
+
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
5017
|
+
*/
|
|
5018
|
+
"mousedown"
|
|
4921
5019
|
/**
|
|
4922
|
-
|
|
4923
|
-
|
|
4924
|
-
|
|
4925
|
-
|
|
4926
|
-
|
|
4927
|
-
|
|
4928
|
-
|
|
4929
|
-
|
|
4930
|
-
|
|
4931
|
-
|
|
4932
|
-
|
|
4933
|
-
|
|
4934
|
-
|
|
4935
|
-
|
|
4936
|
-
|
|
4937
|
-
|
|
4938
|
-
|
|
4939
|
-
|
|
4940
|
-
|
|
4941
|
-
|
|
4942
|
-
|
|
4943
|
-
|
|
4944
|
-
|
|
4945
|
-
|
|
4946
|
-
|
|
4947
|
-
|
|
4948
|
-
|
|
4949
|
-
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
|
|
4950
|
-
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
|
|
4951
|
-
*/ | "mouseover"
|
|
5020
|
+
* Fired when a pointing device (usually a mouse) is released within the map.
|
|
5021
|
+
*
|
|
5022
|
+
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
5023
|
+
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
|
|
5024
|
+
* the cursor is released while inside a visible portion of the specifed layer.
|
|
5025
|
+
*
|
|
5026
|
+
* @event mouseup
|
|
5027
|
+
* @memberof Map
|
|
5028
|
+
* @instance
|
|
5029
|
+
* @property {MapMouseEvent} data
|
|
5030
|
+
* @example
|
|
5031
|
+
* // Initialize the map
|
|
5032
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5033
|
+
* // Set an event listener
|
|
5034
|
+
* map.on('mouseup', function() {
|
|
5035
|
+
* console.log('A mouseup event has occurred.');
|
|
5036
|
+
* });
|
|
5037
|
+
* @example
|
|
5038
|
+
* // Initialize the map
|
|
5039
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5040
|
+
* // Set an event listener for a specific layer
|
|
5041
|
+
* map.on('mouseup', 'poi-label', function() {
|
|
5042
|
+
* console.log('A mouseup event has occurred on a visible portion of the poi-label layer.');
|
|
5043
|
+
* });
|
|
5044
|
+
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
5045
|
+
*/
|
|
5046
|
+
| "mouseup"
|
|
4952
5047
|
/**
|
|
4953
|
-
|
|
4954
|
-
|
|
4955
|
-
|
|
4956
|
-
|
|
4957
|
-
|
|
4958
|
-
|
|
4959
|
-
|
|
4960
|
-
|
|
4961
|
-
|
|
4962
|
-
|
|
4963
|
-
|
|
4964
|
-
|
|
4965
|
-
|
|
4966
|
-
|
|
4967
|
-
|
|
4968
|
-
|
|
4969
|
-
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
|
|
4973
|
-
|
|
4974
|
-
|
|
4975
|
-
|
|
4976
|
-
|
|
4977
|
-
|
|
4978
|
-
|
|
4979
|
-
|
|
4980
|
-
|
|
4981
|
-
|
|
5048
|
+
* Fired when a pointing device (usually a mouse) is moved within the map.
|
|
5049
|
+
* As you move the cursor across a web page containing a map,
|
|
5050
|
+
* the event will fire each time it enters the map or any child elements.
|
|
5051
|
+
*
|
|
5052
|
+
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
5053
|
+
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
|
|
5054
|
+
* the cursor is moved inside a visible portion of the specifed layer.
|
|
5055
|
+
*
|
|
5056
|
+
* @event mouseover
|
|
5057
|
+
* @memberof Map
|
|
5058
|
+
* @instance
|
|
5059
|
+
* @property {MapMouseEvent} data
|
|
5060
|
+
* @example
|
|
5061
|
+
* // Initialize the map
|
|
5062
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5063
|
+
* // Set an event listener
|
|
5064
|
+
* map.on('mouseover', function() {
|
|
5065
|
+
* console.log('A mouseover event has occurred.');
|
|
5066
|
+
* });
|
|
5067
|
+
* @example
|
|
5068
|
+
* // Initialize the map
|
|
5069
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5070
|
+
* // Set an event listener for a specific layer
|
|
5071
|
+
* map.on('mouseover', 'poi-label', function() {
|
|
5072
|
+
* console.log('A mouseover event has occurred on a visible portion of the poi-label layer.');
|
|
5073
|
+
* });
|
|
5074
|
+
* @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
|
|
5075
|
+
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
|
|
5076
|
+
* @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
|
|
5077
|
+
*/
|
|
5078
|
+
| "mouseover"
|
|
4982
5079
|
/**
|
|
4983
|
-
|
|
4984
|
-
|
|
4985
|
-
|
|
4986
|
-
|
|
4987
|
-
|
|
4988
|
-
|
|
4989
|
-
|
|
4990
|
-
|
|
4991
|
-
|
|
4992
|
-
|
|
4993
|
-
|
|
4994
|
-
|
|
4995
|
-
|
|
4996
|
-
|
|
4997
|
-
|
|
4998
|
-
|
|
4999
|
-
|
|
5000
|
-
|
|
5001
|
-
|
|
5002
|
-
|
|
5003
|
-
|
|
5004
|
-
|
|
5005
|
-
|
|
5006
|
-
|
|
5007
|
-
|
|
5008
|
-
|
|
5009
|
-
|
|
5080
|
+
* Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map.
|
|
5081
|
+
* As you move the cursor across the map, the event will fire every time the cursor changes position within the map.
|
|
5082
|
+
*
|
|
5083
|
+
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
5084
|
+
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
|
|
5085
|
+
* the cursor is inside a visible portion of the specified layer.
|
|
5086
|
+
*
|
|
5087
|
+
* @event mousemove
|
|
5088
|
+
* @memberof Map
|
|
5089
|
+
* @instance
|
|
5090
|
+
* @property {MapMouseEvent} data
|
|
5091
|
+
* @example
|
|
5092
|
+
* // Initialize the map
|
|
5093
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5094
|
+
* // Set an event listener
|
|
5095
|
+
* map.on('mousemove', function() {
|
|
5096
|
+
* console.log('A mousemove event has occurred.');
|
|
5097
|
+
* });
|
|
5098
|
+
* @example
|
|
5099
|
+
* // Initialize the map
|
|
5100
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5101
|
+
* // Set an event listener for a specific layer
|
|
5102
|
+
* map.on('mousemove', 'poi-label', function() {
|
|
5103
|
+
* console.log('A mousemove event has occurred on a visible portion of the poi-label layer.');
|
|
5104
|
+
* });
|
|
5105
|
+
* @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
|
|
5106
|
+
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
|
|
5107
|
+
* @see [Display a popup on over](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
|
|
5108
|
+
*/
|
|
5109
|
+
| "mousemove"
|
|
5010
5110
|
/**
|
|
5011
|
-
|
|
5012
|
-
|
|
5013
|
-
|
|
5014
|
-
|
|
5015
|
-
|
|
5016
|
-
|
|
5017
|
-
|
|
5018
|
-
|
|
5019
|
-
|
|
5020
|
-
|
|
5021
|
-
|
|
5022
|
-
|
|
5023
|
-
|
|
5024
|
-
|
|
5025
|
-
|
|
5026
|
-
|
|
5027
|
-
|
|
5028
|
-
|
|
5029
|
-
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
|
|
5033
|
-
|
|
5034
|
-
|
|
5035
|
-
|
|
5036
|
-
|
|
5111
|
+
* Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.
|
|
5112
|
+
*
|
|
5113
|
+
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
5114
|
+
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
|
|
5115
|
+
* point that is pressed and released contains a visible portion of the specifed layer.
|
|
5116
|
+
*
|
|
5117
|
+
* @event click
|
|
5118
|
+
* @memberof Map
|
|
5119
|
+
* @instance
|
|
5120
|
+
* @property {MapMouseEvent} data
|
|
5121
|
+
* @example
|
|
5122
|
+
* // Initialize the map
|
|
5123
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5124
|
+
* // Set an event listener
|
|
5125
|
+
* map.on('click', function(e) {
|
|
5126
|
+
* console.log('A click event has occurred at ' + e.lngLat);
|
|
5127
|
+
* });
|
|
5128
|
+
* @example
|
|
5129
|
+
* // Initialize the map
|
|
5130
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5131
|
+
* // Set an event listener for a specific layer
|
|
5132
|
+
* map.on('click', 'poi-label', function(e) {
|
|
5133
|
+
* console.log('A click event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
|
|
5134
|
+
* });
|
|
5135
|
+
* @see [Measure distances](https://maplibre.org/maplibre-gl-js-docs/example/measure/)
|
|
5136
|
+
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
|
|
5137
|
+
*/
|
|
5138
|
+
| "click"
|
|
5037
5139
|
/**
|
|
5038
|
-
|
|
5039
|
-
|
|
5040
|
-
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5044
|
-
|
|
5045
|
-
|
|
5046
|
-
|
|
5047
|
-
|
|
5048
|
-
|
|
5049
|
-
|
|
5050
|
-
|
|
5051
|
-
|
|
5052
|
-
|
|
5053
|
-
|
|
5054
|
-
|
|
5055
|
-
|
|
5056
|
-
|
|
5057
|
-
|
|
5140
|
+
* Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on
|
|
5141
|
+
* the map in rapid succession.
|
|
5142
|
+
*
|
|
5143
|
+
* **Note:** This event is compatible with the optional `layerId` parameter.
|
|
5144
|
+
* If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only
|
|
5145
|
+
* when the point that is clicked twice contains a visible portion of the specifed layer.
|
|
5146
|
+
*
|
|
5147
|
+
* @event dblclick
|
|
5148
|
+
* @memberof Map
|
|
5149
|
+
* @instance
|
|
5150
|
+
* @property {MapMouseEvent} data
|
|
5151
|
+
* @example
|
|
5152
|
+
* // Initialize the map
|
|
5153
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5154
|
+
* // Set an event listener
|
|
5155
|
+
* map.on('dblclick', function(e) {
|
|
5156
|
+
* console.log('A dblclick event has occurred at ' + e.lngLat);
|
|
5157
|
+
* });
|
|
5158
|
+
* @example
|
|
5159
|
+
* // Initialize the map
|
|
5160
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5161
|
+
* // Set an event listener for a specific layer
|
|
5162
|
+
* map.on('dblclick', 'poi-label', function(e) {
|
|
5163
|
+
* console.log('A dblclick event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
|
|
5164
|
+
* });
|
|
5165
|
+
*/
|
|
5166
|
+
| "dblclick"
|
|
5058
5167
|
/**
|
|
5059
|
-
|
|
5060
|
-
|
|
5061
|
-
|
|
5062
|
-
|
|
5063
|
-
|
|
5064
|
-
|
|
5065
|
-
|
|
5066
|
-
|
|
5067
|
-
|
|
5068
|
-
|
|
5069
|
-
|
|
5070
|
-
|
|
5071
|
-
|
|
5072
|
-
|
|
5073
|
-
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
|
|
5077
|
-
|
|
5078
|
-
|
|
5079
|
-
|
|
5080
|
-
*/ | "mouseleave"
|
|
5168
|
+
* Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from
|
|
5169
|
+
* outside that layer or outside the map canvas.
|
|
5170
|
+
*
|
|
5171
|
+
* **Important:** This event can only be listened for when {@link Map#on} includes three arguments,
|
|
5172
|
+
* where the second argument specifies the desired layer.
|
|
5173
|
+
*
|
|
5174
|
+
* @event mouseenter
|
|
5175
|
+
* @memberof Map
|
|
5176
|
+
* @instance
|
|
5177
|
+
* @property {MapMouseEvent} data
|
|
5178
|
+
* @example
|
|
5179
|
+
* // Initialize the map
|
|
5180
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5181
|
+
* // Set an event listener
|
|
5182
|
+
* map.on('mouseenter', 'water', function() {
|
|
5183
|
+
* console.log('A mouseenter event occurred on a visible portion of the water layer.');
|
|
5184
|
+
* });
|
|
5185
|
+
* @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
|
|
5186
|
+
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
|
|
5187
|
+
*/
|
|
5188
|
+
| "mouseenter"
|
|
5081
5189
|
/**
|
|
5082
|
-
|
|
5083
|
-
|
|
5084
|
-
|
|
5085
|
-
|
|
5086
|
-
|
|
5087
|
-
|
|
5088
|
-
|
|
5089
|
-
|
|
5090
|
-
|
|
5091
|
-
|
|
5092
|
-
|
|
5093
|
-
|
|
5094
|
-
|
|
5095
|
-
|
|
5096
|
-
|
|
5097
|
-
|
|
5190
|
+
* Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves
|
|
5191
|
+
* the map canvas.
|
|
5192
|
+
*
|
|
5193
|
+
* **Important:** This event can only be listened for when {@link Map#on} includes three arguements,
|
|
5194
|
+
* where the second argument specifies the desired layer.
|
|
5195
|
+
*
|
|
5196
|
+
* @event mouseleave
|
|
5197
|
+
* @memberof Map
|
|
5198
|
+
* @instance
|
|
5199
|
+
* @property {MapMouseEvent} data
|
|
5200
|
+
* @example
|
|
5201
|
+
* // Initialize the map
|
|
5202
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5203
|
+
* // Set an event listener that fires
|
|
5204
|
+
* // when the pointing device leaves
|
|
5205
|
+
* // a visible portion of the specified layer.
|
|
5206
|
+
* map.on('mouseleave', 'water', function() {
|
|
5207
|
+
* console.log('A mouseleave event occurred.');
|
|
5208
|
+
* });
|
|
5209
|
+
* @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
|
|
5210
|
+
* @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
|
|
5211
|
+
*/
|
|
5212
|
+
| "mouseleave"
|
|
5098
5213
|
/**
|
|
5099
|
-
|
|
5100
|
-
|
|
5101
|
-
|
|
5102
|
-
|
|
5103
|
-
|
|
5104
|
-
|
|
5105
|
-
|
|
5106
|
-
|
|
5107
|
-
|
|
5108
|
-
|
|
5109
|
-
|
|
5110
|
-
|
|
5111
|
-
|
|
5112
|
-
|
|
5113
|
-
|
|
5114
|
-
|
|
5214
|
+
* Fired when a point device (usually a mouse) leaves the map's canvas.
|
|
5215
|
+
*
|
|
5216
|
+
* @event mouseout
|
|
5217
|
+
* @memberof Map
|
|
5218
|
+
* @instance
|
|
5219
|
+
* @property {MapMouseEvent} data
|
|
5220
|
+
* @example
|
|
5221
|
+
* // Initialize the map
|
|
5222
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5223
|
+
* // Set an event listener that fires
|
|
5224
|
+
* // when the pointing device leave's
|
|
5225
|
+
* // the map's canvas.
|
|
5226
|
+
* map.on('mouseout', function() {
|
|
5227
|
+
* console.log('A mouseout event occurred.');
|
|
5228
|
+
* });
|
|
5229
|
+
*/
|
|
5230
|
+
| "mouseout"
|
|
5115
5231
|
/**
|
|
5116
|
-
|
|
5117
|
-
|
|
5118
|
-
|
|
5119
|
-
|
|
5120
|
-
|
|
5121
|
-
|
|
5122
|
-
|
|
5123
|
-
|
|
5124
|
-
|
|
5125
|
-
|
|
5126
|
-
|
|
5127
|
-
|
|
5128
|
-
|
|
5129
|
-
|
|
5130
|
-
|
|
5232
|
+
* Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.
|
|
5233
|
+
*
|
|
5234
|
+
* @event contextmenu
|
|
5235
|
+
* @memberof Map
|
|
5236
|
+
* @instance
|
|
5237
|
+
* @property {MapMouseEvent} data
|
|
5238
|
+
* @example
|
|
5239
|
+
* // Initialize the map
|
|
5240
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5241
|
+
* // Set an event listener that fires
|
|
5242
|
+
* // when the right mouse button is
|
|
5243
|
+
* // pressed within the map.
|
|
5244
|
+
* map.on('contextmenu', function() {
|
|
5245
|
+
* console.log('A contextmenu event occurred.');
|
|
5246
|
+
* });
|
|
5247
|
+
*/
|
|
5248
|
+
| "contextmenu"
|
|
5131
5249
|
/**
|
|
5132
|
-
|
|
5133
|
-
|
|
5134
|
-
|
|
5135
|
-
|
|
5136
|
-
|
|
5137
|
-
|
|
5138
|
-
|
|
5139
|
-
|
|
5140
|
-
|
|
5141
|
-
|
|
5142
|
-
|
|
5143
|
-
|
|
5144
|
-
|
|
5145
|
-
|
|
5146
|
-
|
|
5250
|
+
* Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.
|
|
5251
|
+
*
|
|
5252
|
+
* @event wheel
|
|
5253
|
+
* @memberof Map
|
|
5254
|
+
* @instance
|
|
5255
|
+
* @property {MapWheelEvent} data
|
|
5256
|
+
* @example
|
|
5257
|
+
* // Initialize the map
|
|
5258
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5259
|
+
* // Set an event listener that fires
|
|
5260
|
+
* // when a wheel event occurs within the map.
|
|
5261
|
+
* map.on('wheel', function() {
|
|
5262
|
+
* console.log('A wheel event occurred.');
|
|
5263
|
+
* });
|
|
5264
|
+
*/
|
|
5265
|
+
| "wheel"
|
|
5147
5266
|
/**
|
|
5148
|
-
|
|
5149
|
-
|
|
5150
|
-
|
|
5151
|
-
|
|
5152
|
-
|
|
5153
|
-
|
|
5154
|
-
|
|
5155
|
-
|
|
5156
|
-
|
|
5157
|
-
|
|
5158
|
-
|
|
5159
|
-
|
|
5160
|
-
|
|
5161
|
-
|
|
5162
|
-
|
|
5163
|
-
|
|
5267
|
+
* Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.
|
|
5268
|
+
*
|
|
5269
|
+
* @event touchstart
|
|
5270
|
+
* @memberof Map
|
|
5271
|
+
* @instance
|
|
5272
|
+
* @property {MapTouchEvent} data
|
|
5273
|
+
* // Initialize the map
|
|
5274
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5275
|
+
* // Set an event listener that fires
|
|
5276
|
+
* // when a touchstart event occurs within the map.
|
|
5277
|
+
* map.on('touchstart', function() {
|
|
5278
|
+
* console.log('A touchstart event occurred.');
|
|
5279
|
+
* });
|
|
5280
|
+
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
5281
|
+
*/
|
|
5282
|
+
| "touchstart"
|
|
5164
5283
|
/**
|
|
5165
|
-
|
|
5166
|
-
|
|
5167
|
-
|
|
5168
|
-
|
|
5169
|
-
|
|
5170
|
-
|
|
5171
|
-
|
|
5172
|
-
|
|
5173
|
-
|
|
5174
|
-
|
|
5175
|
-
|
|
5176
|
-
|
|
5177
|
-
|
|
5178
|
-
|
|
5179
|
-
|
|
5180
|
-
|
|
5284
|
+
* Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.
|
|
5285
|
+
*
|
|
5286
|
+
* @event touchend
|
|
5287
|
+
* @memberof Map
|
|
5288
|
+
* @instance
|
|
5289
|
+
* @property {MapTouchEvent} data
|
|
5290
|
+
* @example
|
|
5291
|
+
* // Initialize the map
|
|
5292
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5293
|
+
* // Set an event listener that fires
|
|
5294
|
+
* // when a touchstart event occurs within the map.
|
|
5295
|
+
* map.on('touchstart', function() {
|
|
5296
|
+
* console.log('A touchstart event occurred.');
|
|
5297
|
+
* });
|
|
5298
|
+
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
5299
|
+
*/
|
|
5300
|
+
| "touchend"
|
|
5181
5301
|
/**
|
|
5182
|
-
|
|
5183
|
-
|
|
5184
|
-
|
|
5185
|
-
|
|
5186
|
-
|
|
5187
|
-
|
|
5188
|
-
|
|
5189
|
-
|
|
5190
|
-
|
|
5191
|
-
|
|
5192
|
-
|
|
5193
|
-
|
|
5194
|
-
|
|
5195
|
-
|
|
5196
|
-
|
|
5302
|
+
* Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.
|
|
5303
|
+
*
|
|
5304
|
+
* @event touchmove
|
|
5305
|
+
* @memberof Map
|
|
5306
|
+
* @instance
|
|
5307
|
+
* @property {MapTouchEvent} data
|
|
5308
|
+
* @example
|
|
5309
|
+
* // Initialize the map
|
|
5310
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5311
|
+
* // Set an event listener that fires
|
|
5312
|
+
* // when a touchmove event occurs within the map.
|
|
5313
|
+
* map.on('touchmove', function() {
|
|
5314
|
+
* console.log('A touchmove event occurred.');
|
|
5315
|
+
* });
|
|
5316
|
+
* @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
|
|
5317
|
+
*/
|
|
5318
|
+
| "touchmove"
|
|
5197
5319
|
/**
|
|
5198
|
-
|
|
5199
|
-
|
|
5200
|
-
|
|
5201
|
-
|
|
5202
|
-
|
|
5203
|
-
|
|
5204
|
-
|
|
5205
|
-
|
|
5206
|
-
|
|
5207
|
-
|
|
5208
|
-
|
|
5209
|
-
|
|
5210
|
-
|
|
5211
|
-
|
|
5212
|
-
|
|
5213
|
-
|
|
5214
|
-
*/ | "movestart"
|
|
5320
|
+
* Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.
|
|
5321
|
+
*
|
|
5322
|
+
* @event touchcancel
|
|
5323
|
+
* @memberof Map
|
|
5324
|
+
* @instance
|
|
5325
|
+
* @property {MapTouchEvent} data
|
|
5326
|
+
* @example
|
|
5327
|
+
* // Initialize the map
|
|
5328
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5329
|
+
* // Set an event listener that fires
|
|
5330
|
+
* // when a touchcancel event occurs within the map.
|
|
5331
|
+
* map.on('touchcancel', function() {
|
|
5332
|
+
* console.log('A touchcancel event occurred.');
|
|
5333
|
+
* });
|
|
5334
|
+
*/
|
|
5335
|
+
| "touchcancel"
|
|
5215
5336
|
/**
|
|
5216
|
-
|
|
5217
|
-
|
|
5218
|
-
|
|
5219
|
-
|
|
5220
|
-
|
|
5221
|
-
|
|
5222
|
-
|
|
5223
|
-
|
|
5224
|
-
|
|
5225
|
-
|
|
5226
|
-
|
|
5227
|
-
|
|
5228
|
-
|
|
5229
|
-
|
|
5230
|
-
|
|
5231
|
-
|
|
5232
|
-
|
|
5337
|
+
* Fired just before the map begins a transition from one
|
|
5338
|
+
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
|
|
5339
|
+
*
|
|
5340
|
+
* @event movestart
|
|
5341
|
+
* @memberof Map
|
|
5342
|
+
* @instance
|
|
5343
|
+
* @property {{originalEvent: DragEvent}} data
|
|
5344
|
+
* @example
|
|
5345
|
+
* // Initialize the map
|
|
5346
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5347
|
+
* // Set an event listener that fires
|
|
5348
|
+
* // just before the map begins a transition
|
|
5349
|
+
* // from one view to another.
|
|
5350
|
+
* map.on('movestart', function() {
|
|
5351
|
+
* console.log('A movestart` event occurred.');
|
|
5352
|
+
* });
|
|
5353
|
+
*/
|
|
5354
|
+
| "movestart"
|
|
5233
5355
|
/**
|
|
5234
|
-
|
|
5235
|
-
|
|
5236
|
-
|
|
5237
|
-
|
|
5238
|
-
|
|
5239
|
-
|
|
5240
|
-
|
|
5241
|
-
|
|
5242
|
-
|
|
5243
|
-
|
|
5244
|
-
|
|
5245
|
-
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5356
|
+
* Fired repeatedly during an animated transition from one view to
|
|
5357
|
+
* another, as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
5358
|
+
*
|
|
5359
|
+
* @event move
|
|
5360
|
+
* @memberof Map
|
|
5361
|
+
* @instance
|
|
5362
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5363
|
+
* @example
|
|
5364
|
+
* // Initialize the map
|
|
5365
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5366
|
+
* // Set an event listener that fires
|
|
5367
|
+
* // repeatedly during an animated transition.
|
|
5368
|
+
* map.on('move', function() {
|
|
5369
|
+
* console.log('A move event occurred.');
|
|
5370
|
+
* });
|
|
5371
|
+
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
|
|
5372
|
+
*/
|
|
5373
|
+
| "move"
|
|
5251
5374
|
/**
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5258
|
-
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
|
|
5266
|
-
|
|
5375
|
+
* Fired just after the map completes a transition from one
|
|
5376
|
+
* view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
|
|
5377
|
+
*
|
|
5378
|
+
* @event moveend
|
|
5379
|
+
* @memberof Map
|
|
5380
|
+
* @instance
|
|
5381
|
+
* @property {{originalEvent: DragEvent}} data
|
|
5382
|
+
* @example
|
|
5383
|
+
* // Initialize the map
|
|
5384
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5385
|
+
* // Set an event listener that fires
|
|
5386
|
+
* // just after the map completes a transition.
|
|
5387
|
+
* map.on('moveend', function() {
|
|
5388
|
+
* console.log('A moveend event occurred.');
|
|
5389
|
+
* });
|
|
5390
|
+
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
|
|
5391
|
+
*/
|
|
5392
|
+
| "moveend"
|
|
5267
5393
|
/**
|
|
5268
|
-
|
|
5269
|
-
|
|
5270
|
-
|
|
5271
|
-
|
|
5272
|
-
|
|
5273
|
-
|
|
5274
|
-
|
|
5275
|
-
|
|
5276
|
-
|
|
5277
|
-
|
|
5278
|
-
|
|
5279
|
-
|
|
5280
|
-
|
|
5281
|
-
|
|
5282
|
-
|
|
5394
|
+
* Fired when a "drag to pan" interaction starts. See {@link DragPanHandler}.
|
|
5395
|
+
*
|
|
5396
|
+
* @event dragstart
|
|
5397
|
+
* @memberof Map
|
|
5398
|
+
* @instance
|
|
5399
|
+
* @property {{originalEvent: DragEvent}} data
|
|
5400
|
+
* @example
|
|
5401
|
+
* // Initialize the map
|
|
5402
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5403
|
+
* // Set an event listener that fires
|
|
5404
|
+
* // when a "drag to pan" interaction starts.
|
|
5405
|
+
* map.on('dragstart', function() {
|
|
5406
|
+
* console.log('A dragstart event occurred.');
|
|
5407
|
+
* });
|
|
5408
|
+
*/
|
|
5409
|
+
| "dragstart"
|
|
5283
5410
|
/**
|
|
5284
|
-
|
|
5285
|
-
|
|
5286
|
-
|
|
5287
|
-
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5292
|
-
|
|
5293
|
-
|
|
5294
|
-
|
|
5295
|
-
|
|
5296
|
-
|
|
5297
|
-
|
|
5298
|
-
|
|
5299
|
-
|
|
5411
|
+
* Fired repeatedly during a "drag to pan" interaction. See {@link DragPanHandler}.
|
|
5412
|
+
*
|
|
5413
|
+
* @event drag
|
|
5414
|
+
* @memberof Map
|
|
5415
|
+
* @instance
|
|
5416
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5417
|
+
* @example
|
|
5418
|
+
* // Initialize the map
|
|
5419
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5420
|
+
* // Set an event listener that fires
|
|
5421
|
+
* // repeatedly during a "drag to pan" interaction.
|
|
5422
|
+
* map.on('drag', function() {
|
|
5423
|
+
* console.log('A drag event occurred.');
|
|
5424
|
+
* });
|
|
5425
|
+
*/
|
|
5426
|
+
| "drag"
|
|
5300
5427
|
/**
|
|
5301
|
-
|
|
5302
|
-
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5428
|
+
* Fired when a "drag to pan" interaction ends. See {@link DragPanHandler}.
|
|
5429
|
+
*
|
|
5430
|
+
* @event dragend
|
|
5431
|
+
* @memberof Map
|
|
5432
|
+
* @instance
|
|
5433
|
+
* @property {{originalEvent: DragEvent}} data
|
|
5434
|
+
* @example
|
|
5435
|
+
* // Initialize the map
|
|
5436
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5437
|
+
* // Set an event listener that fires
|
|
5438
|
+
* // when a "drag to pan" interaction ends.
|
|
5439
|
+
* map.on('dragend', function() {
|
|
5440
|
+
* console.log('A dragend event occurred.');
|
|
5441
|
+
* });
|
|
5442
|
+
* @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
|
|
5443
|
+
*/
|
|
5444
|
+
| "dragend"
|
|
5317
5445
|
/**
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5446
|
+
* Fired just before the map begins a transition from one zoom level to another,
|
|
5447
|
+
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
5448
|
+
*
|
|
5449
|
+
* @event zoomstart
|
|
5450
|
+
* @memberof Map
|
|
5451
|
+
* @instance
|
|
5452
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5453
|
+
* @example
|
|
5454
|
+
* // Initialize the map
|
|
5455
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5456
|
+
* // Set an event listener that fires
|
|
5457
|
+
* // just before a zoom transition starts.
|
|
5458
|
+
* map.on('zoomstart', function() {
|
|
5459
|
+
* console.log('A zoomstart event occurred.');
|
|
5460
|
+
* });
|
|
5461
|
+
*/
|
|
5462
|
+
| "zoomstart"
|
|
5334
5463
|
/**
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5345
|
-
|
|
5346
|
-
|
|
5347
|
-
|
|
5348
|
-
|
|
5349
|
-
|
|
5350
|
-
|
|
5464
|
+
* Fired repeatedly during an animated transition from one zoom level to another,
|
|
5465
|
+
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
5466
|
+
*
|
|
5467
|
+
* @event zoom
|
|
5468
|
+
* @memberof Map
|
|
5469
|
+
* @instance
|
|
5470
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5471
|
+
* @example
|
|
5472
|
+
* // Initialize the map
|
|
5473
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5474
|
+
* // Set an event listener that fires
|
|
5475
|
+
* // repeatedly during a zoom transition.
|
|
5476
|
+
* map.on('zoom', function() {
|
|
5477
|
+
* console.log('A zoom event occurred.');
|
|
5478
|
+
* });
|
|
5479
|
+
*/
|
|
5480
|
+
| "zoom"
|
|
5351
5481
|
/**
|
|
5352
|
-
|
|
5353
|
-
|
|
5354
|
-
|
|
5355
|
-
|
|
5356
|
-
|
|
5357
|
-
|
|
5358
|
-
|
|
5359
|
-
|
|
5360
|
-
|
|
5361
|
-
|
|
5362
|
-
|
|
5363
|
-
|
|
5364
|
-
|
|
5365
|
-
|
|
5366
|
-
|
|
5482
|
+
* Fired just after the map completes a transition from one zoom level to another,
|
|
5483
|
+
* as the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
5484
|
+
*
|
|
5485
|
+
* @event zoomend
|
|
5486
|
+
* @memberof Map
|
|
5487
|
+
* @instance
|
|
5488
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5489
|
+
* @example
|
|
5490
|
+
* // Initialize the map
|
|
5491
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5492
|
+
* // Set an event listener that fires
|
|
5493
|
+
* // just after a zoom transition finishes.
|
|
5494
|
+
* map.on('zoomend', function() {
|
|
5495
|
+
* console.log('A zoomend event occurred.');
|
|
5496
|
+
* });
|
|
5497
|
+
*/
|
|
5498
|
+
| "zoomend"
|
|
5367
5499
|
/**
|
|
5368
|
-
|
|
5369
|
-
|
|
5370
|
-
|
|
5371
|
-
|
|
5372
|
-
|
|
5373
|
-
|
|
5374
|
-
|
|
5375
|
-
|
|
5376
|
-
|
|
5377
|
-
|
|
5378
|
-
|
|
5379
|
-
|
|
5380
|
-
|
|
5381
|
-
|
|
5382
|
-
|
|
5500
|
+
* Fired when a "drag to rotate" interaction starts. See {@link DragRotateHandler}.
|
|
5501
|
+
*
|
|
5502
|
+
* @event rotatestart
|
|
5503
|
+
* @memberof Map
|
|
5504
|
+
* @instance
|
|
5505
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5506
|
+
* @example
|
|
5507
|
+
* // Initialize the map
|
|
5508
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5509
|
+
* // Set an event listener that fires
|
|
5510
|
+
* // just before a "drag to rotate" interaction starts.
|
|
5511
|
+
* map.on('rotatestart', function() {
|
|
5512
|
+
* console.log('A rotatestart event occurred.');
|
|
5513
|
+
* });
|
|
5514
|
+
*/
|
|
5515
|
+
| "rotatestart"
|
|
5383
5516
|
/**
|
|
5384
|
-
|
|
5385
|
-
|
|
5386
|
-
|
|
5387
|
-
|
|
5388
|
-
|
|
5389
|
-
|
|
5390
|
-
|
|
5391
|
-
|
|
5392
|
-
|
|
5393
|
-
|
|
5394
|
-
|
|
5395
|
-
|
|
5396
|
-
|
|
5397
|
-
|
|
5398
|
-
|
|
5517
|
+
* Fired repeatedly during a "drag to rotate" interaction. See {@link DragRotateHandler}.
|
|
5518
|
+
*
|
|
5519
|
+
* @event rotate
|
|
5520
|
+
* @memberof Map
|
|
5521
|
+
* @instance
|
|
5522
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5523
|
+
* @example
|
|
5524
|
+
* // Initialize the map
|
|
5525
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5526
|
+
* // Set an event listener that fires
|
|
5527
|
+
* // repeatedly during "drag to rotate" interaction.
|
|
5528
|
+
* map.on('rotate', function() {
|
|
5529
|
+
* console.log('A rotate event occurred.');
|
|
5530
|
+
* });
|
|
5531
|
+
*/
|
|
5532
|
+
| "rotate"
|
|
5399
5533
|
/**
|
|
5400
|
-
|
|
5401
|
-
|
|
5402
|
-
|
|
5403
|
-
|
|
5404
|
-
|
|
5405
|
-
|
|
5406
|
-
|
|
5407
|
-
|
|
5408
|
-
|
|
5409
|
-
|
|
5410
|
-
|
|
5411
|
-
|
|
5412
|
-
|
|
5413
|
-
|
|
5414
|
-
|
|
5415
|
-
|
|
5534
|
+
* Fired when a "drag to rotate" interaction ends. See {@link DragRotateHandler}.
|
|
5535
|
+
*
|
|
5536
|
+
* @event rotateend
|
|
5537
|
+
* @memberof Map
|
|
5538
|
+
* @instance
|
|
5539
|
+
* @property {MapMouseEvent | MapTouchEvent} data
|
|
5540
|
+
* @example
|
|
5541
|
+
* // Initialize the map
|
|
5542
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5543
|
+
* // Set an event listener that fires
|
|
5544
|
+
* // just after a "drag to rotate" interaction ends.
|
|
5545
|
+
* map.on('rotateend', function() {
|
|
5546
|
+
* console.log('A rotateend event occurred.');
|
|
5547
|
+
* });
|
|
5548
|
+
*/
|
|
5549
|
+
| "rotateend"
|
|
5416
5550
|
/**
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5421
|
-
|
|
5422
|
-
|
|
5423
|
-
|
|
5424
|
-
|
|
5425
|
-
|
|
5426
|
-
|
|
5427
|
-
|
|
5428
|
-
|
|
5429
|
-
|
|
5430
|
-
|
|
5431
|
-
|
|
5432
|
-
|
|
5433
|
-
|
|
5551
|
+
* Fired whenever the map's pitch (tilt) begins a change as
|
|
5552
|
+
* the result of either user interaction or methods such as {@link Map#flyTo} .
|
|
5553
|
+
*
|
|
5554
|
+
* @event pitchstart
|
|
5555
|
+
* @memberof Map
|
|
5556
|
+
* @instance
|
|
5557
|
+
* @property {MapEventData} data
|
|
5558
|
+
* @example
|
|
5559
|
+
* // Initialize the map
|
|
5560
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5561
|
+
* // Set an event listener that fires
|
|
5562
|
+
* // just before a pitch (tilt) transition starts.
|
|
5563
|
+
* map.on('pitchstart', function() {
|
|
5564
|
+
* console.log('A pitchstart event occurred.');
|
|
5565
|
+
* });
|
|
5566
|
+
*/
|
|
5567
|
+
| "pitchstart"
|
|
5434
5568
|
/**
|
|
5435
|
-
|
|
5436
|
-
|
|
5437
|
-
|
|
5438
|
-
|
|
5439
|
-
|
|
5440
|
-
|
|
5441
|
-
|
|
5442
|
-
|
|
5443
|
-
|
|
5444
|
-
|
|
5445
|
-
|
|
5446
|
-
|
|
5447
|
-
|
|
5448
|
-
|
|
5449
|
-
|
|
5450
|
-
|
|
5569
|
+
* Fired repeatedly during the map's pitch (tilt) animation between
|
|
5570
|
+
* one state and another as the result of either user interaction
|
|
5571
|
+
* or methods such as {@link Map#flyTo}.
|
|
5572
|
+
*
|
|
5573
|
+
* @event pitch
|
|
5574
|
+
* @memberof Map
|
|
5575
|
+
* @instance
|
|
5576
|
+
* @property {MapEventData} data
|
|
5577
|
+
* @example
|
|
5578
|
+
* // Initialize the map
|
|
5579
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5580
|
+
* // Set an event listener that fires
|
|
5581
|
+
* // repeatedly during a pitch (tilt) transition.
|
|
5582
|
+
* map.on('pitch', function() {
|
|
5583
|
+
* console.log('A pitch event occurred.');
|
|
5584
|
+
* });
|
|
5585
|
+
*/
|
|
5586
|
+
| "pitch"
|
|
5451
5587
|
/**
|
|
5452
|
-
|
|
5453
|
-
|
|
5454
|
-
|
|
5455
|
-
|
|
5456
|
-
|
|
5457
|
-
|
|
5458
|
-
|
|
5459
|
-
|
|
5460
|
-
|
|
5461
|
-
|
|
5462
|
-
|
|
5463
|
-
|
|
5464
|
-
|
|
5465
|
-
|
|
5466
|
-
|
|
5588
|
+
* Fired immediately after the map's pitch (tilt) finishes changing as
|
|
5589
|
+
* the result of either user interaction or methods such as {@link Map#flyTo}.
|
|
5590
|
+
*
|
|
5591
|
+
* @event pitchend
|
|
5592
|
+
* @memberof Map
|
|
5593
|
+
* @instance
|
|
5594
|
+
* @property {MapEventData} data
|
|
5595
|
+
* @example
|
|
5596
|
+
* // Initialize the map
|
|
5597
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5598
|
+
* // Set an event listener that fires
|
|
5599
|
+
* // just after a pitch (tilt) transition ends.
|
|
5600
|
+
* map.on('pitchend', function() {
|
|
5601
|
+
* console.log('A pitchend event occurred.');
|
|
5602
|
+
* });
|
|
5603
|
+
*/
|
|
5604
|
+
| "pitchend"
|
|
5467
5605
|
/**
|
|
5468
|
-
|
|
5469
|
-
|
|
5470
|
-
|
|
5471
|
-
|
|
5472
|
-
|
|
5473
|
-
|
|
5474
|
-
|
|
5475
|
-
|
|
5476
|
-
|
|
5477
|
-
|
|
5478
|
-
|
|
5479
|
-
|
|
5480
|
-
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
|
|
5606
|
+
* Fired when a "box zoom" interaction starts. See {@link BoxZoomHandler}.
|
|
5607
|
+
*
|
|
5608
|
+
* @event boxzoomstart
|
|
5609
|
+
* @memberof Map
|
|
5610
|
+
* @instance
|
|
5611
|
+
* @property {MapLibreZoomEvent} data
|
|
5612
|
+
* @example
|
|
5613
|
+
* // Initialize the map
|
|
5614
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5615
|
+
* // Set an event listener that fires
|
|
5616
|
+
* // just before a "box zoom" interaction starts.
|
|
5617
|
+
* map.on('boxzoomstart', function() {
|
|
5618
|
+
* console.log('A boxzoomstart event occurred.');
|
|
5619
|
+
* });
|
|
5620
|
+
*/
|
|
5621
|
+
| "boxzoomstart"
|
|
5484
5622
|
/**
|
|
5485
|
-
|
|
5486
|
-
|
|
5487
|
-
|
|
5488
|
-
|
|
5489
|
-
|
|
5490
|
-
|
|
5491
|
-
|
|
5492
|
-
|
|
5493
|
-
|
|
5494
|
-
|
|
5495
|
-
|
|
5496
|
-
|
|
5497
|
-
|
|
5498
|
-
|
|
5499
|
-
|
|
5500
|
-
|
|
5623
|
+
* Fired when a "box zoom" interaction ends. See {@link BoxZoomHandler}.
|
|
5624
|
+
*
|
|
5625
|
+
* @event boxzoomend
|
|
5626
|
+
* @memberof Map
|
|
5627
|
+
* @instance
|
|
5628
|
+
* @type {Object}
|
|
5629
|
+
* @property {MapLibreZoomEvent} data
|
|
5630
|
+
* @example
|
|
5631
|
+
* // Initialize the map
|
|
5632
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5633
|
+
* // Set an event listener that fires
|
|
5634
|
+
* // just after a "box zoom" interaction ends.
|
|
5635
|
+
* map.on('boxzoomend', function() {
|
|
5636
|
+
* console.log('A boxzoomend event occurred.');
|
|
5637
|
+
* });
|
|
5638
|
+
*/
|
|
5639
|
+
| "boxzoomend"
|
|
5501
5640
|
/**
|
|
5502
|
-
|
|
5503
|
-
|
|
5504
|
-
|
|
5505
|
-
|
|
5506
|
-
|
|
5507
|
-
|
|
5508
|
-
|
|
5509
|
-
|
|
5510
|
-
|
|
5511
|
-
|
|
5512
|
-
|
|
5513
|
-
|
|
5514
|
-
|
|
5515
|
-
|
|
5641
|
+
* Fired when the user cancels a "box zoom" interaction, or when the bounding box does not meet the minimum size threshold.
|
|
5642
|
+
* See {@link BoxZoomHandler}.
|
|
5643
|
+
*
|
|
5644
|
+
* @event boxzoomcancel
|
|
5645
|
+
* @memberof Map
|
|
5646
|
+
* @instance
|
|
5647
|
+
* @property {MapLibreZoomEvent} data
|
|
5648
|
+
* @example
|
|
5649
|
+
* // Initialize the map
|
|
5650
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5651
|
+
* // Set an event listener that fires
|
|
5652
|
+
* // the user cancels a "box zoom" interaction.
|
|
5653
|
+
* map.on('boxzoomcancel', function() {
|
|
5654
|
+
* console.log('A boxzoomcancel event occurred.');
|
|
5655
|
+
* });
|
|
5656
|
+
*/
|
|
5657
|
+
| "boxzoomcancel"
|
|
5516
5658
|
/**
|
|
5517
|
-
|
|
5518
|
-
|
|
5519
|
-
|
|
5520
|
-
|
|
5521
|
-
|
|
5522
|
-
|
|
5523
|
-
|
|
5524
|
-
|
|
5525
|
-
|
|
5526
|
-
|
|
5527
|
-
|
|
5528
|
-
|
|
5529
|
-
|
|
5530
|
-
|
|
5659
|
+
* Fired immediately after the map has been resized.
|
|
5660
|
+
*
|
|
5661
|
+
* @event resize
|
|
5662
|
+
* @memberof Map
|
|
5663
|
+
* @instance
|
|
5664
|
+
* @example
|
|
5665
|
+
* // Initialize the map
|
|
5666
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5667
|
+
* // Set an event listener that fires
|
|
5668
|
+
* // immediately after the map has been resized.
|
|
5669
|
+
* map.on('resize', function() {
|
|
5670
|
+
* console.log('A resize event occurred.');
|
|
5671
|
+
* });
|
|
5672
|
+
*/
|
|
5673
|
+
| "resize"
|
|
5674
|
+
/**
|
|
5675
|
+
* Fired when the WebGL context is lost.
|
|
5676
|
+
*
|
|
5677
|
+
* @event webglcontextlost
|
|
5678
|
+
* @memberof Map
|
|
5679
|
+
* @instance
|
|
5680
|
+
* @example
|
|
5681
|
+
* // Initialize the map
|
|
5682
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5683
|
+
* // Set an event listener that fires
|
|
5684
|
+
* // when the WebGL context is lost.
|
|
5685
|
+
* map.on('webglcontextlost', function() {
|
|
5686
|
+
* console.log('A webglcontextlost event occurred.');
|
|
5687
|
+
* });
|
|
5688
|
+
*/
|
|
5689
|
+
| "webglcontextlost"
|
|
5690
|
+
/**
|
|
5691
|
+
* Fired when the WebGL context is restored.
|
|
5692
|
+
*
|
|
5693
|
+
* @event webglcontextrestored
|
|
5694
|
+
* @memberof Map
|
|
5695
|
+
* @instance
|
|
5696
|
+
* @example
|
|
5697
|
+
* // Initialize the map
|
|
5698
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5699
|
+
* // Set an event listener that fires
|
|
5700
|
+
* // when the WebGL context is restored.
|
|
5701
|
+
* map.on('webglcontextrestored', function() {
|
|
5702
|
+
* console.log('A webglcontextrestored event occurred.');
|
|
5703
|
+
* });
|
|
5704
|
+
*/
|
|
5705
|
+
| "webglcontextrestored"
|
|
5706
|
+
/**
|
|
5707
|
+
* Fired immediately after all necessary resources have been downloaded
|
|
5708
|
+
* and the first visually complete rendering of the map has occurred.
|
|
5709
|
+
*
|
|
5710
|
+
* @event load
|
|
5711
|
+
* @memberof Map
|
|
5712
|
+
* @instance
|
|
5713
|
+
* @type {Object}
|
|
5714
|
+
* @example
|
|
5715
|
+
* // Initialize the map
|
|
5716
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5717
|
+
* // Set an event listener that fires
|
|
5718
|
+
* // when the map has finished loading.
|
|
5719
|
+
* map.on('load', function() {
|
|
5720
|
+
* console.log('A load event occurred.');
|
|
5721
|
+
* });
|
|
5722
|
+
* @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js-docs/example/geojson-markers/)
|
|
5723
|
+
* @see [Add live realtime data](https://maplibre.org/maplibre-gl-js-docs/example/live-geojson/)
|
|
5724
|
+
* @see [Animate a point](https://maplibre.org/maplibre-gl-js-docs/example/animate-point-along-line/)
|
|
5725
|
+
*/
|
|
5726
|
+
| "load"
|
|
5727
|
+
/**
|
|
5728
|
+
* Fired whenever the map is drawn to the screen, as the result of
|
|
5729
|
+
*
|
|
5730
|
+
* - a change to the map's position, zoom, pitch, or bearing
|
|
5731
|
+
* - a change to the map's style
|
|
5732
|
+
* - a change to a GeoJSON source
|
|
5733
|
+
* - the loading of a vector tile, GeoJSON file, glyph, or sprite
|
|
5734
|
+
*
|
|
5735
|
+
* @event render
|
|
5736
|
+
* @memberof Map
|
|
5737
|
+
* @instance
|
|
5738
|
+
* @example
|
|
5739
|
+
* // Initialize the map
|
|
5740
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5741
|
+
* // Set an event listener that fires
|
|
5742
|
+
* // whenever the map is drawn to the screen.
|
|
5743
|
+
* map.on('render', function() {
|
|
5744
|
+
* console.log('A render event occurred.');
|
|
5745
|
+
* });
|
|
5746
|
+
*/
|
|
5747
|
+
| "render"
|
|
5748
|
+
/**
|
|
5749
|
+
* Fired after the last frame rendered before the map enters an
|
|
5750
|
+
* "idle" state:
|
|
5751
|
+
*
|
|
5752
|
+
* - No camera transitions are in progress
|
|
5753
|
+
* - All currently requested tiles have loaded
|
|
5754
|
+
* - All fade/transition animations have completed
|
|
5755
|
+
*
|
|
5756
|
+
* @event idle
|
|
5757
|
+
* @memberof Map
|
|
5758
|
+
* @instance
|
|
5759
|
+
* @example
|
|
5760
|
+
* // Initialize the map
|
|
5761
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5762
|
+
* // Set an event listener that fires
|
|
5763
|
+
* // just before the map enters an "idle" state.
|
|
5764
|
+
* map.on('idle', function() {
|
|
5765
|
+
* console.log('A idle event occurred.');
|
|
5766
|
+
* });
|
|
5767
|
+
*/
|
|
5768
|
+
| "idle"
|
|
5769
|
+
/**
|
|
5770
|
+
* Fired immediately after the map has been removed with {@link Map.event:remove}.
|
|
5771
|
+
*
|
|
5772
|
+
* @event remove
|
|
5773
|
+
* @memberof Map
|
|
5774
|
+
* @instance
|
|
5775
|
+
* @example
|
|
5776
|
+
* // Initialize the map
|
|
5777
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5778
|
+
* // Set an event listener that fires
|
|
5779
|
+
* // just after the map is removed.
|
|
5780
|
+
* map.on('remove', function() {
|
|
5781
|
+
* console.log('A remove event occurred.');
|
|
5782
|
+
* });
|
|
5783
|
+
*/
|
|
5784
|
+
| "remove"
|
|
5785
|
+
/**
|
|
5786
|
+
* Fired when an error occurs. This is GL JS's primary error reporting
|
|
5787
|
+
* mechanism. We use an event instead of `throw` to better accommodate
|
|
5788
|
+
* asyncronous operations. If no listeners are bound to the `error` event, the
|
|
5789
|
+
* error will be printed to the console.
|
|
5790
|
+
*
|
|
5791
|
+
* @event error
|
|
5792
|
+
* @memberof Map
|
|
5793
|
+
* @instance
|
|
5794
|
+
* @property {{error: {message: string}}} data
|
|
5795
|
+
* @example
|
|
5796
|
+
* // Initialize the map
|
|
5797
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5798
|
+
* // Set an event listener that fires
|
|
5799
|
+
* // when an error occurs.
|
|
5800
|
+
* map.on('error', function() {
|
|
5801
|
+
* console.log('A error event occurred.');
|
|
5802
|
+
* });
|
|
5803
|
+
*/
|
|
5804
|
+
| "error"
|
|
5805
|
+
/**
|
|
5806
|
+
* Fired when any map data loads or changes. See {@link MapDataEvent}
|
|
5807
|
+
* for more information.
|
|
5808
|
+
*
|
|
5809
|
+
* @event data
|
|
5810
|
+
* @memberof Map
|
|
5811
|
+
* @instance
|
|
5812
|
+
* @property {MapDataEvent} data
|
|
5813
|
+
* @example
|
|
5814
|
+
* // Initialize the map
|
|
5815
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5816
|
+
* // Set an event listener that fires
|
|
5817
|
+
* // when map data loads or changes.
|
|
5818
|
+
* map.on('data', function() {
|
|
5819
|
+
* console.log('A data event occurred.');
|
|
5820
|
+
* });
|
|
5821
|
+
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
|
|
5822
|
+
*/
|
|
5823
|
+
| "data"
|
|
5824
|
+
/**
|
|
5825
|
+
* Fired when the map's style loads or changes. See
|
|
5826
|
+
* {@link MapDataEvent} for more information.
|
|
5827
|
+
*
|
|
5828
|
+
* @event styledata
|
|
5829
|
+
* @memberof Map
|
|
5830
|
+
* @instance
|
|
5831
|
+
* @property {MapDataEvent} data
|
|
5832
|
+
* @example
|
|
5833
|
+
* // Initialize the map
|
|
5834
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5835
|
+
* // Set an event listener that fires
|
|
5836
|
+
* // when the map's style loads or changes.
|
|
5837
|
+
* map.on('styledata', function() {
|
|
5838
|
+
* console.log('A styledata event occurred.');
|
|
5839
|
+
* });
|
|
5840
|
+
*/
|
|
5841
|
+
| "styledata"
|
|
5842
|
+
/**
|
|
5843
|
+
* Fired when one of the map's sources loads or changes, including if a tile belonging
|
|
5844
|
+
* to a source loads or changes. See {@link MapDataEvent} for more information.
|
|
5845
|
+
*
|
|
5846
|
+
* @event sourcedata
|
|
5847
|
+
* @memberof Map
|
|
5848
|
+
* @instance
|
|
5849
|
+
* @property {MapDataEvent} data
|
|
5850
|
+
* @example
|
|
5851
|
+
* // Initialize the map
|
|
5852
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5853
|
+
* // Set an event listener that fires
|
|
5854
|
+
* // when one of the map's sources loads or changes.
|
|
5855
|
+
* map.on('sourcedata', function() {
|
|
5856
|
+
* console.log('A sourcedata event occurred.');
|
|
5857
|
+
* });
|
|
5858
|
+
*/
|
|
5859
|
+
| "sourcedata"
|
|
5860
|
+
/**
|
|
5861
|
+
* Fired when any map data (style, source, tile, etc) begins loading or
|
|
5862
|
+
* changing asyncronously. All `dataloading` events are followed by a `data`,
|
|
5863
|
+
* `dataabort` or `error` event. See {@link MapDataEvent} for more information.
|
|
5864
|
+
*
|
|
5865
|
+
* @event dataloading
|
|
5866
|
+
* @memberof Map
|
|
5867
|
+
* @instance
|
|
5868
|
+
* @property {MapDataEvent} data
|
|
5869
|
+
* @example
|
|
5870
|
+
* // Initialize the map
|
|
5871
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5872
|
+
* // Set an event listener that fires
|
|
5873
|
+
* // when any map data begins loading
|
|
5874
|
+
* // or changing asynchronously.
|
|
5875
|
+
* map.on('dataloading', function() {
|
|
5876
|
+
* console.log('A dataloading event occurred.');
|
|
5877
|
+
* });
|
|
5878
|
+
*/
|
|
5879
|
+
| "dataloading"
|
|
5880
|
+
/**
|
|
5881
|
+
* Fired when the map's style begins loading or changing asyncronously.
|
|
5882
|
+
* All `styledataloading` events are followed by a `styledata`
|
|
5883
|
+
* or `error` event. See {@link MapDataEvent} for more information.
|
|
5884
|
+
*
|
|
5885
|
+
* @event styledataloading
|
|
5886
|
+
* @memberof Map
|
|
5887
|
+
* @instance
|
|
5888
|
+
* @property {MapDataEvent} data
|
|
5889
|
+
* @example
|
|
5890
|
+
* // Initialize the map
|
|
5891
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5892
|
+
* // Set an event listener that fires
|
|
5893
|
+
* // map's style begins loading or
|
|
5894
|
+
* // changing asyncronously.
|
|
5895
|
+
* map.on('styledataloading', function() {
|
|
5896
|
+
* console.log('A styledataloading event occurred.');
|
|
5897
|
+
* });
|
|
5898
|
+
*/
|
|
5899
|
+
| "styledataloading"
|
|
5900
|
+
/**
|
|
5901
|
+
* Fired when one of the map's sources begins loading or changing asyncronously.
|
|
5902
|
+
* All `sourcedataloading` events are followed by a `sourcedata`, `sourcedataabort` or `error` event.
|
|
5903
|
+
* See {@link MapDataEvent} for more information.
|
|
5904
|
+
*
|
|
5905
|
+
* @event sourcedataloading
|
|
5906
|
+
* @memberof Map
|
|
5907
|
+
* @instance
|
|
5908
|
+
* @property {MapDataEvent} data
|
|
5909
|
+
* @example
|
|
5910
|
+
* // Initialize the map
|
|
5911
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5912
|
+
* // Set an event listener that fires
|
|
5913
|
+
* // map's sources begin loading or
|
|
5914
|
+
* // changing asyncronously.
|
|
5915
|
+
* map.on('sourcedataloading', function() {
|
|
5916
|
+
* console.log('A sourcedataloading event occurred.');
|
|
5917
|
+
* });
|
|
5918
|
+
*/
|
|
5919
|
+
| "sourcedataloading"
|
|
5920
|
+
/**
|
|
5921
|
+
* Fired when an icon or pattern needed by the style is missing. The missing image can
|
|
5922
|
+
* be added with {@link Map#addImage} within this event listener callback to prevent the image from
|
|
5923
|
+
* being skipped. This event can be used to dynamically generate icons and patterns.
|
|
5924
|
+
*
|
|
5925
|
+
* @event styleimagemissing
|
|
5926
|
+
* @memberof Map
|
|
5927
|
+
* @instance
|
|
5928
|
+
* @property {string} id The id of the missing image.
|
|
5929
|
+
* @example
|
|
5930
|
+
* // Initialize the map
|
|
5931
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5932
|
+
* // Set an event listener that fires
|
|
5933
|
+
* // an icon or pattern is missing.
|
|
5934
|
+
* map.on('styleimagemissing', function() {
|
|
5935
|
+
* console.log('A styleimagemissing event occurred.');
|
|
5936
|
+
* });
|
|
5937
|
+
* @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-missing-generated/)
|
|
5938
|
+
*/
|
|
5939
|
+
| "styleimagemissing"
|
|
5531
5940
|
/**
|
|
5532
|
-
|
|
5533
|
-
|
|
5534
|
-
|
|
5535
|
-
|
|
5536
|
-
|
|
5537
|
-
|
|
5538
|
-
* // Initialize the map
|
|
5539
|
-
* var map = new maplibregl.Map({ // map options });
|
|
5540
|
-
* // Set an event listener that fires
|
|
5541
|
-
* // when the WebGL context is restored.
|
|
5542
|
-
* map.on('webglcontextrestored', function() {
|
|
5543
|
-
* console.log('A webglcontextrestored event occurred.');
|
|
5544
|
-
* });
|
|
5545
|
-
*/ | "webglcontextrestored"
|
|
5941
|
+
* @event style.load
|
|
5942
|
+
* @memberof Map
|
|
5943
|
+
* @instance
|
|
5944
|
+
* @private
|
|
5945
|
+
*/
|
|
5946
|
+
| "style.load"
|
|
5546
5947
|
/**
|
|
5547
|
-
|
|
5548
|
-
|
|
5549
|
-
|
|
5550
|
-
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
* @see [Animate a point](https://maplibre.org/maplibre-gl-js-docs/example/animate-point-along-line/)
|
|
5565
|
-
*/ | "load"
|
|
5948
|
+
* Fired when a request for one of the map's sources' tiles is aborted.
|
|
5949
|
+
* See {@link MapDataEvent} for more information.
|
|
5950
|
+
*
|
|
5951
|
+
* @event dataabort
|
|
5952
|
+
* @memberof Map
|
|
5953
|
+
* @instance
|
|
5954
|
+
* @property {MapDataEvent} data
|
|
5955
|
+
* @example
|
|
5956
|
+
* // Initialize the map
|
|
5957
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5958
|
+
* // Set an event listener that fires
|
|
5959
|
+
* // when a request for one of the map's sources' tiles is aborted.
|
|
5960
|
+
* map.on('dataabort', function() {
|
|
5961
|
+
* console.log('A dataabort event occurred.');
|
|
5962
|
+
* });
|
|
5963
|
+
*/
|
|
5964
|
+
| "dataabort"
|
|
5566
5965
|
/**
|
|
5567
|
-
|
|
5568
|
-
|
|
5569
|
-
|
|
5570
|
-
|
|
5571
|
-
|
|
5572
|
-
|
|
5966
|
+
* Fired when a request for one of the map's sources' tiles is aborted.
|
|
5967
|
+
* See {@link MapDataEvent} for more information.
|
|
5968
|
+
*
|
|
5969
|
+
* @event sourcedataabort
|
|
5970
|
+
* @memberof Map
|
|
5971
|
+
* @instance
|
|
5972
|
+
* @property {MapDataEvent} data
|
|
5973
|
+
* @example
|
|
5974
|
+
* // Initialize the map
|
|
5975
|
+
* var map = new maplibregl.Map({ // map options });
|
|
5976
|
+
* // Set an event listener that fires
|
|
5977
|
+
* // when a request for one of the map's sources' tiles is aborted.
|
|
5978
|
+
* map.on('sourcedataabort', function() {
|
|
5979
|
+
* console.log('A sourcedataabort event occurred.');
|
|
5980
|
+
* });
|
|
5981
|
+
*/
|
|
5982
|
+
| "sourcedataabort";
|
|
5983
|
+
export declare type GeoJSONSourceOptions = GeoJSONSourceSpecification & {
|
|
5984
|
+
workerOptions?: any;
|
|
5985
|
+
collectResourceTiming: boolean;
|
|
5986
|
+
};
|
|
5987
|
+
export declare class GeoJSONSource extends Evented implements Source {
|
|
5988
|
+
type: "geojson";
|
|
5989
|
+
id: string;
|
|
5990
|
+
minzoom: number;
|
|
5991
|
+
maxzoom: number;
|
|
5992
|
+
tileSize: number;
|
|
5993
|
+
attribution: string;
|
|
5994
|
+
promoteId: PromoteIdSpecification;
|
|
5995
|
+
isTileClipped: boolean;
|
|
5996
|
+
reparseOverscaled: boolean;
|
|
5997
|
+
_data: GeoJSON.GeoJSON | string;
|
|
5998
|
+
_options: any;
|
|
5999
|
+
workerOptions: any;
|
|
6000
|
+
map: Map;
|
|
6001
|
+
actor: Actor;
|
|
6002
|
+
_pendingLoads: number;
|
|
6003
|
+
_collectResourceTiming: boolean;
|
|
6004
|
+
_removed: boolean;
|
|
6005
|
+
/**
|
|
6006
|
+
* @private
|
|
6007
|
+
*/
|
|
6008
|
+
constructor(id: string, options: GeoJSONSourceOptions, dispatcher: Dispatcher, eventedParent: Evented);
|
|
6009
|
+
load(): void;
|
|
6010
|
+
onAdd(map: Map): void;
|
|
6011
|
+
/**
|
|
6012
|
+
* Sets the GeoJSON data and re-renders the map.
|
|
5573
6013
|
*
|
|
5574
|
-
* @
|
|
5575
|
-
* @
|
|
5576
|
-
|
|
5577
|
-
|
|
5578
|
-
|
|
5579
|
-
*
|
|
5580
|
-
* // Set an event listener that fires
|
|
5581
|
-
* // whenever the map is drawn to the screen.
|
|
5582
|
-
* map.on('render', function() {
|
|
5583
|
-
* console.log('A render event occurred.');
|
|
5584
|
-
* });
|
|
5585
|
-
*/ | "render"
|
|
5586
|
-
/**
|
|
5587
|
-
* Fired after the last frame rendered before the map enters an
|
|
5588
|
-
* "idle" state:
|
|
6014
|
+
* @param {Object|string} data A GeoJSON data object or a URL to one. The latter is preferable in the case of large GeoJSON files.
|
|
6015
|
+
* @returns {GeoJSONSource} this
|
|
6016
|
+
*/
|
|
6017
|
+
setData(data: GeoJSON.GeoJSON | string): this;
|
|
6018
|
+
/**
|
|
6019
|
+
* For clustered sources, fetches the zoom at which the given cluster expands.
|
|
5589
6020
|
*
|
|
5590
|
-
*
|
|
5591
|
-
*
|
|
5592
|
-
*
|
|
6021
|
+
* @param clusterId The value of the cluster's `cluster_id` property.
|
|
6022
|
+
* @param callback A callback to be called when the zoom value is retrieved (`(error, zoom) => { ... }`).
|
|
6023
|
+
* @returns {GeoJSONSource} this
|
|
6024
|
+
*/
|
|
6025
|
+
getClusterExpansionZoom(clusterId: number, callback: Callback<number>): this;
|
|
6026
|
+
/**
|
|
6027
|
+
* For clustered sources, fetches the children of the given cluster on the next zoom level (as an array of GeoJSON features).
|
|
5593
6028
|
*
|
|
5594
|
-
* @
|
|
5595
|
-
* @
|
|
5596
|
-
* @
|
|
5597
|
-
|
|
5598
|
-
|
|
5599
|
-
|
|
5600
|
-
*
|
|
5601
|
-
* // just before the map enters an "idle" state.
|
|
5602
|
-
* map.on('idle', function() {
|
|
5603
|
-
* console.log('A idle event occurred.');
|
|
5604
|
-
* });
|
|
5605
|
-
*/ | "idle"
|
|
5606
|
-
/**
|
|
5607
|
-
* Fired immediately after the map has been removed with {@link Map.event:remove}.
|
|
6029
|
+
* @param clusterId The value of the cluster's `cluster_id` property.
|
|
6030
|
+
* @param callback A callback to be called when the features are retrieved (`(error, features) => { ... }`).
|
|
6031
|
+
* @returns {GeoJSONSource} this
|
|
6032
|
+
*/
|
|
6033
|
+
getClusterChildren(clusterId: number, callback: Callback<Array<GeoJSON.Feature>>): this;
|
|
6034
|
+
/**
|
|
6035
|
+
* For clustered sources, fetches the original points that belong to the cluster (as an array of GeoJSON features).
|
|
5608
6036
|
*
|
|
5609
|
-
* @
|
|
5610
|
-
* @
|
|
5611
|
-
* @
|
|
6037
|
+
* @param clusterId The value of the cluster's `cluster_id` property.
|
|
6038
|
+
* @param limit The maximum number of features to return.
|
|
6039
|
+
* @param offset The number of features to skip (e.g. for pagination).
|
|
6040
|
+
* @param callback A callback to be called when the features are retrieved (`(error, features) => { ... }`).
|
|
6041
|
+
* @returns {GeoJSONSource} this
|
|
5612
6042
|
* @example
|
|
5613
|
-
* //
|
|
5614
|
-
*
|
|
5615
|
-
*
|
|
5616
|
-
*
|
|
5617
|
-
*
|
|
5618
|
-
* console.log('A remove event occurred.');
|
|
5619
|
-
* });
|
|
5620
|
-
*/ | "remove"
|
|
5621
|
-
/**
|
|
5622
|
-
* Fired when an error occurs. This is GL JS's primary error reporting
|
|
5623
|
-
* mechanism. We use an event instead of `throw` to better accommodate
|
|
5624
|
-
* asyncronous operations. If no listeners are bound to the `error` event, the
|
|
5625
|
-
* error will be printed to the console.
|
|
5626
|
-
*
|
|
5627
|
-
* @event error
|
|
5628
|
-
* @memberof Map
|
|
5629
|
-
* @instance
|
|
5630
|
-
* @property {{error: {message: string}}} data
|
|
5631
|
-
* @example
|
|
5632
|
-
* // Initialize the map
|
|
5633
|
-
* var map = new maplibregl.Map({ // map options });
|
|
5634
|
-
* // Set an event listener that fires
|
|
5635
|
-
* // when an error occurs.
|
|
5636
|
-
* map.on('error', function() {
|
|
5637
|
-
* console.log('A error event occurred.');
|
|
5638
|
-
* });
|
|
5639
|
-
*/ | "error"
|
|
5640
|
-
/**
|
|
5641
|
-
* Fired when any map data loads or changes. See {@link MapDataEvent}
|
|
5642
|
-
* for more information.
|
|
6043
|
+
* // Retrieve cluster leaves on click
|
|
6044
|
+
* map.on('click', 'clusters', function(e) {
|
|
6045
|
+
* var features = map.queryRenderedFeatures(e.point, {
|
|
6046
|
+
* layers: ['clusters']
|
|
6047
|
+
* });
|
|
5643
6048
|
*
|
|
5644
|
-
*
|
|
5645
|
-
*
|
|
5646
|
-
*
|
|
5647
|
-
* @property {MapDataEvent} data
|
|
5648
|
-
* @example
|
|
5649
|
-
* // Initialize the map
|
|
5650
|
-
* var map = new maplibregl.Map({ // map options });
|
|
5651
|
-
* // Set an event listener that fires
|
|
5652
|
-
* // when map data loads or changes.
|
|
5653
|
-
* map.on('data', function() {
|
|
5654
|
-
* console.log('A data event occurred.');
|
|
5655
|
-
* });
|
|
5656
|
-
* @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
|
|
5657
|
-
*/ | "data"
|
|
5658
|
-
/**
|
|
5659
|
-
* Fired when the map's style loads or changes. See
|
|
5660
|
-
* {@link MapDataEvent} for more information.
|
|
6049
|
+
* var clusterId = features[0].properties.cluster_id;
|
|
6050
|
+
* var pointCount = features[0].properties.point_count;
|
|
6051
|
+
* var clusterSource = map.getSource('clusters');
|
|
5661
6052
|
*
|
|
5662
|
-
*
|
|
5663
|
-
*
|
|
5664
|
-
*
|
|
5665
|
-
*
|
|
5666
|
-
* @example
|
|
5667
|
-
* // Initialize the map
|
|
5668
|
-
* var map = new maplibregl.Map({ // map options });
|
|
5669
|
-
* // Set an event listener that fires
|
|
5670
|
-
* // when the map's style loads or changes.
|
|
5671
|
-
* map.on('styledata', function() {
|
|
5672
|
-
* console.log('A styledata event occurred.');
|
|
6053
|
+
* clusterSource.getClusterLeaves(clusterId, pointCount, 0, function(error, features) {
|
|
6054
|
+
* // Print cluster leaves in the console
|
|
6055
|
+
* console.log('Cluster leaves:', error, features);
|
|
6056
|
+
* })
|
|
5673
6057
|
* });
|
|
5674
|
-
*/
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
6058
|
+
*/
|
|
6059
|
+
getClusterLeaves(clusterId: number, limit: number, offset: number, callback: Callback<Array<GeoJSON.Feature>>): this;
|
|
6060
|
+
_updateWorkerData(sourceDataType: MapSourceDataType): void;
|
|
6061
|
+
loaded(): boolean;
|
|
6062
|
+
loadTile(tile: Tile, callback: Callback<void>): void;
|
|
6063
|
+
abortTile(tile: Tile): void;
|
|
6064
|
+
unloadTile(tile: Tile): void;
|
|
6065
|
+
onRemove(): void;
|
|
6066
|
+
serialize(): any;
|
|
6067
|
+
hasTransition(): boolean;
|
|
6068
|
+
}
|
|
6069
|
+
export declare type CanvasSourceSpecification = {
|
|
6070
|
+
"type": "canvas";
|
|
6071
|
+
"coordinates": [
|
|
6072
|
+
[
|
|
6073
|
+
number,
|
|
6074
|
+
number
|
|
6075
|
+
],
|
|
6076
|
+
[
|
|
6077
|
+
number,
|
|
6078
|
+
number
|
|
6079
|
+
],
|
|
6080
|
+
[
|
|
6081
|
+
number,
|
|
6082
|
+
number
|
|
6083
|
+
],
|
|
6084
|
+
[
|
|
6085
|
+
number,
|
|
6086
|
+
number
|
|
6087
|
+
]
|
|
6088
|
+
];
|
|
6089
|
+
"animate"?: boolean;
|
|
6090
|
+
"canvas": string | HTMLCanvasElement;
|
|
6091
|
+
};
|
|
6092
|
+
export declare class CanvasSource extends ImageSource {
|
|
6093
|
+
options: CanvasSourceSpecification;
|
|
6094
|
+
animate: boolean;
|
|
6095
|
+
canvas: HTMLCanvasElement;
|
|
6096
|
+
width: number;
|
|
6097
|
+
height: number;
|
|
6098
|
+
play: () => void;
|
|
6099
|
+
pause: () => void;
|
|
6100
|
+
_playing: boolean;
|
|
6101
|
+
/**
|
|
6102
|
+
* @private
|
|
6103
|
+
*/
|
|
6104
|
+
constructor(id: string, options: CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
|
|
6105
|
+
/**
|
|
6106
|
+
* Enables animation. The image will be copied from the canvas to the map on each frame.
|
|
6107
|
+
* @method play
|
|
5681
6108
|
* @instance
|
|
5682
|
-
* @
|
|
5683
|
-
|
|
5684
|
-
|
|
5685
|
-
*
|
|
5686
|
-
*
|
|
5687
|
-
* // when one of the map's sources loads or changes.
|
|
5688
|
-
* map.on('sourcedata', function() {
|
|
5689
|
-
* console.log('A sourcedata event occurred.');
|
|
5690
|
-
* });
|
|
5691
|
-
*/ | "sourcedata"
|
|
5692
|
-
/**
|
|
5693
|
-
* Fired when any map data (style, source, tile, etc) begins loading or
|
|
5694
|
-
* changing asyncronously. All `dataloading` events are followed by a `data`
|
|
5695
|
-
* or `error` event. See {@link MapDataEvent} for more information.
|
|
5696
|
-
*
|
|
5697
|
-
* @event dataloading
|
|
5698
|
-
* @memberof Map
|
|
6109
|
+
* @memberof CanvasSource
|
|
6110
|
+
*/
|
|
6111
|
+
/**
|
|
6112
|
+
* Disables animation. The map will display a static copy of the canvas image.
|
|
6113
|
+
* @method pause
|
|
5699
6114
|
* @instance
|
|
5700
|
-
* @
|
|
5701
|
-
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
*
|
|
5705
|
-
* // when any map data begins loading
|
|
5706
|
-
* // or changing asynchronously.
|
|
5707
|
-
* map.on('dataloading', function() {
|
|
5708
|
-
* console.log('A dataloading event occurred.');
|
|
5709
|
-
* });
|
|
5710
|
-
*/ | "dataloading"
|
|
5711
|
-
/**
|
|
5712
|
-
* Fired when the map's style begins loading or changing asyncronously.
|
|
5713
|
-
* All `styledataloading` events are followed by a `styledata`
|
|
5714
|
-
* or `error` event. See {@link MapDataEvent} for more information.
|
|
6115
|
+
* @memberof CanvasSource
|
|
6116
|
+
*/
|
|
6117
|
+
load(): void;
|
|
6118
|
+
/**
|
|
6119
|
+
* Returns the HTML `canvas` element.
|
|
5715
6120
|
*
|
|
5716
|
-
* @
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5733
|
-
|
|
6121
|
+
* @returns {HTMLCanvasElement} The HTML `canvas` element.
|
|
6122
|
+
*/
|
|
6123
|
+
getCanvas(): HTMLCanvasElement;
|
|
6124
|
+
onAdd(map: Map): void;
|
|
6125
|
+
onRemove(): void;
|
|
6126
|
+
prepare(): void;
|
|
6127
|
+
serialize(): any;
|
|
6128
|
+
hasTransition(): boolean;
|
|
6129
|
+
_hasInvalidDimensions(): boolean;
|
|
6130
|
+
}
|
|
6131
|
+
export declare type Coordinates = [
|
|
6132
|
+
[
|
|
6133
|
+
number,
|
|
6134
|
+
number
|
|
6135
|
+
],
|
|
6136
|
+
[
|
|
6137
|
+
number,
|
|
6138
|
+
number
|
|
6139
|
+
],
|
|
6140
|
+
[
|
|
6141
|
+
number,
|
|
6142
|
+
number
|
|
6143
|
+
],
|
|
6144
|
+
[
|
|
6145
|
+
number,
|
|
6146
|
+
number
|
|
6147
|
+
]
|
|
6148
|
+
];
|
|
6149
|
+
export declare class ImageSource extends Evented implements Source {
|
|
6150
|
+
type: string;
|
|
6151
|
+
id: string;
|
|
6152
|
+
minzoom: number;
|
|
6153
|
+
maxzoom: number;
|
|
6154
|
+
tileSize: number;
|
|
6155
|
+
url: string;
|
|
6156
|
+
coordinates: Coordinates;
|
|
6157
|
+
tiles: {
|
|
6158
|
+
[_: string]: Tile;
|
|
6159
|
+
};
|
|
6160
|
+
options: any;
|
|
6161
|
+
dispatcher: Dispatcher;
|
|
6162
|
+
map: Map;
|
|
6163
|
+
texture: Texture | null;
|
|
6164
|
+
image: HTMLImageElement | ImageBitmap;
|
|
6165
|
+
tileID: CanonicalTileID;
|
|
6166
|
+
_boundsArray: RasterBoundsArray;
|
|
6167
|
+
boundsBuffer: VertexBuffer;
|
|
6168
|
+
boundsSegments: SegmentVector;
|
|
6169
|
+
_loaded: boolean;
|
|
6170
|
+
/**
|
|
6171
|
+
* @private
|
|
6172
|
+
*/
|
|
6173
|
+
constructor(id: string, options: ImageSourceSpecification | VideoSourceSpecification | CanvasSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
|
|
6174
|
+
load(newCoordinates?: Coordinates, successCallback?: () => void): void;
|
|
6175
|
+
loaded(): boolean;
|
|
6176
|
+
/**
|
|
6177
|
+
* Updates the image URL and, optionally, the coordinates. To avoid having the image flash after changing,
|
|
6178
|
+
* set the `raster-fade-duration` paint property on the raster layer to 0.
|
|
5734
6179
|
*
|
|
5735
|
-
* @
|
|
5736
|
-
* @
|
|
5737
|
-
* @
|
|
5738
|
-
*
|
|
5739
|
-
*
|
|
5740
|
-
*
|
|
5741
|
-
*
|
|
5742
|
-
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
/**
|
|
5750
|
-
*
|
|
5751
|
-
* be added with {@link Map#addImage} within this event listener callback to prevent the image from
|
|
5752
|
-
* being skipped. This event can be used to dynamically generate icons and patterns.
|
|
6180
|
+
* @param {Object} options Options object.
|
|
6181
|
+
* @param {string} [options.url] Required image URL.
|
|
6182
|
+
* @param {Array<Array<number>>} [options.coordinates] Four geographical coordinates,
|
|
6183
|
+
* represented as arrays of longitude and latitude numbers, which define the corners of the image.
|
|
6184
|
+
* The coordinates start at the top left corner of the image and proceed in clockwise order.
|
|
6185
|
+
* They do not have to represent a rectangle.
|
|
6186
|
+
* @returns {ImageSource} this
|
|
6187
|
+
*/
|
|
6188
|
+
updateImage(options: {
|
|
6189
|
+
url: string;
|
|
6190
|
+
coordinates?: Coordinates;
|
|
6191
|
+
}): this;
|
|
6192
|
+
_finishLoading(): void;
|
|
6193
|
+
onAdd(map: Map): void;
|
|
6194
|
+
/**
|
|
6195
|
+
* Sets the image's coordinates and re-renders the map.
|
|
5753
6196
|
*
|
|
5754
|
-
* @
|
|
5755
|
-
*
|
|
5756
|
-
*
|
|
5757
|
-
*
|
|
5758
|
-
* @
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
* @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-missing-generated/)
|
|
5767
|
-
*/ | "styleimagemissing"
|
|
5768
|
-
/**
|
|
5769
|
-
* @event style.load
|
|
5770
|
-
* @memberof Map
|
|
5771
|
-
* @instance
|
|
5772
|
-
* @private
|
|
5773
|
-
*/ | "style.load";
|
|
6197
|
+
* @param {Array<Array<number>>} coordinates Four geographical coordinates,
|
|
6198
|
+
* represented as arrays of longitude and latitude numbers, which define the corners of the image.
|
|
6199
|
+
* The coordinates start at the top left corner of the image and proceed in clockwise order.
|
|
6200
|
+
* They do not have to represent a rectangle.
|
|
6201
|
+
* @returns {ImageSource} this
|
|
6202
|
+
*/
|
|
6203
|
+
setCoordinates(coordinates: Coordinates): this;
|
|
6204
|
+
prepare(): void;
|
|
6205
|
+
loadTile(tile: Tile, callback: Callback<void>): void;
|
|
6206
|
+
serialize(): any;
|
|
6207
|
+
hasTransition(): boolean;
|
|
6208
|
+
}
|
|
5774
6209
|
/**
|
|
5775
6210
|
* The `Source` interface must be implemented by each source type, including "core" types (`vector`, `raster`,
|
|
5776
6211
|
* `video`, etc.) and all custom, third-party types.
|
|
@@ -5818,11 +6253,11 @@ export interface Source {
|
|
|
5818
6253
|
readonly abortTile?: (tile: Tile, callback: Callback<void>) => void;
|
|
5819
6254
|
readonly unloadTile?: (tile: Tile, callback: Callback<void>) => void;
|
|
5820
6255
|
/**
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5825
|
-
|
|
6256
|
+
* @returns A plain (stringifiable) JS object representing the current state of the source.
|
|
6257
|
+
* Creating a source using the returned object as the `options` should result in a Source that is
|
|
6258
|
+
* equivalent to this one.
|
|
6259
|
+
* @private
|
|
6260
|
+
*/
|
|
5826
6261
|
serialize(): any;
|
|
5827
6262
|
readonly prepare?: () => void;
|
|
5828
6263
|
}
|
|
@@ -6089,6 +6524,19 @@ export declare class SourceCache extends Evented {
|
|
|
6089
6524
|
*/
|
|
6090
6525
|
reloadTilesForDependencies(namespaces: Array<string>, keys: Array<string>): void;
|
|
6091
6526
|
}
|
|
6527
|
+
declare const status: {
|
|
6528
|
+
unavailable: string;
|
|
6529
|
+
deferred: string;
|
|
6530
|
+
loading: string;
|
|
6531
|
+
loaded: string;
|
|
6532
|
+
error: string;
|
|
6533
|
+
};
|
|
6534
|
+
export declare type PluginState = {
|
|
6535
|
+
pluginStatus: typeof status[keyof typeof status];
|
|
6536
|
+
pluginURL: string;
|
|
6537
|
+
};
|
|
6538
|
+
export declare type PluginStateSyncCallback = (state: PluginState) => void;
|
|
6539
|
+
declare const registerForPluginStateChange: (callback: PluginStateSyncCallback) => PluginStateSyncCallback;
|
|
6092
6540
|
export declare type QueryResult<T> = {
|
|
6093
6541
|
key: T;
|
|
6094
6542
|
x1: number;
|
|
@@ -6504,10 +6952,10 @@ export declare class Style extends Evented {
|
|
|
6504
6952
|
*/
|
|
6505
6953
|
removeSource(id: string): this;
|
|
6506
6954
|
/**
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6955
|
+
* Set the data of a GeoJSON source, given its id.
|
|
6956
|
+
* @param {string} id id of the source
|
|
6957
|
+
* @param {GeoJSON|string} data GeoJSON source
|
|
6958
|
+
*/
|
|
6511
6959
|
setGeoJSONSourceData(id: string, data: GeoJSON.GeoJSON | string): void;
|
|
6512
6960
|
/**
|
|
6513
6961
|
* Get a source by id.
|
|
@@ -6527,7 +6975,7 @@ export declare class Style extends Evented {
|
|
|
6527
6975
|
/**
|
|
6528
6976
|
* Moves a layer to a different z-position. The layer will be inserted before the layer with
|
|
6529
6977
|
* ID `before`, or appended if `before` is omitted.
|
|
6530
|
-
* @param {string} id
|
|
6978
|
+
* @param {string} id ID of the layer to move
|
|
6531
6979
|
* @param {string} [before] ID of an existing layer to insert before
|
|
6532
6980
|
*/
|
|
6533
6981
|
moveLayer(id: string, before?: string): void;
|
|
@@ -7674,12 +8122,12 @@ export declare class ScrollZoomHandler {
|
|
|
7674
8122
|
*/
|
|
7675
8123
|
setZoomRate(zoomRate: number): void;
|
|
7676
8124
|
/**
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
8125
|
+
* Set the zoom rate of a mouse wheel
|
|
8126
|
+
* @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
|
|
8127
|
+
* @example
|
|
8128
|
+
* // Slow down zoom of mouse wheel
|
|
8129
|
+
* map.scrollZoom.setWheelZoomRate(1/600);
|
|
8130
|
+
*/
|
|
7683
8131
|
setWheelZoomRate(wheelZoomRate: number): void;
|
|
7684
8132
|
/**
|
|
7685
8133
|
* Returns a Boolean indicating whether the "scroll to zoom" interaction is enabled.
|
|
@@ -8692,6 +9140,8 @@ export declare class Map extends Camera {
|
|
|
8692
9140
|
* | [`styledataloading`](#map.event:styledataloading) | |
|
|
8693
9141
|
* | [`sourcedataloading`](#map.event:sourcedataloading) | |
|
|
8694
9142
|
* | [`styleimagemissing`](#map.event:styleimagemissing) | |
|
|
9143
|
+
* | [`dataabort`](#map.event:dataabort) | |
|
|
9144
|
+
* | [`sourcedataabort`](#map.event:sourcedataabort) | |
|
|
8695
9145
|
*
|
|
8696
9146
|
* @param {string | Listener} layerIdOrListener The ID of a style layer or a listener if no ID is provided. Event will only be triggered if its location
|
|
8697
9147
|
* is within a visible feature in this layer. The event will have a `features` property containing
|
|
@@ -8945,10 +9395,10 @@ export declare class Map extends Camera {
|
|
|
8945
9395
|
/**
|
|
8946
9396
|
* Updates the requestManager's transform request with a new function
|
|
8947
9397
|
*
|
|
8948
|
-
*
|
|
9398
|
+
* @param transformRequest A callback run before the Map makes a request for an external URL. The callback can be used to modify the url, set headers, or set the credentials property for cross-origin requests.
|
|
8949
9399
|
* Expected to return an object with a `url` property and optionally `headers` and `credentials` properties
|
|
8950
9400
|
*
|
|
8951
|
-
*
|
|
9401
|
+
* @returns {Map} `this`
|
|
8952
9402
|
*
|
|
8953
9403
|
* @example
|
|
8954
9404
|
* map.setTransformRequest((url: string, resourceType: string) => {});
|
|
@@ -9089,9 +9539,9 @@ export declare class Map extends Camera {
|
|
|
9089
9539
|
* @param options Options object.
|
|
9090
9540
|
* @param options.pixelRatio The ratio of pixels in the image to physical pixels on the screen
|
|
9091
9541
|
* @param options.sdf Whether the image should be interpreted as an SDF image
|
|
9092
|
-
* @param options.content
|
|
9093
|
-
* @param options.stretchX
|
|
9094
|
-
* @param options.stretchY
|
|
9542
|
+
* @param options.content `[x1, y1, x2, y2]` If `icon-text-fit` is used in a layer with this image, this option defines the part of the image that can be covered by the content in `text-field`.
|
|
9543
|
+
* @param options.stretchX `[[x1, x2], ...]` If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched horizontally.
|
|
9544
|
+
* @param options.stretchY `[[y1, y2], ...]` If `icon-text-fit` is used in a layer with this image, this option defines the part(s) of the image that can be stretched vertically.
|
|
9095
9545
|
*
|
|
9096
9546
|
* @example
|
|
9097
9547
|
* // If the style's sprite does not already contain an image with ID 'cat',
|
|
@@ -9153,7 +9603,7 @@ export declare class Map extends Camera {
|
|
|
9153
9603
|
*
|
|
9154
9604
|
* @param id The ID of the image.
|
|
9155
9605
|
*
|
|
9156
|
-
* @returns {boolean}
|
|
9606
|
+
* @returns {boolean} A Boolean indicating whether the image exists.
|
|
9157
9607
|
* @example
|
|
9158
9608
|
* // Check if an image with the ID 'cat' exists in
|
|
9159
9609
|
* // the style's sprite.
|
|
@@ -9192,16 +9642,16 @@ export declare class Map extends Camera {
|
|
|
9192
9642
|
*/
|
|
9193
9643
|
loadImage(url: string, callback: Callback<HTMLImageElement | ImageBitmap>): void;
|
|
9194
9644
|
/**
|
|
9195
|
-
|
|
9196
|
-
|
|
9197
|
-
|
|
9198
|
-
|
|
9199
|
-
|
|
9200
|
-
|
|
9201
|
-
|
|
9202
|
-
|
|
9203
|
-
|
|
9204
|
-
|
|
9645
|
+
* Returns an Array of strings containing the IDs of all images currently available in the map.
|
|
9646
|
+
* This includes both images from the style's original sprite
|
|
9647
|
+
* and any images that have been added at runtime using {@link Map#addImage}.
|
|
9648
|
+
*
|
|
9649
|
+
* @returns {Array<string>} An Array of strings containing the names of all sprites/images currently available in the map.
|
|
9650
|
+
*
|
|
9651
|
+
* @example
|
|
9652
|
+
* var allImages = map.listImages();
|
|
9653
|
+
*
|
|
9654
|
+
*/
|
|
9205
9655
|
listImages(): string[];
|
|
9206
9656
|
/**
|
|
9207
9657
|
* Adds a [MapLibre style layer](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layers)
|
|
@@ -9560,7 +10010,7 @@ export declare class Map extends Camera {
|
|
|
9560
10010
|
* }, 'hover');
|
|
9561
10011
|
* });
|
|
9562
10012
|
*
|
|
9563
|
-
|
|
10013
|
+
*/
|
|
9564
10014
|
removeFeatureState(target: {
|
|
9565
10015
|
source: string;
|
|
9566
10016
|
sourceLayer?: string;
|
|
@@ -9676,11 +10126,11 @@ export declare class Map extends Camera {
|
|
|
9676
10126
|
*/
|
|
9677
10127
|
_render(paintStartTimeStamp: number): this;
|
|
9678
10128
|
/**
|
|
9679
|
-
|
|
9680
|
-
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
10129
|
+
* Force a synchronous redraw of the map.
|
|
10130
|
+
* @example
|
|
10131
|
+
* map.redraw();
|
|
10132
|
+
* @returns {Map} `this`
|
|
10133
|
+
*/
|
|
9684
10134
|
redraw(): Map;
|
|
9685
10135
|
/**
|
|
9686
10136
|
* Clean up and release all internal resources associated with this map.
|
|
@@ -10072,26 +10522,26 @@ export declare class Marker extends Evented {
|
|
|
10072
10522
|
* the marker on screen.
|
|
10073
10523
|
*
|
|
10074
10524
|
* @returns {LngLat} A {@link LngLat} describing the marker's location.
|
|
10075
|
-
|
|
10076
|
-
|
|
10077
|
-
|
|
10078
|
-
|
|
10079
|
-
|
|
10080
|
-
|
|
10081
|
-
|
|
10525
|
+
* @example
|
|
10526
|
+
* // Store the marker's longitude and latitude coordinates in a variable
|
|
10527
|
+
* var lngLat = marker.getLngLat();
|
|
10528
|
+
* // Print the marker's longitude and latitude values in the console
|
|
10529
|
+
* console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )
|
|
10530
|
+
* @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
|
|
10531
|
+
*/
|
|
10082
10532
|
getLngLat(): LngLat;
|
|
10083
10533
|
/**
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10534
|
+
* Set the marker's geographical position and move it.
|
|
10535
|
+
* @param {LngLat} lnglat A {@link LngLat} describing where the marker should be located.
|
|
10536
|
+
* @returns {Marker} `this`
|
|
10537
|
+
* @example
|
|
10538
|
+
* // Create a new marker, set the longitude and latitude, and add it to the map
|
|
10539
|
+
* new maplibregl.Marker()
|
|
10540
|
+
* .setLngLat([-65.017, -16.457])
|
|
10541
|
+
* .addTo(map);
|
|
10542
|
+
* @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js-docs/example/custom-marker-icons/)
|
|
10543
|
+
* @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
|
|
10544
|
+
*/
|
|
10095
10545
|
setLngLat(lnglat: LngLatLike): this;
|
|
10096
10546
|
/**
|
|
10097
10547
|
* Returns the `Marker`'s HTML element.
|
|
@@ -10260,23 +10710,23 @@ export declare class GeolocateControl extends Evented implements IControl {
|
|
|
10260
10710
|
_finish(): void;
|
|
10261
10711
|
_setupUI(supported: boolean): void;
|
|
10262
10712
|
/**
|
|
10263
|
-
|
|
10264
|
-
|
|
10265
|
-
|
|
10266
|
-
|
|
10267
|
-
|
|
10268
|
-
|
|
10269
|
-
|
|
10270
|
-
|
|
10271
|
-
|
|
10272
|
-
|
|
10273
|
-
|
|
10274
|
-
|
|
10275
|
-
|
|
10276
|
-
|
|
10277
|
-
|
|
10278
|
-
|
|
10279
|
-
|
|
10713
|
+
* Programmatically request and move the map to the user's location.
|
|
10714
|
+
*
|
|
10715
|
+
* @returns {boolean} Returns `false` if called before control was added to a map, otherwise returns `true`.
|
|
10716
|
+
* @example
|
|
10717
|
+
* // Initialize the geolocate control.
|
|
10718
|
+
* var geolocate = new maplibregl.GeolocateControl({
|
|
10719
|
+
* positionOptions: {
|
|
10720
|
+
* enableHighAccuracy: true
|
|
10721
|
+
* },
|
|
10722
|
+
* trackUserLocation: true
|
|
10723
|
+
* });
|
|
10724
|
+
* // Add the control to the map.
|
|
10725
|
+
* map.addControl(geolocate);
|
|
10726
|
+
* map.on('load', function() {
|
|
10727
|
+
* geolocate.trigger();
|
|
10728
|
+
* });
|
|
10729
|
+
*/
|
|
10280
10730
|
trigger(): boolean;
|
|
10281
10731
|
_clearWatch(): void;
|
|
10282
10732
|
}
|
|
@@ -10287,6 +10737,7 @@ export declare type AttributionOptions = {
|
|
|
10287
10737
|
export declare class AttributionControl implements IControl {
|
|
10288
10738
|
options: AttributionOptions;
|
|
10289
10739
|
_map: Map;
|
|
10740
|
+
_compact: boolean;
|
|
10290
10741
|
_container: HTMLElement;
|
|
10291
10742
|
_innerContainer: HTMLElement;
|
|
10292
10743
|
_compactButton: HTMLElement;
|
|
@@ -10303,6 +10754,7 @@ export declare class AttributionControl implements IControl {
|
|
|
10303
10754
|
_updateData(e: any): void;
|
|
10304
10755
|
_updateAttributions(): void;
|
|
10305
10756
|
_updateCompact(): void;
|
|
10757
|
+
_updateCompactMinimize(): void;
|
|
10306
10758
|
}
|
|
10307
10759
|
export declare type Unit = "imperial" | "metric" | "nautical";
|
|
10308
10760
|
export declare type ScaleOptions = {
|
|
@@ -10348,6 +10800,72 @@ export declare class FullscreenControl implements IControl {
|
|
|
10348
10800
|
}
|
|
10349
10801
|
declare function prewarm(): void;
|
|
10350
10802
|
declare function clearPrewarmedResources(): void;
|
|
10803
|
+
export declare class RasterDEMTileSource extends RasterTileSource implements Source {
|
|
10804
|
+
encoding: "mapbox" | "terrarium";
|
|
10805
|
+
constructor(id: string, options: RasterDEMSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
|
|
10806
|
+
serialize(): {
|
|
10807
|
+
type: string;
|
|
10808
|
+
url: string;
|
|
10809
|
+
tileSize: number;
|
|
10810
|
+
tiles: string[];
|
|
10811
|
+
bounds: [
|
|
10812
|
+
number,
|
|
10813
|
+
number,
|
|
10814
|
+
number,
|
|
10815
|
+
number
|
|
10816
|
+
];
|
|
10817
|
+
encoding: "mapbox" | "terrarium";
|
|
10818
|
+
};
|
|
10819
|
+
loadTile(tile: Tile, callback: Callback<void>): void;
|
|
10820
|
+
_getNeighboringTiles(tileID: OverscaledTileID): {};
|
|
10821
|
+
unloadTile(tile: Tile): void;
|
|
10822
|
+
}
|
|
10823
|
+
export declare class VideoSource extends ImageSource {
|
|
10824
|
+
options: VideoSourceSpecification;
|
|
10825
|
+
urls: Array<string>;
|
|
10826
|
+
video: HTMLVideoElement;
|
|
10827
|
+
roundZoom: boolean;
|
|
10828
|
+
/**
|
|
10829
|
+
* @private
|
|
10830
|
+
*/
|
|
10831
|
+
constructor(id: string, options: VideoSourceSpecification, dispatcher: Dispatcher, eventedParent: Evented);
|
|
10832
|
+
load(): void;
|
|
10833
|
+
/**
|
|
10834
|
+
* Pauses the video.
|
|
10835
|
+
*/
|
|
10836
|
+
pause(): void;
|
|
10837
|
+
/**
|
|
10838
|
+
* Plays the video.
|
|
10839
|
+
*/
|
|
10840
|
+
play(): void;
|
|
10841
|
+
/**
|
|
10842
|
+
* Sets playback to a timestamp, in seconds.
|
|
10843
|
+
* @private
|
|
10844
|
+
*/
|
|
10845
|
+
seek(seconds: number): void;
|
|
10846
|
+
/**
|
|
10847
|
+
* Returns the HTML `video` element.
|
|
10848
|
+
*
|
|
10849
|
+
* @returns {HTMLVideoElement} The HTML `video` element.
|
|
10850
|
+
*/
|
|
10851
|
+
getVideo(): HTMLVideoElement;
|
|
10852
|
+
onAdd(map: Map): void;
|
|
10853
|
+
/**
|
|
10854
|
+
* Sets the video's coordinates and re-renders the map.
|
|
10855
|
+
*
|
|
10856
|
+
* @method setCoordinates
|
|
10857
|
+
* @instance
|
|
10858
|
+
* @memberof VideoSource
|
|
10859
|
+
* @returns {VideoSource} this
|
|
10860
|
+
*/
|
|
10861
|
+
prepare(): void;
|
|
10862
|
+
serialize(): {
|
|
10863
|
+
type: string;
|
|
10864
|
+
urls: string[];
|
|
10865
|
+
coordinates: Coordinates;
|
|
10866
|
+
};
|
|
10867
|
+
hasTransition(): boolean;
|
|
10868
|
+
}
|
|
10351
10869
|
declare const exported: {
|
|
10352
10870
|
supported: import("@mapbox/mapbox-gl-supported").IsSupported;
|
|
10353
10871
|
setRTLTextPlugin: (url: string, callback: (error?: Error) => void, deferred?: boolean) => void;
|
|
@@ -10366,12 +10884,20 @@ declare const exported: {
|
|
|
10366
10884
|
Point: typeof Point;
|
|
10367
10885
|
MercatorCoordinate: typeof MercatorCoordinate;
|
|
10368
10886
|
Evented: typeof Evented;
|
|
10887
|
+
AJAXError: typeof AJAXError;
|
|
10369
10888
|
config: {
|
|
10370
10889
|
MAX_PARALLEL_IMAGE_REQUESTS: number;
|
|
10371
10890
|
REGISTERED_PROTOCOLS: {
|
|
10372
10891
|
[x: string]: any;
|
|
10373
10892
|
};
|
|
10374
10893
|
};
|
|
10894
|
+
CanvasSource: typeof CanvasSource;
|
|
10895
|
+
GeoJSONSource: typeof GeoJSONSource;
|
|
10896
|
+
ImageSource: typeof ImageSource;
|
|
10897
|
+
RasterDEMTileSource: typeof RasterDEMTileSource;
|
|
10898
|
+
RasterTileSource: typeof RasterTileSource;
|
|
10899
|
+
VectorTileSource: typeof VectorTileSource;
|
|
10900
|
+
VideoSource: typeof VideoSource;
|
|
10375
10901
|
/**
|
|
10376
10902
|
* Initializes resources like WebWorkers that can be shared across maps to lower load
|
|
10377
10903
|
* times in some situations. `maplibregl.workerUrl` and `maplibregl.workerCount`, if being
|
|
@@ -10519,14 +11045,14 @@ declare const exported: {
|
|
|
10519
11045
|
* @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js-docs/example/mapbox-gl-rtl-text/)
|
|
10520
11046
|
*/
|
|
10521
11047
|
/**
|
|
10522
|
-
|
|
10523
|
-
|
|
10524
|
-
|
|
10525
|
-
|
|
10526
|
-
|
|
10527
|
-
|
|
10528
|
-
|
|
10529
|
-
|
|
11048
|
+
* Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.
|
|
11049
|
+
* The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.
|
|
11050
|
+
* If the status is `loaded` and the plugin is requested again, an error will be thrown.
|
|
11051
|
+
*
|
|
11052
|
+
* @function getRTLTextPluginStatus
|
|
11053
|
+
* @example
|
|
11054
|
+
* const pluginStatus = maplibregl.getRTLTextPluginStatus();
|
|
11055
|
+
*/
|
|
10530
11056
|
export default exported;
|
|
10531
11057
|
|
|
10532
11058
|
export as namespace maplibregl;
|