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.
Files changed (305) hide show
  1. package/build/{banner.js → banner.ts} +1 -1
  2. package/build/generate-query-test-fixtures.ts +123 -0
  3. package/build/generate-shaders.ts +35 -0
  4. package/build/generate-struct-arrays.ts +7 -7
  5. package/build/generate-style-code.ts +8 -8
  6. package/build/generate-style-spec.ts +5 -4
  7. package/build/generate-typings.ts +16 -0
  8. package/build/readme.md +8 -18
  9. package/build/release-notes.js +9 -13
  10. package/build/{rollup_plugin_minify_style_spec.js → rollup_plugin_minify_style_spec.ts} +4 -3
  11. package/build/{rollup_plugins.js → rollup_plugins.ts} +11 -26
  12. package/dist/maplibre-gl-dev.js +522 -226
  13. package/dist/maplibre-gl.css +1 -1
  14. package/dist/maplibre-gl.d.ts +1536 -1010
  15. package/dist/maplibre-gl.js +3 -3
  16. package/dist/maplibre-gl.js.map +1 -1
  17. package/package.json +40 -61
  18. package/src/data/{array_types.ts → array_types.g.ts} +0 -0
  19. package/src/data/bucket/circle_bucket.ts +1 -1
  20. package/src/data/bucket/fill_bucket.test.ts +1 -1
  21. package/src/data/bucket/fill_bucket.ts +4 -4
  22. package/src/data/bucket/fill_extrusion_bucket.ts +1 -1
  23. package/src/data/bucket/line_bucket.test.ts +1 -1
  24. package/src/data/bucket/line_bucket.ts +6 -6
  25. package/src/data/bucket/symbol_bucket.test.ts +16 -16
  26. package/src/data/bucket/symbol_bucket.ts +53 -53
  27. package/src/data/bucket.ts +43 -43
  28. package/src/data/dem_data.ts +12 -12
  29. package/src/data/evaluation_feature.ts +10 -10
  30. package/src/data/feature_index.ts +37 -37
  31. package/src/data/feature_position_map.ts +5 -5
  32. package/src/data/index_array_type.ts +1 -1
  33. package/src/data/load_geometry.test.ts +1 -1
  34. package/src/data/program_configuration.ts +46 -46
  35. package/src/data/segment.ts +14 -14
  36. package/src/geo/edge_insets.ts +2 -2
  37. package/src/geo/lng_lat.ts +4 -4
  38. package/src/geo/lng_lat_bounds.ts +35 -35
  39. package/src/geo/mercator_coordinate.ts +5 -5
  40. package/src/geo/transform.test.ts +1 -1
  41. package/src/geo/transform.ts +14 -14
  42. package/src/gl/context.ts +3 -3
  43. package/src/gl/types.ts +19 -19
  44. package/src/gl/value.ts +6 -6
  45. package/src/gl/vertex_buffer.test.ts +1 -1
  46. package/src/index.ts +24 -9
  47. package/src/render/draw_circle.ts +8 -8
  48. package/src/render/draw_collision_debug.ts +5 -5
  49. package/src/render/draw_line.ts +4 -4
  50. package/src/render/draw_symbol.ts +21 -21
  51. package/src/render/glyph_atlas.ts +12 -12
  52. package/src/render/glyph_manager.test.ts +10 -21
  53. package/src/render/glyph_manager.ts +33 -32
  54. package/src/render/image_manager.ts +4 -4
  55. package/src/render/painter.ts +11 -11
  56. package/src/render/program/background_program.ts +29 -29
  57. package/src/render/program/circle_program.ts +10 -10
  58. package/src/render/program/clipping_mask_program.ts +1 -1
  59. package/src/render/program/collision_program.ts +9 -9
  60. package/src/render/program/debug_program.ts +4 -4
  61. package/src/render/program/fill_extrusion_program.ts +31 -31
  62. package/src/render/program/fill_program.ts +29 -29
  63. package/src/render/program/heatmap_program.ts +12 -12
  64. package/src/render/program/hillshade_program.ts +12 -12
  65. package/src/render/program/line_program.ts +38 -38
  66. package/src/render/program/pattern.ts +28 -28
  67. package/src/render/program/raster_program.ts +21 -21
  68. package/src/render/program/symbol_program.ts +96 -96
  69. package/src/render/program.ts +25 -25
  70. package/src/render/texture.ts +9 -9
  71. package/src/render/uniform_binding.ts +1 -1
  72. package/src/render/vertex_array_object.ts +13 -13
  73. package/src/shaders/_prelude.fragment.glsl.g.ts +2 -0
  74. package/src/shaders/_prelude.vertex.glsl.g.ts +2 -0
  75. package/src/shaders/background.fragment.glsl.g.ts +2 -0
  76. package/src/shaders/background.vertex.glsl.g.ts +2 -0
  77. package/src/shaders/background_pattern.fragment.glsl.g.ts +2 -0
  78. package/src/shaders/background_pattern.vertex.glsl.g.ts +2 -0
  79. package/src/shaders/circle.fragment.glsl.g.ts +2 -0
  80. package/src/shaders/circle.vertex.glsl.g.ts +2 -0
  81. package/src/shaders/clipping_mask.fragment.glsl.g.ts +2 -0
  82. package/src/shaders/clipping_mask.vertex.glsl.g.ts +2 -0
  83. package/src/shaders/collision_box.fragment.glsl.g.ts +2 -0
  84. package/src/shaders/collision_box.vertex.glsl.g.ts +2 -0
  85. package/src/shaders/collision_circle.fragment.glsl.g.ts +2 -0
  86. package/src/shaders/collision_circle.vertex.glsl.g.ts +2 -0
  87. package/src/shaders/debug.fragment.glsl.g.ts +2 -0
  88. package/src/shaders/debug.vertex.glsl.g.ts +2 -0
  89. package/src/shaders/fill.fragment.glsl.g.ts +2 -0
  90. package/src/shaders/fill.vertex.glsl.g.ts +2 -0
  91. package/src/shaders/fill_extrusion.fragment.glsl.g.ts +2 -0
  92. package/src/shaders/fill_extrusion.vertex.glsl.g.ts +2 -0
  93. package/src/shaders/fill_extrusion_pattern.fragment.glsl.g.ts +2 -0
  94. package/src/shaders/fill_extrusion_pattern.vertex.glsl.g.ts +2 -0
  95. package/src/shaders/fill_outline.fragment.glsl.g.ts +2 -0
  96. package/src/shaders/fill_outline.vertex.glsl.g.ts +2 -0
  97. package/src/shaders/fill_outline_pattern.fragment.glsl.g.ts +2 -0
  98. package/src/shaders/fill_outline_pattern.vertex.glsl.g.ts +2 -0
  99. package/src/shaders/fill_pattern.fragment.glsl.g.ts +2 -0
  100. package/src/shaders/fill_pattern.vertex.glsl.g.ts +2 -0
  101. package/src/shaders/heatmap.fragment.glsl.g.ts +2 -0
  102. package/src/shaders/heatmap.vertex.glsl.g.ts +2 -0
  103. package/src/shaders/heatmap_texture.fragment.glsl.g.ts +2 -0
  104. package/src/shaders/heatmap_texture.vertex.glsl.g.ts +2 -0
  105. package/src/shaders/hillshade.fragment.glsl.g.ts +2 -0
  106. package/src/shaders/hillshade.vertex.glsl.g.ts +2 -0
  107. package/src/shaders/hillshade_prepare.fragment.glsl.g.ts +2 -0
  108. package/src/shaders/hillshade_prepare.vertex.glsl.g.ts +2 -0
  109. package/src/shaders/line.fragment.glsl.g.ts +2 -0
  110. package/src/shaders/line.vertex.glsl.g.ts +2 -0
  111. package/src/shaders/line_gradient.fragment.glsl.g.ts +2 -0
  112. package/src/shaders/line_gradient.vertex.glsl.g.ts +2 -0
  113. package/src/shaders/line_pattern.fragment.glsl.g.ts +2 -0
  114. package/src/shaders/line_pattern.vertex.glsl.g.ts +2 -0
  115. package/src/shaders/line_sdf.fragment.glsl.g.ts +2 -0
  116. package/src/shaders/line_sdf.vertex.glsl.g.ts +2 -0
  117. package/src/shaders/raster.fragment.glsl.g.ts +2 -0
  118. package/src/shaders/raster.vertex.glsl.g.ts +2 -0
  119. package/src/shaders/shaders.ts +52 -55
  120. package/src/shaders/symbol_icon.fragment.glsl.g.ts +2 -0
  121. package/src/shaders/symbol_icon.vertex.glsl.g.ts +2 -0
  122. package/src/shaders/symbol_sdf.fragment.glsl.g.ts +2 -0
  123. package/src/shaders/symbol_sdf.vertex.glsl.g.ts +2 -0
  124. package/src/shaders/symbol_text_and_icon.fragment.glsl.g.ts +2 -0
  125. package/src/shaders/symbol_text_and_icon.vertex.glsl.g.ts +2 -0
  126. package/src/source/canvas_source.test.ts +11 -12
  127. package/src/source/canvas_source.ts +4 -4
  128. package/src/source/geojson_worker_source.ts +23 -23
  129. package/src/source/geojson_wrapper.ts +8 -8
  130. package/src/source/image_source.test.ts +2 -2
  131. package/src/source/image_source.ts +6 -6
  132. package/src/source/pixels_to_tile_units.ts +6 -6
  133. package/src/source/query_features.ts +20 -20
  134. package/src/source/raster_dem_tile_source.test.ts +2 -2
  135. package/src/source/raster_tile_source.test.ts +2 -2
  136. package/src/source/rtl_text_plugin.ts +10 -10
  137. package/src/source/source.ts +29 -29
  138. package/src/source/source_cache.test.ts +32 -0
  139. package/src/source/source_cache.ts +7 -5
  140. package/src/source/source_state.ts +1 -1
  141. package/src/source/tile.test.ts +3 -3
  142. package/src/source/tile.ts +15 -15
  143. package/src/source/tile_cache.ts +6 -6
  144. package/src/source/tile_id.test.ts +0 -1
  145. package/src/source/vector_tile_source.test.ts +3 -3
  146. package/src/source/vector_tile_source.ts +1 -1
  147. package/src/source/vector_tile_worker_source.test.ts +4 -4
  148. package/src/source/vector_tile_worker_source.ts +5 -5
  149. package/src/source/worker.test.ts +1 -1
  150. package/src/source/worker.ts +22 -22
  151. package/src/source/worker_source.ts +56 -56
  152. package/src/source/worker_tile.ts +4 -4
  153. package/src/style/evaluation_parameters.ts +3 -3
  154. package/src/style/format_section_override.test.ts +1 -1
  155. package/src/style/light.ts +10 -10
  156. package/src/style/load_glyph_range.test.ts +3 -3
  157. package/src/style/load_glyph_range.ts +6 -6
  158. package/src/style/load_sprite.ts +4 -4
  159. package/src/style/pauseable_placement.ts +1 -1
  160. package/src/style/properties.ts +69 -69
  161. package/src/style/query_utils.ts +7 -7
  162. package/src/style/style.test.ts +2 -2
  163. package/src/style/style.ts +29 -29
  164. package/src/style/style_glyph.ts +8 -8
  165. package/src/style/style_image.ts +58 -58
  166. package/src/style/style_layer/background_style_layer.ts +2 -2
  167. package/src/style/style_layer/{background_style_layer_properties.ts → background_style_layer_properties.g.ts} +0 -0
  168. package/src/style/style_layer/circle_style_layer.ts +10 -10
  169. package/src/style/style_layer/{circle_style_layer_properties.ts → circle_style_layer_properties.g.ts} +0 -0
  170. package/src/style/style_layer/custom_style_layer.ts +17 -17
  171. package/src/style/style_layer/fill_extrusion_style_layer.ts +10 -10
  172. package/src/style/style_layer/{fill_extrusion_style_layer_properties.ts → fill_extrusion_style_layer_properties.g.ts} +0 -0
  173. package/src/style/style_layer/fill_style_layer.ts +9 -9
  174. package/src/style/style_layer/{fill_style_layer_properties.ts → fill_style_layer_properties.g.ts} +0 -0
  175. package/src/style/style_layer/heatmap_style_layer.ts +2 -2
  176. package/src/style/style_layer/{heatmap_style_layer_properties.ts → heatmap_style_layer_properties.g.ts} +0 -0
  177. package/src/style/style_layer/hillshade_style_layer.ts +2 -2
  178. package/src/style/style_layer/{hillshade_style_layer_properties.ts → hillshade_style_layer_properties.g.ts} +0 -0
  179. package/src/style/style_layer/line_style_layer.ts +9 -9
  180. package/src/style/style_layer/{line_style_layer_properties.ts → line_style_layer_properties.g.ts} +0 -0
  181. package/src/style/style_layer/raster_style_layer.ts +2 -2
  182. package/src/style/style_layer/{raster_style_layer_properties.ts → raster_style_layer_properties.g.ts} +0 -0
  183. package/src/style/style_layer/symbol_style_layer.ts +7 -7
  184. package/src/style/style_layer/{symbol_style_layer_properties.ts → symbol_style_layer_properties.g.ts} +0 -0
  185. package/src/style/style_layer.ts +10 -10
  186. package/src/style/style_layer_index.ts +3 -3
  187. package/src/style/validate_style.ts +15 -15
  188. package/src/style-spec/error/validation_error.ts +1 -1
  189. package/src/style-spec/expression/compound_expression.ts +3 -3
  190. package/src/style-spec/expression/definitions/format.ts +11 -11
  191. package/src/style-spec/expression/definitions/interpolate.ts +5 -5
  192. package/src/style-spec/expression/definitions/match.ts +2 -2
  193. package/src/style-spec/expression/definitions/number_format.ts +11 -11
  194. package/src/style-spec/expression/expression.ts +8 -8
  195. package/src/style-spec/expression/index.ts +97 -97
  196. package/src/style-spec/expression/parsing_context.ts +11 -11
  197. package/src/style-spec/expression/types/collator.ts +9 -9
  198. package/src/style-spec/expression/types/resolved_image.ts +2 -2
  199. package/src/style-spec/expression/types.ts +14 -14
  200. package/src/style-spec/expression/values.ts +1 -1
  201. package/src/style-spec/feature_filter/index.ts +66 -66
  202. package/src/style-spec/function/convert.ts +3 -3
  203. package/src/style-spec/style-spec.ts +44 -44
  204. package/src/style-spec/util/color_spaces.ts +8 -8
  205. package/src/style-spec/util/result.ts +4 -4
  206. package/src/style-spec/validate/validate_filter.ts +58 -58
  207. package/src/style-spec/validate/validate_source.ts +63 -63
  208. package/src/style-spec/visit.ts +11 -11
  209. package/src/symbol/collision_feature.test.ts +1 -1
  210. package/src/symbol/collision_feature.ts +10 -10
  211. package/src/symbol/collision_index.ts +26 -26
  212. package/src/symbol/cross_tile_symbol_index.ts +17 -17
  213. package/src/symbol/get_anchors.ts +16 -16
  214. package/src/symbol/grid_index.ts +7 -7
  215. package/src/symbol/placement.ts +72 -72
  216. package/src/symbol/projection.ts +30 -30
  217. package/src/symbol/quads.ts +30 -30
  218. package/src/symbol/shaping.ts +160 -160
  219. package/src/symbol/symbol_layout.ts +119 -119
  220. package/src/symbol/symbol_size.ts +29 -29
  221. package/src/symbol/symbol_style_layer.test.ts +1 -1
  222. package/src/types/cancelable.ts +1 -1
  223. package/src/types/tilejson.ts +13 -13
  224. package/src/ui/anchor.ts +1 -1
  225. package/src/ui/camera.test.ts +5 -5
  226. package/src/ui/camera.ts +18 -18
  227. package/src/ui/control/attribution_control.test.ts +51 -16
  228. package/src/ui/control/attribution_control.ts +35 -16
  229. package/src/ui/control/control.ts +40 -40
  230. package/src/ui/control/fullscreen_control.ts +1 -1
  231. package/src/ui/control/geolocate_control.test.ts +1 -1
  232. package/src/ui/control/geolocate_control.ts +102 -102
  233. package/src/ui/control/logo_control.test.ts +4 -4
  234. package/src/ui/control/navigation_control.ts +3 -3
  235. package/src/ui/control/scale_control.test.ts +2 -2
  236. package/src/ui/control/scale_control.ts +5 -5
  237. package/src/ui/events.ts +289 -200
  238. package/src/ui/handler/box_zoom.test.ts +1 -1
  239. package/src/ui/handler/box_zoom.ts +1 -1
  240. package/src/ui/handler/dblclick_zoom.test.ts +1 -1
  241. package/src/ui/handler/drag_pan.test.ts +1 -1
  242. package/src/ui/handler/drag_rotate.test.ts +1 -1
  243. package/src/ui/handler/keyboard.test.ts +1 -1
  244. package/src/ui/handler/keyboard.ts +51 -51
  245. package/src/ui/handler/map_event.test.ts +1 -1
  246. package/src/ui/handler/map_event.ts +1 -1
  247. package/src/ui/handler/mouse.ts +1 -1
  248. package/src/ui/handler/mouse_rotate.test.ts +1 -1
  249. package/src/ui/handler/scroll_zoom.test.ts +1 -1
  250. package/src/ui/handler/scroll_zoom.ts +9 -9
  251. package/src/ui/handler/shim/drag_pan.ts +4 -4
  252. package/src/ui/handler/shim/drag_rotate.ts +1 -1
  253. package/src/ui/handler/shim/touch_zoom_rotate.ts +1 -1
  254. package/src/ui/handler/tap_recognizer.ts +4 -4
  255. package/src/ui/handler/touch_pan.ts +2 -2
  256. package/src/ui/handler/touch_zoom_rotate.test.ts +1 -1
  257. package/src/ui/handler/touch_zoom_rotate.ts +1 -1
  258. package/src/ui/handler_inertia.ts +6 -6
  259. package/src/ui/handler_manager.ts +44 -44
  260. package/src/ui/map/isMoving.test.ts +1 -1
  261. package/src/ui/map/isRotating.test.ts +1 -1
  262. package/src/ui/map/isZooming.test.ts +1 -1
  263. package/src/ui/map.test.ts +10 -4
  264. package/src/ui/map.ts +106 -101
  265. package/src/ui/map_events.test.ts +1 -1
  266. package/src/ui/marker.test.ts +12 -12
  267. package/src/ui/marker.ts +37 -37
  268. package/src/ui/popup.test.ts +7 -7
  269. package/src/ui/popup.ts +9 -9
  270. package/src/util/actor.test.ts +41 -10
  271. package/src/util/actor.ts +8 -8
  272. package/src/util/ajax.test.ts +29 -21
  273. package/src/util/ajax.ts +51 -30
  274. package/src/util/browser.ts +1 -1
  275. package/src/util/classify_rings.test.ts +1 -1
  276. package/src/util/color_ramp.ts +5 -5
  277. package/src/util/config.ts +2 -2
  278. package/src/util/dispatcher.ts +1 -1
  279. package/src/util/dom.ts +2 -2
  280. package/src/util/evented.ts +1 -1
  281. package/src/util/find_pole_of_inaccessibility.ts +3 -3
  282. package/src/util/image.ts +5 -5
  283. package/src/util/performance.ts +7 -7
  284. package/src/util/request_manager.ts +4 -4
  285. package/src/util/resolve_tokens.ts +4 -4
  286. package/src/util/struct_array.test.ts +1 -1
  287. package/src/util/struct_array.ts +15 -15
  288. package/src/util/task_queue.ts +3 -3
  289. package/src/util/tile_request_cache.ts +3 -3
  290. package/src/util/transferable_grid_index.ts +4 -4
  291. package/src/util/util.ts +8 -8
  292. package/src/util/web_worker.ts +4 -68
  293. package/src/util/web_worker_transfer.test.ts +3 -0
  294. package/src/util/web_worker_transfer.ts +21 -17
  295. package/src/util/worker_pool.ts +1 -1
  296. package/build/.eslintrc +0 -21
  297. package/build/glsl_to_js.js +0 -12
  298. package/build/post-ts-build.js +0 -43
  299. package/build/release-notes.md.ejs +0 -8
  300. package/build/test/build-tape.js +0 -17
  301. package/build/web_worker_replacement.js +0 -5
  302. package/dist/package.json +0 -1
  303. package/src/style-spec/validate_spec.test.ts +0 -29
  304. package/src/symbol/shaping.test.ts +0 -392
  305. package/src/types/glsl.d.ts +0 -4
@@ -1,4 +1,4 @@
1
- // Generated by dts-bundle-generator v6.4.0
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
- * Returns the northeast corner of the bounding box.
830
- *
831
- * @returns {LngLat} The northeast corner of the bounding box.
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
- * Returns the northwest corner of the bounding box.
836
- *
837
- * @returns {LngLat} The northwest corner of the bounding box.
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
- * Returns the southeast corner of the bounding box.
842
- *
843
- * @returns {LngLat} The southeast corner of the bounding box.
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
- * Returns the west edge of the bounding box.
848
- *
849
- * @returns {number} The west edge of the bounding box.
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
- * Returns the south edge of the bounding box.
854
- *
855
- * @returns {number} The south edge of the bounding box.
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
- * Returns the east edge of the bounding box.
860
- *
861
- * @returns {number} The east edge of the bounding box.
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
- * Returns the north edge of the bounding box.
866
- *
867
- * @returns {number} The north edge of the bounding box.
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
- * Check if the point is within the bounding box.
898
- *
899
- * @param {LngLatLike} lnglat geographic point to check against.
900
- * @returns {boolean} True if the point is within the bounding box.
901
- * @example
902
- * var llb = new maplibregl.LngLatBounds(
903
- * new maplibregl.LngLat(-73.9876, 40.7661),
904
- * new maplibregl.LngLat(-73.9397, 40.8002)
905
- * );
906
- *
907
- * var ll = new maplibregl.LngLat(-73.9567, 40.7789);
908
- *
909
- * console.log(llb.contains(ll)); // = true
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
- * @property {number} height
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
- * @property {number} top Padding in pixels from the top of the map canvas.
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
- * Release the WebGL resources associated with the buffers. Note that because
4215
- * buckets are shared between layers having the same layout properties, they
4216
- * must be destroyed in groups (all buckets for a tile, or all symbol buckets).
4217
- *
4218
- * @private
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
- * Optional method called when the layer has been removed from the Map with {@link Map#removeLayer}. This
4362
- * gives the layer a chance to clean up gl resources and event listeners.
4363
- *
4364
- * @function
4365
- * @memberof CustomLayerInterface
4366
- * @instance
4367
- * @name onRemove
4368
- * @param {Map} map The Map this custom layer was just added to.
4369
- * @param {WebGLRenderingContext} gl The gl context for the map.
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
- * Fired when a pointing device (usually a mouse) is released within the map.
4896
- *
4897
- * **Note:** This event is compatible with the optional `layerId` parameter.
4898
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4899
- * the cursor is released while inside a visible portion of the specifed layer.
4900
- *
4901
- * @event mouseup
4902
- * @memberof Map
4903
- * @instance
4904
- * @property {MapMouseEvent} data
4905
- * @example
4906
- * // Initialize the map
4907
- * var map = new maplibregl.Map({ // map options });
4908
- * // Set an event listener
4909
- * map.on('mouseup', function() {
4910
- * console.log('A mouseup event has occurred.');
4911
- * });
4912
- * @example
4913
- * // Initialize the map
4914
- * var map = new maplibregl.Map({ // map options });
4915
- * // Set an event listener for a specific layer
4916
- * map.on('mouseup', 'poi-label', function() {
4917
- * console.log('A mouseup event has occurred on a visible portion of the poi-label layer.');
4918
- * });
4919
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
4920
- */ | "mouseup"
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
- * Fired when a pointing device (usually a mouse) is moved within the map.
4923
- * As you move the cursor across a web page containing a map,
4924
- * the event will fire each time it enters the map or any child elements.
4925
- *
4926
- * **Note:** This event is compatible with the optional `layerId` parameter.
4927
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4928
- * the cursor is moved inside a visible portion of the specifed layer.
4929
- *
4930
- * @event mouseover
4931
- * @memberof Map
4932
- * @instance
4933
- * @property {MapMouseEvent} data
4934
- * @example
4935
- * // Initialize the map
4936
- * var map = new maplibregl.Map({ // map options });
4937
- * // Set an event listener
4938
- * map.on('mouseover', function() {
4939
- * console.log('A mouseover event has occurred.');
4940
- * });
4941
- * @example
4942
- * // Initialize the map
4943
- * var map = new maplibregl.Map({ // map options });
4944
- * // Set an event listener for a specific layer
4945
- * map.on('mouseover', 'poi-label', function() {
4946
- * console.log('A mouseover event has occurred on a visible portion of the poi-label layer.');
4947
- * });
4948
- * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
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
- * Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map.
4954
- * As you move the cursor across the map, the event will fire every time the cursor changes position within the map.
4955
- *
4956
- * **Note:** This event is compatible with the optional `layerId` parameter.
4957
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4958
- * the cursor is inside a visible portion of the specified layer.
4959
- *
4960
- * @event mousemove
4961
- * @memberof Map
4962
- * @instance
4963
- * @property {MapMouseEvent} data
4964
- * @example
4965
- * // Initialize the map
4966
- * var map = new maplibregl.Map({ // map options });
4967
- * // Set an event listener
4968
- * map.on('mousemove', function() {
4969
- * console.log('A mousemove event has occurred.');
4970
- * });
4971
- * @example
4972
- * // Initialize the map
4973
- * var map = new maplibregl.Map({ // map options });
4974
- * // Set an event listener for a specific layer
4975
- * map.on('mousemove', 'poi-label', function() {
4976
- * console.log('A mousemove event has occurred on a visible portion of the poi-label layer.');
4977
- * });
4978
- * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
4979
- * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
4980
- * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
4981
- */ | "mousemove"
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
- * Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.
4984
- *
4985
- * **Note:** This event is compatible with the optional `layerId` parameter.
4986
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4987
- * point that is pressed and released contains a visible portion of the specifed layer.
4988
- *
4989
- * @event click
4990
- * @memberof Map
4991
- * @instance
4992
- * @property {MapMouseEvent} data
4993
- * @example
4994
- * // Initialize the map
4995
- * var map = new maplibregl.Map({ // map options });
4996
- * // Set an event listener
4997
- * map.on('click', function(e) {
4998
- * console.log('A click event has occurred at ' + e.lngLat);
4999
- * });
5000
- * @example
5001
- * // Initialize the map
5002
- * var map = new maplibregl.Map({ // map options });
5003
- * // Set an event listener for a specific layer
5004
- * map.on('click', 'poi-label', function(e) {
5005
- * console.log('A click event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
5006
- * });
5007
- * @see [Measure distances](https://maplibre.org/maplibre-gl-js-docs/example/measure/)
5008
- * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
5009
- */ | "click"
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
- * Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on
5012
- * the map in rapid succession.
5013
- *
5014
- * **Note:** This event is compatible with the optional `layerId` parameter.
5015
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only
5016
- * when the point that is clicked twice contains a visible portion of the specifed layer.
5017
- *
5018
- * @event dblclick
5019
- * @memberof Map
5020
- * @instance
5021
- * @property {MapMouseEvent} data
5022
- * @example
5023
- * // Initialize the map
5024
- * var map = new maplibregl.Map({ // map options });
5025
- * // Set an event listener
5026
- * map.on('dblclick', function(e) {
5027
- * console.log('A dblclick event has occurred at ' + e.lngLat);
5028
- * });
5029
- * @example
5030
- * // Initialize the map
5031
- * var map = new maplibregl.Map({ // map options });
5032
- * // Set an event listener for a specific layer
5033
- * map.on('dblclick', 'poi-label', function(e) {
5034
- * console.log('A dblclick event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
5035
- * });
5036
- */ | "dblclick"
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
- * Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from
5039
- * outside that layer or outside the map canvas.
5040
- *
5041
- * **Important:** This event can only be listened for when {@link Map#on} includes three arguments,
5042
- * where the second argument specifies the desired layer.
5043
- *
5044
- * @event mouseenter
5045
- * @memberof Map
5046
- * @instance
5047
- * @property {MapMouseEvent} data
5048
- * @example
5049
- * // Initialize the map
5050
- * var map = new maplibregl.Map({ // map options });
5051
- * // Set an event listener
5052
- * map.on('mouseenter', 'water', function() {
5053
- * console.log('A mouseenter event occurred on a visible portion of the water layer.');
5054
- * });
5055
- * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
5056
- * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
5057
- */ | "mouseenter"
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
- * Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves
5060
- * the map canvas.
5061
- *
5062
- * **Important:** This event can only be listened for when {@link Map#on} includes three arguements,
5063
- * where the second argument specifies the desired layer.
5064
- *
5065
- * @event mouseleave
5066
- * @memberof Map
5067
- * @instance
5068
- * @property {MapMouseEvent} data
5069
- * @example
5070
- * // Initialize the map
5071
- * var map = new maplibregl.Map({ // map options });
5072
- * // Set an event listener that fires
5073
- * // when the pointing device leaves
5074
- * // a visible portion of the specified layer.
5075
- * map.on('mouseleave', 'water', function() {
5076
- * console.log('A mouseleave event occurred.');
5077
- * });
5078
- * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
5079
- * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
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
- * Fired when a point device (usually a mouse) leaves the map's canvas.
5083
- *
5084
- * @event mouseout
5085
- * @memberof Map
5086
- * @instance
5087
- * @property {MapMouseEvent} data
5088
- * @example
5089
- * // Initialize the map
5090
- * var map = new maplibregl.Map({ // map options });
5091
- * // Set an event listener that fires
5092
- * // when the pointing device leave's
5093
- * // the map's canvas.
5094
- * map.on('mouseout', function() {
5095
- * console.log('A mouseout event occurred.');
5096
- * });
5097
- */ | "mouseout"
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
- * Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.
5100
- *
5101
- * @event contextmenu
5102
- * @memberof Map
5103
- * @instance
5104
- * @property {MapMouseEvent} data
5105
- * @example
5106
- * // Initialize the map
5107
- * var map = new maplibregl.Map({ // map options });
5108
- * // Set an event listener that fires
5109
- * // when the right mouse button is
5110
- * // pressed within the map.
5111
- * map.on('contextmenu', function() {
5112
- * console.log('A contextmenu event occurred.');
5113
- * });
5114
- */ | "contextmenu"
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
- * Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.
5117
- *
5118
- * @event wheel
5119
- * @memberof Map
5120
- * @instance
5121
- * @property {MapWheelEvent} data
5122
- * @example
5123
- * // Initialize the map
5124
- * var map = new maplibregl.Map({ // map options });
5125
- * // Set an event listener that fires
5126
- * // when a wheel event occurs within the map.
5127
- * map.on('wheel', function() {
5128
- * console.log('A wheel event occurred.');
5129
- * });
5130
- */ | "wheel"
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
- * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.
5133
- *
5134
- * @event touchstart
5135
- * @memberof Map
5136
- * @instance
5137
- * @property {MapTouchEvent} data
5138
- * // Initialize the map
5139
- * var map = new maplibregl.Map({ // map options });
5140
- * // Set an event listener that fires
5141
- * // when a touchstart event occurs within the map.
5142
- * map.on('touchstart', function() {
5143
- * console.log('A touchstart event occurred.');
5144
- * });
5145
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
5146
- */ | "touchstart"
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
- * Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.
5149
- *
5150
- * @event touchend
5151
- * @memberof Map
5152
- * @instance
5153
- * @property {MapTouchEvent} data
5154
- * @example
5155
- * // Initialize the map
5156
- * var map = new maplibregl.Map({ // map options });
5157
- * // Set an event listener that fires
5158
- * // when a touchstart event occurs within the map.
5159
- * map.on('touchstart', function() {
5160
- * console.log('A touchstart event occurred.');
5161
- * });
5162
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
5163
- */ | "touchend"
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
- * Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.
5166
- *
5167
- * @event touchmove
5168
- * @memberof Map
5169
- * @instance
5170
- * @property {MapTouchEvent} data
5171
- * @example
5172
- * // Initialize the map
5173
- * var map = new maplibregl.Map({ // map options });
5174
- * // Set an event listener that fires
5175
- * // when a touchmove event occurs within the map.
5176
- * map.on('touchmove', function() {
5177
- * console.log('A touchmove event occurred.');
5178
- * });
5179
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
5180
- */ | "touchmove"
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
- * Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.
5183
- *
5184
- * @event touchcancel
5185
- * @memberof Map
5186
- * @instance
5187
- * @property {MapTouchEvent} data
5188
- * @example
5189
- * // Initialize the map
5190
- * var map = new maplibregl.Map({ // map options });
5191
- * // Set an event listener that fires
5192
- * // when a touchcancel event occurs within the map.
5193
- * map.on('touchcancel', function() {
5194
- * console.log('A touchcancel event occurred.');
5195
- * });
5196
- */ | "touchcancel"
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
- * Fired just before the map begins a transition from one
5199
- * view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
5200
- *
5201
- * @event movestart
5202
- * @memberof Map
5203
- * @instance
5204
- * @property {{originalEvent: DragEvent}} data
5205
- * @example
5206
- * // Initialize the map
5207
- * var map = new maplibregl.Map({ // map options });
5208
- * // Set an event listener that fires
5209
- * // just before the map begins a transition
5210
- * // from one view to another.
5211
- * map.on('movestart', function() {
5212
- * console.log('A movestart` event occurred.');
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
- * Fired repeatedly during an animated transition from one view to
5217
- * another, as the result of either user interaction or methods such as {@link Map#flyTo}.
5218
- *
5219
- * @event move
5220
- * @memberof Map
5221
- * @instance
5222
- * @property {MapMouseEvent | MapTouchEvent} data
5223
- * @example
5224
- * // Initialize the map
5225
- * var map = new maplibregl.Map({ // map options });
5226
- * // Set an event listener that fires
5227
- * // repeatedly during an animated transition.
5228
- * map.on('move', function() {
5229
- * console.log('A move event occurred.');
5230
- * });
5231
- * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
5232
- */ | "move"
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
- * Fired just after the map completes a transition from one
5235
- * view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
5236
- *
5237
- * @event moveend
5238
- * @memberof Map
5239
- * @instance
5240
- * @property {{originalEvent: DragEvent}} data
5241
- * @example
5242
- * // Initialize the map
5243
- * var map = new maplibregl.Map({ // map options });
5244
- * // Set an event listener that fires
5245
- * // just after the map completes a transition.
5246
- * map.on('moveend', function() {
5247
- * console.log('A moveend event occurred.');
5248
- * });
5249
- * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
5250
- */ | "moveend"
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
- * Fired when a "drag to pan" interaction starts. See {@link DragPanHandler}.
5253
- *
5254
- * @event dragstart
5255
- * @memberof Map
5256
- * @instance
5257
- * @property {{originalEvent: DragEvent}} data
5258
- * @example
5259
- * // Initialize the map
5260
- * var map = new maplibregl.Map({ // map options });
5261
- * // Set an event listener that fires
5262
- * // when a "drag to pan" interaction starts.
5263
- * map.on('dragstart', function() {
5264
- * console.log('A dragstart event occurred.');
5265
- * });
5266
- */ | "dragstart"
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
- * Fired repeatedly during a "drag to pan" interaction. See {@link DragPanHandler}.
5269
- *
5270
- * @event drag
5271
- * @memberof Map
5272
- * @instance
5273
- * @property {MapMouseEvent | MapTouchEvent} data
5274
- * @example
5275
- * // Initialize the map
5276
- * var map = new maplibregl.Map({ // map options });
5277
- * // Set an event listener that fires
5278
- * // repeatedly during a "drag to pan" interaction.
5279
- * map.on('drag', function() {
5280
- * console.log('A drag event occurred.');
5281
- * });
5282
- */ | "drag"
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
- * Fired when a "drag to pan" interaction ends. See {@link DragPanHandler}.
5285
- *
5286
- * @event dragend
5287
- * @memberof Map
5288
- * @instance
5289
- * @property {{originalEvent: DragEvent}} 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 "drag to pan" interaction ends.
5295
- * map.on('dragend', function() {
5296
- * console.log('A dragend event occurred.');
5297
- * });
5298
- * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
5299
- */ | "dragend"
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
- * Fired just before the map begins a transition from one zoom level to another,
5302
- * as the result of either user interaction or methods such as {@link Map#flyTo}.
5303
- *
5304
- * @event zoomstart
5305
- * @memberof Map
5306
- * @instance
5307
- * @property {MapMouseEvent | MapTouchEvent} data
5308
- * @example
5309
- * // Initialize the map
5310
- * var map = new maplibregl.Map({ // map options });
5311
- * // Set an event listener that fires
5312
- * // just before a zoom transition starts.
5313
- * map.on('zoomstart', function() {
5314
- * console.log('A zoomstart event occurred.');
5315
- * });
5316
- */ | "zoomstart"
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
- * Fired repeatedly during an animated transition from one zoom level to another,
5319
- * as the result of either user interaction or methods such as {@link Map#flyTo}.
5320
- *
5321
- * @event zoom
5322
- * @memberof Map
5323
- * @instance
5324
- * @property {MapMouseEvent | MapTouchEvent} data
5325
- * @example
5326
- * // Initialize the map
5327
- * var map = new maplibregl.Map({ // map options });
5328
- * // Set an event listener that fires
5329
- * // repeatedly during a zoom transition.
5330
- * map.on('zoom', function() {
5331
- * console.log('A zoom event occurred.');
5332
- * });
5333
- */ | "zoom"
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
- * Fired just after the map completes a transition from one zoom level to another,
5336
- * as the result of either user interaction or methods such as {@link Map#flyTo}.
5337
- *
5338
- * @event zoomend
5339
- * @memberof Map
5340
- * @instance
5341
- * @property {MapMouseEvent | MapTouchEvent} data
5342
- * @example
5343
- * // Initialize the map
5344
- * var map = new maplibregl.Map({ // map options });
5345
- * // Set an event listener that fires
5346
- * // just after a zoom transition finishes.
5347
- * map.on('zoomend', function() {
5348
- * console.log('A zoomend event occurred.');
5349
- * });
5350
- */ | "zoomend"
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
- * Fired when a "drag to rotate" interaction starts. See {@link DragRotateHandler}.
5353
- *
5354
- * @event rotatestart
5355
- * @memberof Map
5356
- * @instance
5357
- * @property {MapMouseEvent | MapTouchEvent} data
5358
- * @example
5359
- * // Initialize the map
5360
- * var map = new maplibregl.Map({ // map options });
5361
- * // Set an event listener that fires
5362
- * // just before a "drag to rotate" interaction starts.
5363
- * map.on('rotatestart', function() {
5364
- * console.log('A rotatestart event occurred.');
5365
- * });
5366
- */ | "rotatestart"
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
- * Fired repeatedly during a "drag to rotate" interaction. See {@link DragRotateHandler}.
5369
- *
5370
- * @event rotate
5371
- * @memberof Map
5372
- * @instance
5373
- * @property {MapMouseEvent | MapTouchEvent} data
5374
- * @example
5375
- * // Initialize the map
5376
- * var map = new maplibregl.Map({ // map options });
5377
- * // Set an event listener that fires
5378
- * // repeatedly during "drag to rotate" interaction.
5379
- * map.on('rotate', function() {
5380
- * console.log('A rotate event occurred.');
5381
- * });
5382
- */ | "rotate"
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
- * Fired when a "drag to rotate" interaction ends. See {@link DragRotateHandler}.
5385
- *
5386
- * @event rotateend
5387
- * @memberof Map
5388
- * @instance
5389
- * @property {MapMouseEvent | MapTouchEvent} data
5390
- * @example
5391
- * // Initialize the map
5392
- * var map = new maplibregl.Map({ // map options });
5393
- * // Set an event listener that fires
5394
- * // just after a "drag to rotate" interaction ends.
5395
- * map.on('rotateend', function() {
5396
- * console.log('A rotateend event occurred.');
5397
- * });
5398
- */ | "rotateend"
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
- * Fired whenever the map's pitch (tilt) begins a change as
5401
- * the result of either user interaction or methods such as {@link Map#flyTo} .
5402
- *
5403
- * @event pitchstart
5404
- * @memberof Map
5405
- * @instance
5406
- * @property {MapEventData} data
5407
- * @example
5408
- * // Initialize the map
5409
- * var map = new maplibregl.Map({ // map options });
5410
- * // Set an event listener that fires
5411
- * // just before a pitch (tilt) transition starts.
5412
- * map.on('pitchstart', function() {
5413
- * console.log('A pitchstart event occurred.');
5414
- * });
5415
- */ | "pitchstart"
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
- * Fired repeatedly during the map's pitch (tilt) animation between
5418
- * one state and another as the result of either user interaction
5419
- * or methods such as {@link Map#flyTo}.
5420
- *
5421
- * @event pitch
5422
- * @memberof Map
5423
- * @instance
5424
- * @property {MapEventData} data
5425
- * @example
5426
- * // Initialize the map
5427
- * var map = new maplibregl.Map({ // map options });
5428
- * // Set an event listener that fires
5429
- * // repeatedly during a pitch (tilt) transition.
5430
- * map.on('pitch', function() {
5431
- * console.log('A pitch event occurred.');
5432
- * });
5433
- */ | "pitch"
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
- * Fired immediately after the map's pitch (tilt) finishes changing as
5436
- * the result of either user interaction or methods such as {@link Map#flyTo}.
5437
- *
5438
- * @event pitchend
5439
- * @memberof Map
5440
- * @instance
5441
- * @property {MapEventData} data
5442
- * @example
5443
- * // Initialize the map
5444
- * var map = new maplibregl.Map({ // map options });
5445
- * // Set an event listener that fires
5446
- * // just after a pitch (tilt) transition ends.
5447
- * map.on('pitchend', function() {
5448
- * console.log('A pitchend event occurred.');
5449
- * });
5450
- */ | "pitchend"
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
- * Fired when a "box zoom" interaction starts. See {@link BoxZoomHandler}.
5453
- *
5454
- * @event boxzoomstart
5455
- * @memberof Map
5456
- * @instance
5457
- * @property {MapLibreZoomEvent} data
5458
- * @example
5459
- * // Initialize the map
5460
- * var map = new maplibregl.Map({ // map options });
5461
- * // Set an event listener that fires
5462
- * // just before a "box zoom" interaction starts.
5463
- * map.on('boxzoomstart', function() {
5464
- * console.log('A boxzoomstart event occurred.');
5465
- * });
5466
- */ | "boxzoomstart"
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
- * Fired when a "box zoom" interaction ends. See {@link BoxZoomHandler}.
5469
- *
5470
- * @event boxzoomend
5471
- * @memberof Map
5472
- * @instance
5473
- * @type {Object}
5474
- * @property {MapLibreZoomEvent} data
5475
- * @example
5476
- * // Initialize the map
5477
- * var map = new maplibregl.Map({ // map options });
5478
- * // Set an event listener that fires
5479
- * // just after a "box zoom" interaction ends.
5480
- * map.on('boxzoomend', function() {
5481
- * console.log('A boxzoomend event occurred.');
5482
- * });
5483
- */ | "boxzoomend"
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
- * Fired when the user cancels a "box zoom" interaction, or when the bounding box does not meet the minimum size threshold.
5486
- * See {@link BoxZoomHandler}.
5487
- *
5488
- * @event boxzoomcancel
5489
- * @memberof Map
5490
- * @instance
5491
- * @property {MapLibreZoomEvent} data
5492
- * @example
5493
- * // Initialize the map
5494
- * var map = new maplibregl.Map({ // map options });
5495
- * // Set an event listener that fires
5496
- * // the user cancels a "box zoom" interaction.
5497
- * map.on('boxzoomcancel', function() {
5498
- * console.log('A boxzoomcancel event occurred.');
5499
- * });
5500
- */ | "boxzoomcancel"
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
- * Fired immediately after the map has been resized.
5503
- *
5504
- * @event resize
5505
- * @memberof Map
5506
- * @instance
5507
- * @example
5508
- * // Initialize the map
5509
- * var map = new maplibregl.Map({ // map options });
5510
- * // Set an event listener that fires
5511
- * // immediately after the map has been resized.
5512
- * map.on('resize', function() {
5513
- * console.log('A resize event occurred.');
5514
- * });
5515
- */ | "resize"
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
- * Fired when the WebGL context is lost.
5518
- *
5519
- * @event webglcontextlost
5520
- * @memberof Map
5521
- * @instance
5522
- * @example
5523
- * // Initialize the map
5524
- * var map = new maplibregl.Map({ // map options });
5525
- * // Set an event listener that fires
5526
- * // when the WebGL context is lost.
5527
- * map.on('webglcontextlost', function() {
5528
- * console.log('A webglcontextlost event occurred.');
5529
- * });
5530
- */ | "webglcontextlost"
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
- * Fired when the WebGL context is restored.
5533
- *
5534
- * @event webglcontextrestored
5535
- * @memberof Map
5536
- * @instance
5537
- * @example
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
- * Fired immediately after all necessary resources have been downloaded
5548
- * and the first visually complete rendering of the map has occurred.
5549
- *
5550
- * @event load
5551
- * @memberof Map
5552
- * @instance
5553
- * @type {Object}
5554
- * @example
5555
- * // Initialize the map
5556
- * var map = new maplibregl.Map({ // map options });
5557
- * // Set an event listener that fires
5558
- * // when the map has finished loading.
5559
- * map.on('load', function() {
5560
- * console.log('A load event occurred.');
5561
- * });
5562
- * @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js-docs/example/geojson-markers/)
5563
- * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js-docs/example/live-geojson/)
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
- * Fired whenever the map is drawn to the screen, as the result of
5568
- *
5569
- * - a change to the map's position, zoom, pitch, or bearing
5570
- * - a change to the map's style
5571
- * - a change to a GeoJSON source
5572
- * - the loading of a vector tile, GeoJSON file, glyph, or sprite
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
- * @event render
5575
- * @memberof Map
5576
- * @instance
5577
- * @example
5578
- * // Initialize the map
5579
- * var map = new maplibregl.Map({ // map options });
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
- * - No camera transitions are in progress
5591
- * - All currently requested tiles have loaded
5592
- * - All fade/transition animations have completed
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
- * @event idle
5595
- * @memberof Map
5596
- * @instance
5597
- * @example
5598
- * // Initialize the map
5599
- * var map = new maplibregl.Map({ // map options });
5600
- * // Set an event listener that fires
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
- * @event remove
5610
- * @memberof Map
5611
- * @instance
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
- * // Initialize the map
5614
- * var map = new maplibregl.Map({ // map options });
5615
- * // Set an event listener that fires
5616
- * // just after the map is removed.
5617
- * map.on('remove', function() {
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
- * @event data
5645
- * @memberof Map
5646
- * @instance
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
- * @event styledata
5663
- * @memberof Map
5664
- * @instance
5665
- * @property {MapDataEvent} data
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
- */ | "styledata"
5675
- /**
5676
- * Fired when one of the map's sources loads or changes, including if a tile belonging
5677
- * to a source loads or changes. See {@link MapDataEvent} for more information.
5678
- *
5679
- * @event sourcedata
5680
- * @memberof Map
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
- * @property {MapDataEvent} data
5683
- * @example
5684
- * // Initialize the map
5685
- * var map = new maplibregl.Map({ // map options });
5686
- * // Set an event listener that fires
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
- * @property {MapDataEvent} data
5701
- * @example
5702
- * // Initialize the map
5703
- * var map = new maplibregl.Map({ // map options });
5704
- * // Set an event listener that fires
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
- * @event styledataloading
5717
- * @memberof Map
5718
- * @instance
5719
- * @property {MapDataEvent} data
5720
- * @example
5721
- * // Initialize the map
5722
- * var map = new maplibregl.Map({ // map options });
5723
- * // Set an event listener that fires
5724
- * // map's style begins loading or
5725
- * // changing asyncronously.
5726
- * map.on('styledataloading', function() {
5727
- * console.log('A styledataloading event occurred.');
5728
- * });
5729
- */ | "styledataloading"
5730
- /**
5731
- * Fired when one of the map's sources begins loading or changing asyncronously.
5732
- * All `sourcedataloading` events are followed by a `sourcedata` or `error` event.
5733
- * See {@link MapDataEvent} for more information.
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
- * @event sourcedataloading
5736
- * @memberof Map
5737
- * @instance
5738
- * @property {MapDataEvent} data
5739
- * @example
5740
- * // Initialize the map
5741
- * var map = new maplibregl.Map({ // map options });
5742
- * // Set an event listener that fires
5743
- * // map's sources begin loading or
5744
- * // changing asyncronously.
5745
- * map.on('sourcedataloading', function() {
5746
- * console.log('A sourcedataloading event occurred.');
5747
- * });
5748
- */ | "sourcedataloading"
5749
- /**
5750
- * Fired when an icon or pattern needed by the style is missing. The missing image can
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
- * @event styleimagemissing
5755
- * @memberof Map
5756
- * @instance
5757
- * @property {string} id The id of the missing image.
5758
- * @example
5759
- * // Initialize the map
5760
- * var map = new maplibregl.Map({ // map options });
5761
- * // Set an event listener that fires
5762
- * // an icon or pattern is missing.
5763
- * map.on('styleimagemissing', function() {
5764
- * console.log('A styleimagemissing event occurred.');
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
- * @returns A plain (stringifiable) JS object representing the current state of the source.
5822
- * Creating a source using the returned object as the `options` should result in a Source that is
5823
- * equivalent to this one.
5824
- * @private
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
- * Set the data of a GeoJSON source, given its id.
6508
- * @param {string} id id of the source
6509
- * @param {GeoJSON|string} data GeoJSON source
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 ID of the layer to move
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
- * Set the zoom rate of a mouse wheel
7678
- * @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
7679
- * @example
7680
- * // Slow down zoom of mouse wheel
7681
- * map.scrollZoom.setWheelZoomRate(1/600);
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
- * @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.
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
- * @returns {Map} `this`
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 `[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`.
9093
- * @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.
9094
- * @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.
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} A Boolean indicating whether the image exists.
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
- * Returns an Array of strings containing the IDs of all images currently available in the map.
9196
- * This includes both images from the style's original sprite
9197
- * and any images that have been added at runtime using {@link Map#addImage}.
9198
- *
9199
- * @returns {Array<string>} An Array of strings containing the names of all sprites/images currently available in the map.
9200
- *
9201
- * @example
9202
- * var allImages = map.listImages();
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
- * Force a synchronous redraw of the map.
9680
- * @example
9681
- * map.redraw();
9682
- * @returns {Map} `this`
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
- * @example
10076
- * // Store the marker's longitude and latitude coordinates in a variable
10077
- * var lngLat = marker.getLngLat();
10078
- * // Print the marker's longitude and latitude values in the console
10079
- * console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )
10080
- * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
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
- * Set the marker's geographical position and move it.
10085
- * @param {LngLat} lnglat A {@link LngLat} describing where the marker should be located.
10086
- * @returns {Marker} `this`
10087
- * @example
10088
- * // Create a new marker, set the longitude and latitude, and add it to the map
10089
- * new maplibregl.Marker()
10090
- * .setLngLat([-65.017, -16.457])
10091
- * .addTo(map);
10092
- * @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js-docs/example/custom-marker-icons/)
10093
- * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
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
- * Programmatically request and move the map to the user's location.
10264
- *
10265
- * @returns {boolean} Returns `false` if called before control was added to a map, otherwise returns `true`.
10266
- * @example
10267
- * // Initialize the geolocate control.
10268
- * var geolocate = new maplibregl.GeolocateControl({
10269
- * positionOptions: {
10270
- * enableHighAccuracy: true
10271
- * },
10272
- * trackUserLocation: true
10273
- * });
10274
- * // Add the control to the map.
10275
- * map.addControl(geolocate);
10276
- * map.on('load', function() {
10277
- * geolocate.trigger();
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
- * Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.
10523
- * The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.
10524
- * If the status is `loaded` and the plugin is requested again, an error will be thrown.
10525
- *
10526
- * @function getRTLTextPluginStatus
10527
- * @example
10528
- * const pluginStatus = maplibregl.getRTLTextPluginStatus();
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;