maplibre-gl 2.0.5 → 2.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) 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} +12 -26
  12. package/dist/maplibre-gl-dev.js +54885 -0
  13. package/dist/maplibre-gl.css +1 -1
  14. package/dist/maplibre-gl.d.ts +1574 -1022
  15. package/dist/maplibre-gl.js +3 -3
  16. package/dist/maplibre-gl.js.map +1 -1
  17. package/package.json +94 -131
  18. package/src/css/maplibre-gl.css +49 -49
  19. package/src/data/{array_types.ts → array_types.g.ts} +0 -0
  20. package/src/data/bucket/circle_bucket.ts +1 -1
  21. package/src/data/bucket/fill_bucket.test.ts +1 -1
  22. package/src/data/bucket/fill_bucket.ts +4 -4
  23. package/src/data/bucket/fill_extrusion_bucket.ts +1 -1
  24. package/src/data/bucket/line_bucket.test.ts +1 -1
  25. package/src/data/bucket/line_bucket.ts +6 -6
  26. package/src/data/bucket/symbol_bucket.test.ts +16 -16
  27. package/src/data/bucket/symbol_bucket.ts +56 -56
  28. package/src/data/bucket.ts +43 -43
  29. package/src/data/dem_data.ts +12 -12
  30. package/src/data/evaluation_feature.ts +10 -10
  31. package/src/data/feature_index.ts +37 -37
  32. package/src/data/feature_position_map.ts +5 -5
  33. package/src/data/index_array_type.ts +1 -1
  34. package/src/data/load_geometry.test.ts +1 -1
  35. package/src/data/program_configuration.ts +47 -47
  36. package/src/data/segment.ts +14 -14
  37. package/src/geo/edge_insets.ts +2 -2
  38. package/src/geo/lng_lat.ts +4 -4
  39. package/src/geo/lng_lat_bounds.ts +35 -35
  40. package/src/geo/mercator_coordinate.ts +5 -5
  41. package/src/geo/transform.test.ts +1 -1
  42. package/src/geo/transform.ts +14 -14
  43. package/src/gl/context.ts +3 -3
  44. package/src/gl/types.ts +19 -19
  45. package/src/gl/value.ts +6 -6
  46. package/src/gl/vertex_buffer.test.ts +1 -1
  47. package/src/index.ts +24 -9
  48. package/src/render/draw_circle.ts +8 -8
  49. package/src/render/draw_collision_debug.ts +5 -5
  50. package/src/render/draw_debug.ts +1 -1
  51. package/src/render/draw_line.ts +4 -4
  52. package/src/render/draw_symbol.ts +21 -21
  53. package/src/render/glyph_atlas.ts +12 -12
  54. package/src/render/glyph_manager.test.ts +10 -21
  55. package/src/render/glyph_manager.ts +34 -33
  56. package/src/render/image_manager.ts +4 -4
  57. package/src/render/painter.ts +16 -14
  58. package/src/render/program/background_program.ts +29 -29
  59. package/src/render/program/circle_program.ts +11 -11
  60. package/src/render/program/clipping_mask_program.ts +1 -1
  61. package/src/render/program/collision_program.ts +9 -9
  62. package/src/render/program/debug_program.ts +4 -4
  63. package/src/render/program/fill_extrusion_program.ts +31 -31
  64. package/src/render/program/fill_program.ts +29 -29
  65. package/src/render/program/heatmap_program.ts +12 -12
  66. package/src/render/program/hillshade_program.ts +12 -12
  67. package/src/render/program/line_program.ts +41 -41
  68. package/src/render/program/pattern.ts +28 -28
  69. package/src/render/program/raster_program.ts +21 -21
  70. package/src/render/program/symbol_program.ts +97 -97
  71. package/src/render/program.ts +25 -25
  72. package/src/render/texture.ts +9 -9
  73. package/src/render/uniform_binding.ts +1 -1
  74. package/src/render/vertex_array_object.ts +13 -13
  75. package/src/shaders/_prelude.fragment.glsl.g.ts +2 -0
  76. package/src/shaders/_prelude.vertex.glsl.g.ts +2 -0
  77. package/src/shaders/background.fragment.glsl.g.ts +2 -0
  78. package/src/shaders/background.vertex.glsl.g.ts +2 -0
  79. package/src/shaders/background_pattern.fragment.glsl.g.ts +2 -0
  80. package/src/shaders/background_pattern.vertex.glsl.g.ts +2 -0
  81. package/src/shaders/circle.fragment.glsl.g.ts +2 -0
  82. package/src/shaders/circle.vertex.glsl.g.ts +2 -0
  83. package/src/shaders/clipping_mask.fragment.glsl.g.ts +2 -0
  84. package/src/shaders/clipping_mask.vertex.glsl.g.ts +2 -0
  85. package/src/shaders/collision_box.fragment.glsl.g.ts +2 -0
  86. package/src/shaders/collision_box.vertex.glsl.g.ts +2 -0
  87. package/src/shaders/collision_circle.fragment.glsl.g.ts +2 -0
  88. package/src/shaders/collision_circle.vertex.glsl.g.ts +2 -0
  89. package/src/shaders/debug.fragment.glsl.g.ts +2 -0
  90. package/src/shaders/debug.vertex.glsl.g.ts +2 -0
  91. package/src/shaders/fill.fragment.glsl.g.ts +2 -0
  92. package/src/shaders/fill.vertex.glsl.g.ts +2 -0
  93. package/src/shaders/fill_extrusion.fragment.glsl.g.ts +2 -0
  94. package/src/shaders/fill_extrusion.vertex.glsl.g.ts +2 -0
  95. package/src/shaders/fill_extrusion_pattern.fragment.glsl.g.ts +2 -0
  96. package/src/shaders/fill_extrusion_pattern.vertex.glsl.g.ts +2 -0
  97. package/src/shaders/fill_outline.fragment.glsl.g.ts +2 -0
  98. package/src/shaders/fill_outline.vertex.glsl.g.ts +2 -0
  99. package/src/shaders/fill_outline_pattern.fragment.glsl.g.ts +2 -0
  100. package/src/shaders/fill_outline_pattern.vertex.glsl.g.ts +2 -0
  101. package/src/shaders/fill_pattern.fragment.glsl.g.ts +2 -0
  102. package/src/shaders/fill_pattern.vertex.glsl.g.ts +2 -0
  103. package/src/shaders/heatmap.fragment.glsl.g.ts +2 -0
  104. package/src/shaders/heatmap.vertex.glsl.g.ts +2 -0
  105. package/src/shaders/heatmap_texture.fragment.glsl.g.ts +2 -0
  106. package/src/shaders/heatmap_texture.vertex.glsl.g.ts +2 -0
  107. package/src/shaders/hillshade.fragment.glsl.g.ts +2 -0
  108. package/src/shaders/hillshade.vertex.glsl.g.ts +2 -0
  109. package/src/shaders/hillshade_prepare.fragment.glsl.g.ts +2 -0
  110. package/src/shaders/hillshade_prepare.vertex.glsl.g.ts +2 -0
  111. package/src/shaders/line.fragment.glsl.g.ts +2 -0
  112. package/src/shaders/line.vertex.glsl.g.ts +2 -0
  113. package/src/shaders/line_gradient.fragment.glsl.g.ts +2 -0
  114. package/src/shaders/line_gradient.vertex.glsl.g.ts +2 -0
  115. package/src/shaders/line_pattern.fragment.glsl.g.ts +2 -0
  116. package/src/shaders/line_pattern.vertex.glsl.g.ts +2 -0
  117. package/src/shaders/line_sdf.fragment.glsl.g.ts +2 -0
  118. package/src/shaders/line_sdf.vertex.glsl.g.ts +2 -0
  119. package/src/shaders/raster.fragment.glsl.g.ts +2 -0
  120. package/src/shaders/raster.vertex.glsl.g.ts +2 -0
  121. package/src/shaders/shaders.ts +52 -55
  122. package/src/shaders/symbol_icon.fragment.glsl.g.ts +2 -0
  123. package/src/shaders/symbol_icon.vertex.glsl.g.ts +2 -0
  124. package/src/shaders/symbol_sdf.fragment.glsl.g.ts +2 -0
  125. package/src/shaders/symbol_sdf.vertex.glsl.g.ts +2 -0
  126. package/src/shaders/symbol_text_and_icon.fragment.glsl.g.ts +2 -0
  127. package/src/shaders/symbol_text_and_icon.vertex.glsl.g.ts +2 -0
  128. package/src/source/canvas_source.test.ts +11 -12
  129. package/src/source/canvas_source.ts +4 -4
  130. package/src/source/geojson_source.test.ts +2 -1
  131. package/src/source/geojson_source.ts +1 -1
  132. package/src/source/geojson_worker_source.ts +23 -23
  133. package/src/source/geojson_wrapper.ts +8 -8
  134. package/src/source/image_source.test.ts +2 -2
  135. package/src/source/image_source.ts +6 -6
  136. package/src/source/pixels_to_tile_units.ts +6 -6
  137. package/src/source/query_features.ts +20 -20
  138. package/src/source/raster_dem_tile_source.test.ts +4 -3
  139. package/src/source/raster_dem_tile_source.ts +1 -1
  140. package/src/source/raster_tile_source.test.ts +4 -3
  141. package/src/source/raster_tile_source.ts +1 -1
  142. package/src/source/rtl_text_plugin.ts +10 -10
  143. package/src/source/source.ts +29 -29
  144. package/src/source/source_cache.test.ts +33 -1
  145. package/src/source/source_cache.ts +7 -5
  146. package/src/source/source_state.ts +1 -1
  147. package/src/source/tile.test.ts +3 -3
  148. package/src/source/tile.ts +15 -15
  149. package/src/source/tile_cache.test.ts +6 -4
  150. package/src/source/tile_cache.ts +6 -6
  151. package/src/source/tile_id.test.ts +10 -13
  152. package/src/source/tile_id.ts +2 -2
  153. package/src/source/vector_tile_source.test.ts +17 -5
  154. package/src/source/vector_tile_source.ts +4 -5
  155. package/src/source/vector_tile_worker_source.test.ts +4 -4
  156. package/src/source/vector_tile_worker_source.ts +5 -5
  157. package/src/source/worker.test.ts +1 -1
  158. package/src/source/worker.ts +22 -22
  159. package/src/source/worker_source.ts +56 -56
  160. package/src/source/worker_tile.ts +4 -4
  161. package/src/style/evaluation_parameters.ts +3 -3
  162. package/src/style/format_section_override.test.ts +1 -1
  163. package/src/style/light.ts +10 -10
  164. package/src/style/load_glyph_range.test.ts +3 -5
  165. package/src/style/load_glyph_range.ts +6 -6
  166. package/src/style/load_sprite.ts +5 -4
  167. package/src/style/pauseable_placement.ts +1 -1
  168. package/src/style/properties.ts +70 -70
  169. package/src/style/query_utils.ts +7 -7
  170. package/src/style/style.test.ts +26 -15
  171. package/src/style/style.ts +30 -30
  172. package/src/style/style_glyph.ts +8 -8
  173. package/src/style/style_image.ts +58 -58
  174. package/src/style/style_layer/background_style_layer.ts +2 -2
  175. package/src/style/style_layer/{background_style_layer_properties.ts → background_style_layer_properties.g.ts} +0 -0
  176. package/src/style/style_layer/circle_style_layer.ts +10 -10
  177. package/src/style/style_layer/{circle_style_layer_properties.ts → circle_style_layer_properties.g.ts} +0 -0
  178. package/src/style/style_layer/custom_style_layer.ts +19 -19
  179. package/src/style/style_layer/fill_extrusion_style_layer.ts +11 -11
  180. package/src/style/style_layer/{fill_extrusion_style_layer_properties.ts → fill_extrusion_style_layer_properties.g.ts} +0 -0
  181. package/src/style/style_layer/fill_style_layer.ts +9 -9
  182. package/src/style/style_layer/{fill_style_layer_properties.ts → fill_style_layer_properties.g.ts} +0 -0
  183. package/src/style/style_layer/heatmap_style_layer.ts +2 -2
  184. package/src/style/style_layer/{heatmap_style_layer_properties.ts → heatmap_style_layer_properties.g.ts} +0 -0
  185. package/src/style/style_layer/hillshade_style_layer.ts +2 -2
  186. package/src/style/style_layer/{hillshade_style_layer_properties.ts → hillshade_style_layer_properties.g.ts} +0 -0
  187. package/src/style/style_layer/line_style_layer.ts +9 -9
  188. package/src/style/style_layer/{line_style_layer_properties.ts → line_style_layer_properties.g.ts} +0 -0
  189. package/src/style/style_layer/raster_style_layer.ts +2 -2
  190. package/src/style/style_layer/{raster_style_layer_properties.ts → raster_style_layer_properties.g.ts} +0 -0
  191. package/src/style/style_layer/symbol_style_layer.ts +26 -7
  192. package/src/style/style_layer/{symbol_style_layer_properties.ts → symbol_style_layer_properties.g.ts} +6 -0
  193. package/src/style/style_layer.ts +10 -10
  194. package/src/style/style_layer_index.ts +3 -3
  195. package/src/style/validate_style.ts +15 -15
  196. package/src/style-spec/CHANGELOG.md +6 -0
  197. package/src/style-spec/error/validation_error.ts +1 -1
  198. package/src/style-spec/expression/compound_expression.ts +3 -3
  199. package/src/style-spec/expression/definitions/format.ts +11 -11
  200. package/src/style-spec/expression/definitions/interpolate.ts +5 -5
  201. package/src/style-spec/expression/definitions/match.ts +2 -2
  202. package/src/style-spec/expression/definitions/number_format.ts +11 -11
  203. package/src/style-spec/expression/expression.ts +8 -8
  204. package/src/style-spec/expression/index.ts +97 -97
  205. package/src/style-spec/expression/parsing_context.ts +11 -11
  206. package/src/style-spec/expression/types/collator.ts +9 -9
  207. package/src/style-spec/expression/types/resolved_image.ts +2 -2
  208. package/src/style-spec/expression/types.ts +14 -14
  209. package/src/style-spec/expression/values.ts +1 -1
  210. package/src/style-spec/feature_filter/index.ts +66 -66
  211. package/src/style-spec/function/convert.ts +3 -3
  212. package/src/style-spec/package.json +1 -1
  213. package/src/style-spec/reference/v8.json +68 -2
  214. package/src/style-spec/style-spec.ts +44 -44
  215. package/src/style-spec/types.ts +2 -0
  216. package/src/style-spec/util/color_spaces.ts +8 -8
  217. package/src/style-spec/util/result.ts +4 -4
  218. package/src/style-spec/validate/validate_filter.ts +58 -58
  219. package/src/style-spec/validate/validate_source.ts +63 -63
  220. package/src/style-spec/visit.ts +11 -11
  221. package/src/symbol/collision_feature.test.ts +1 -1
  222. package/src/symbol/collision_feature.ts +10 -10
  223. package/src/symbol/collision_index.ts +43 -43
  224. package/src/symbol/cross_tile_symbol_index.ts +17 -17
  225. package/src/symbol/get_anchors.ts +16 -16
  226. package/src/symbol/grid_index.test.ts +42 -19
  227. package/src/symbol/grid_index.ts +69 -40
  228. package/src/symbol/placement.ts +124 -95
  229. package/src/symbol/projection.ts +30 -30
  230. package/src/symbol/quads.ts +30 -30
  231. package/src/symbol/shaping.ts +160 -160
  232. package/src/symbol/symbol_layout.ts +119 -119
  233. package/src/symbol/symbol_size.ts +29 -29
  234. package/src/symbol/symbol_style_layer.test.ts +49 -2
  235. package/src/types/cancelable.ts +1 -1
  236. package/src/types/tilejson.ts +13 -13
  237. package/src/ui/anchor.ts +1 -1
  238. package/src/ui/camera.test.ts +9 -9
  239. package/src/ui/camera.ts +18 -18
  240. package/src/ui/control/attribution_control.test.ts +51 -16
  241. package/src/ui/control/attribution_control.ts +35 -16
  242. package/src/ui/control/control.ts +40 -40
  243. package/src/ui/control/fullscreen_control.ts +1 -1
  244. package/src/ui/control/geolocate_control.test.ts +1 -1
  245. package/src/ui/control/geolocate_control.ts +102 -102
  246. package/src/ui/control/logo_control.test.ts +5 -4
  247. package/src/ui/control/navigation_control.ts +3 -3
  248. package/src/ui/control/scale_control.test.ts +2 -2
  249. package/src/ui/control/scale_control.ts +5 -5
  250. package/src/ui/events.ts +289 -200
  251. package/src/ui/handler/box_zoom.test.ts +1 -1
  252. package/src/ui/handler/box_zoom.ts +1 -1
  253. package/src/ui/handler/dblclick_zoom.test.ts +1 -1
  254. package/src/ui/handler/drag_pan.test.ts +1 -1
  255. package/src/ui/handler/drag_rotate.test.ts +1 -1
  256. package/src/ui/handler/keyboard.test.ts +1 -1
  257. package/src/ui/handler/keyboard.ts +51 -51
  258. package/src/ui/handler/map_event.test.ts +1 -1
  259. package/src/ui/handler/map_event.ts +1 -1
  260. package/src/ui/handler/mouse.ts +1 -1
  261. package/src/ui/handler/mouse_rotate.test.ts +1 -1
  262. package/src/ui/handler/scroll_zoom.test.ts +3 -2
  263. package/src/ui/handler/scroll_zoom.ts +9 -9
  264. package/src/ui/handler/shim/drag_pan.ts +4 -4
  265. package/src/ui/handler/shim/drag_rotate.ts +1 -1
  266. package/src/ui/handler/shim/touch_zoom_rotate.ts +1 -1
  267. package/src/ui/handler/tap_recognizer.ts +4 -4
  268. package/src/ui/handler/touch_pan.ts +2 -2
  269. package/src/ui/handler/touch_zoom_rotate.test.ts +1 -1
  270. package/src/ui/handler/touch_zoom_rotate.ts +1 -1
  271. package/src/ui/handler_inertia.ts +6 -6
  272. package/src/ui/handler_manager.ts +44 -44
  273. package/src/ui/map/isMoving.test.ts +1 -1
  274. package/src/ui/map/isRotating.test.ts +1 -1
  275. package/src/ui/map/isZooming.test.ts +1 -1
  276. package/src/ui/map.test.ts +87 -14
  277. package/src/ui/map.ts +136 -106
  278. package/src/ui/map_events.test.ts +1 -1
  279. package/src/ui/marker.test.ts +12 -12
  280. package/src/ui/marker.ts +37 -37
  281. package/src/ui/popup.test.ts +7 -7
  282. package/src/ui/popup.ts +9 -9
  283. package/src/util/actor.test.ts +41 -10
  284. package/src/util/actor.ts +8 -8
  285. package/src/util/ajax.test.ts +29 -21
  286. package/src/util/ajax.ts +51 -30
  287. package/src/util/browser.ts +1 -1
  288. package/src/util/classify_rings.test.ts +1 -1
  289. package/src/util/color_ramp.ts +5 -5
  290. package/src/util/config.ts +2 -2
  291. package/src/util/dispatcher.ts +1 -1
  292. package/src/util/dom.ts +2 -2
  293. package/src/util/evented.ts +1 -1
  294. package/src/util/find_pole_of_inaccessibility.ts +3 -3
  295. package/src/util/image.ts +5 -5
  296. package/src/util/performance.ts +7 -7
  297. package/src/util/request_manager.ts +4 -4
  298. package/src/util/resolve_tokens.ts +4 -4
  299. package/src/util/struct_array.test.ts +1 -1
  300. package/src/util/struct_array.ts +15 -15
  301. package/src/util/task_queue.ts +3 -3
  302. package/src/util/tile_request_cache.ts +3 -3
  303. package/src/util/transferable_grid_index.ts +4 -4
  304. package/src/util/util.ts +8 -8
  305. package/src/util/web_worker.ts +4 -68
  306. package/src/util/web_worker_transfer.test.ts +3 -0
  307. package/src/util/web_worker_transfer.ts +21 -17
  308. package/src/util/worker_pool.ts +1 -1
  309. package/build/.eslintrc +0 -21
  310. package/build/glsl_to_js.js +0 -12
  311. package/build/post-ts-build.js +0 -43
  312. package/build/release-notes.md.ejs +0 -8
  313. package/build/test/build-tape.js +0 -17
  314. package/build/web_worker_replacement.js +0 -5
  315. package/dist/package.json +0 -1
  316. package/src/style-spec/validate_spec.test.ts +0 -29
  317. package/src/symbol/shaping.test.ts +0 -392
  318. 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 {
@@ -560,6 +579,7 @@ export declare type SymbolLayerSpecification = {
560
579
  "symbol-sort-key"?: DataDrivenPropertyValueSpecification<number>;
561
580
  "symbol-z-order"?: PropertyValueSpecification<"auto" | "viewport-y" | "source">;
562
581
  "icon-allow-overlap"?: PropertyValueSpecification<boolean>;
582
+ "icon-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
563
583
  "icon-ignore-placement"?: PropertyValueSpecification<boolean>;
564
584
  "icon-optional"?: PropertyValueSpecification<boolean>;
565
585
  "icon-rotation-alignment"?: PropertyValueSpecification<"map" | "viewport" | "auto">;
@@ -604,6 +624,7 @@ export declare type SymbolLayerSpecification = {
604
624
  number
605
625
  ]>;
606
626
  "text-allow-overlap"?: PropertyValueSpecification<boolean>;
627
+ "text-overlap"?: PropertyValueSpecification<"never" | "always" | "cooperative">;
607
628
  "text-ignore-placement"?: PropertyValueSpecification<boolean>;
608
629
  "text-optional"?: PropertyValueSpecification<boolean>;
609
630
  "visibility"?: "visible" | "none";
@@ -824,45 +845,45 @@ export declare class LngLatBounds {
824
845
  */
825
846
  getSouthWest(): LngLat;
826
847
  /**
827
- * Returns the northeast corner of the bounding box.
828
- *
829
- * @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.
830
851
  */
831
852
  getNorthEast(): LngLat;
832
853
  /**
833
- * Returns the northwest corner of the bounding box.
834
- *
835
- * @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.
836
857
  */
837
858
  getNorthWest(): LngLat;
838
859
  /**
839
- * Returns the southeast corner of the bounding box.
840
- *
841
- * @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.
842
863
  */
843
864
  getSouthEast(): LngLat;
844
865
  /**
845
- * Returns the west edge of the bounding box.
846
- *
847
- * @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.
848
869
  */
849
870
  getWest(): number;
850
871
  /**
851
- * Returns the south edge of the bounding box.
852
- *
853
- * @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.
854
875
  */
855
876
  getSouth(): number;
856
877
  /**
857
- * Returns the east edge of the bounding box.
858
- *
859
- * @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.
860
881
  */
861
882
  getEast(): number;
862
883
  /**
863
- * Returns the north edge of the bounding box.
864
- *
865
- * @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.
866
887
  */
867
888
  getNorth(): number;
868
889
  /**
@@ -892,20 +913,20 @@ export declare class LngLatBounds {
892
913
  */
893
914
  isEmpty(): boolean;
894
915
  /**
895
- * Check if the point is within the bounding box.
896
- *
897
- * @param {LngLatLike} lnglat geographic point to check against.
898
- * @returns {boolean} True if the point is within the bounding box.
899
- * @example
900
- * var llb = new maplibregl.LngLatBounds(
901
- * new maplibregl.LngLat(-73.9876, 40.7661),
902
- * new maplibregl.LngLat(-73.9397, 40.8002)
903
- * );
904
- *
905
- * var ll = new maplibregl.LngLat(-73.9567, 40.7789);
906
- *
907
- * console.log(llb.contains(ll)); // = true
908
- */
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
+ */
909
930
  contains(lnglat: LngLatLike): boolean;
910
931
  /**
911
932
  * Converts an array to a `LngLatBounds` object.
@@ -1085,7 +1106,7 @@ export declare class CanonicalTileID {
1085
1106
  key: string;
1086
1107
  constructor(z: number, x: number, y: number);
1087
1108
  equals(id: CanonicalTileID): boolean;
1088
- url(urls: Array<string>, scheme?: string | null): string;
1109
+ url(urls: Array<string>, pixelRatio: number, scheme?: string | null): string;
1089
1110
  getTilePoint(coord: MercatorCoordinate): Point;
1090
1111
  toString(): string;
1091
1112
  }
@@ -1579,6 +1600,13 @@ export declare class StructArrayLayout2i4 extends StructArray {
1579
1600
  emplaceBack(v0: number, v1: number): number;
1580
1601
  emplace(i: number, v0: number, v1: number): number;
1581
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
+ }
1582
1610
  export declare class StructArrayLayout2i4i12 extends StructArray {
1583
1611
  uint8: Uint8Array;
1584
1612
  int16: Int16Array;
@@ -1816,6 +1844,8 @@ export declare class FeatureIndexArray extends StructArrayLayout1ul2ui8 {
1816
1844
  */
1817
1845
  get(index: number): FeatureIndexStruct;
1818
1846
  }
1847
+ export declare class RasterBoundsArray extends StructArrayLayout4i8 {
1848
+ }
1819
1849
  export declare class CircleLayoutArray extends StructArrayLayout2i4 {
1820
1850
  }
1821
1851
  export declare class FillLayoutArray extends StructArrayLayout2i4 {
@@ -2351,12 +2381,12 @@ export interface StyleImageInterface {
2351
2381
  */
2352
2382
  width: number;
2353
2383
  /**
2354
- * @property {number} height
2355
- */
2384
+ * @property {number} height
2385
+ */
2356
2386
  height: number;
2357
2387
  /**
2358
2388
  * @property {Uint8Array | Uint8ClampedArray} data
2359
- */
2389
+ */
2360
2390
  data: Uint8Array | Uint8ClampedArray;
2361
2391
  /**
2362
2392
  * This method is called once before every frame where the icon will be used.
@@ -2683,8 +2713,8 @@ export declare class EdgeInsets {
2683
2713
  */
2684
2714
  export declare type PaddingOptions = {
2685
2715
  /**
2686
- * @property {number} top Padding in pixels from the top of the map canvas.
2687
- */
2716
+ * @property {number} top Padding in pixels from the top of the map canvas.
2717
+ */
2688
2718
  top: number;
2689
2719
  /**
2690
2720
  * @property {number} bottom Padding in pixels from the bottom of the map canvas.
@@ -3966,6 +3996,7 @@ export declare type SymbolLayoutProps = {
3966
3996
  "symbol-sort-key": DataDrivenProperty<number>;
3967
3997
  "symbol-z-order": DataConstantProperty<"auto" | "viewport-y" | "source">;
3968
3998
  "icon-allow-overlap": DataConstantProperty<boolean>;
3999
+ "icon-overlap": DataConstantProperty<"never" | "always" | "cooperative">;
3969
4000
  "icon-ignore-placement": DataConstantProperty<boolean>;
3970
4001
  "icon-optional": DataConstantProperty<boolean>;
3971
4002
  "icon-rotation-alignment": DataConstantProperty<"map" | "viewport" | "auto">;
@@ -4010,6 +4041,7 @@ export declare type SymbolLayoutProps = {
4010
4041
  number
4011
4042
  ]>;
4012
4043
  "text-allow-overlap": DataConstantProperty<boolean>;
4044
+ "text-overlap": DataConstantProperty<"never" | "always" | "cooperative">;
4013
4045
  "text-ignore-placement": DataConstantProperty<boolean>;
4014
4046
  "text-optional": DataConstantProperty<boolean>;
4015
4047
  };
@@ -4020,6 +4052,7 @@ export declare type SymbolLayoutPropsPossiblyEvaluated = {
4020
4052
  "symbol-sort-key": PossiblyEvaluatedPropertyValue<number>;
4021
4053
  "symbol-z-order": "auto" | "viewport-y" | "source";
4022
4054
  "icon-allow-overlap": boolean;
4055
+ "icon-overlap": "never" | "always" | "cooperative";
4023
4056
  "icon-ignore-placement": boolean;
4024
4057
  "icon-optional": boolean;
4025
4058
  "icon-rotation-alignment": "map" | "viewport" | "auto";
@@ -4064,6 +4097,7 @@ export declare type SymbolLayoutPropsPossiblyEvaluated = {
4064
4097
  number
4065
4098
  ]>;
4066
4099
  "text-allow-overlap": boolean;
4100
+ "text-overlap": "never" | "always" | "cooperative";
4067
4101
  "text-ignore-placement": boolean;
4068
4102
  "text-optional": boolean;
4069
4103
  };
@@ -4127,6 +4161,7 @@ export declare class SymbolStyleLayer extends StyleLayer {
4127
4161
  _handleOverridablePaintPropertyUpdate<T, R>(name: string, oldValue: PropertyValue<T, R>, newValue: PropertyValue<T, R>): boolean;
4128
4162
  static hasPaintOverride(layout: PossiblyEvaluated<SymbolLayoutProps, SymbolLayoutPropsPossiblyEvaluated>, propertyName: string): boolean;
4129
4163
  }
4164
+ export declare type OverlapMode = "never" | "always" | "cooperative";
4130
4165
  export declare type TypedStyleLayer = CircleStyleLayer | FillStyleLayer | FillExtrusionStyleLayer | HeatmapStyleLayer | HillshadeStyleLayer | LineStyleLayer | SymbolStyleLayer;
4131
4166
  export declare type BucketParameters<Layer extends TypedStyleLayer> = {
4132
4167
  index: number;
@@ -4204,12 +4239,12 @@ export interface Bucket {
4204
4239
  upload(context: Context): void;
4205
4240
  uploadPending(): boolean;
4206
4241
  /**
4207
- * Release the WebGL resources associated with the buffers. Note that because
4208
- * buckets are shared between layers having the same layout properties, they
4209
- * must be destroyed in groups (all buckets for a tile, or all symbol buckets).
4210
- *
4211
- * @private
4212
- */
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
+ */
4213
4248
  destroy(): void;
4214
4249
  }
4215
4250
  export declare type CustomRenderMethod = (gl: WebGLRenderingContext, matrix: mat4) => void;
@@ -4351,16 +4386,16 @@ export interface CustomLayerInterface {
4351
4386
  */
4352
4387
  onAdd(map: Map, gl: WebGLRenderingContext): void;
4353
4388
  /**
4354
- * Optional method called when the layer has been removed from the Map with {@link Map#removeLayer}. This
4355
- * gives the layer a chance to clean up gl resources and event listeners.
4356
- *
4357
- * @function
4358
- * @memberof CustomLayerInterface
4359
- * @instance
4360
- * @name onRemove
4361
- * @param {Map} map The Map this custom layer was just added to.
4362
- * @param {WebGLRenderingContext} gl The gl context for the map.
4363
- */
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
+ */
4364
4399
  onRemove(map: Map, gl: WebGLRenderingContext): void;
4365
4400
  }
4366
4401
  declare abstract class StyleLayer extends Evented {
@@ -4521,19 +4556,6 @@ export declare class LineAtlas {
4521
4556
  };
4522
4557
  bind(context: Context): void;
4523
4558
  }
4524
- declare const status: {
4525
- unavailable: string;
4526
- deferred: string;
4527
- loading: string;
4528
- loaded: string;
4529
- error: string;
4530
- };
4531
- export declare type PluginState = {
4532
- pluginStatus: typeof status[keyof typeof status];
4533
- pluginURL: string;
4534
- };
4535
- export declare type PluginStateSyncCallback = (state: PluginState) => void;
4536
- declare const registerForPluginStateChange: (callback: PluginStateSyncCallback) => PluginStateSyncCallback;
4537
4559
  export declare type MessageListener = (a: {
4538
4560
  data: any;
4539
4561
  target: any;
@@ -4577,6 +4599,112 @@ export declare class Dispatcher {
4577
4599
  getActor(): Actor;
4578
4600
  remove(): void;
4579
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
+ }
4580
4708
  export declare type MapLayerMouseEvent = MapMouseEvent & {
4581
4709
  features?: GeoJSON.Feature[];
4582
4710
  };
@@ -4806,8 +4934,8 @@ export interface MapStyleImageMissingEvent extends MapLibreEvent {
4806
4934
  id: string;
4807
4935
  }
4808
4936
  /**
4809
- * MapEventType - a mapping between the event name and the event value
4810
- */
4937
+ * MapEventType - a mapping between the event name and the event value
4938
+ */
4811
4939
  export declare type MapEventType = {
4812
4940
  error: ErrorEvent;
4813
4941
  load: MapLibreEvent;
@@ -4825,6 +4953,8 @@ export declare type MapEventType = {
4825
4953
  sourcedata: MapSourceDataEvent;
4826
4954
  styledata: MapStyleDataEvent;
4827
4955
  styleimagemissing: MapStyleImageMissingEvent;
4956
+ dataabort: MapDataEvent;
4957
+ sourcedataabort: MapSourceDataEvent;
4828
4958
  boxzoomcancel: MapLibreZoomEvent;
4829
4959
  boxzoomstart: MapLibreZoomEvent;
4830
4960
  boxzoomend: MapLibreZoomEvent;
@@ -4857,913 +4987,1225 @@ export declare type MapEventType = {
4857
4987
  pitchend: MapLibreEvent<MouseEvent | TouchEvent | undefined>;
4858
4988
  wheel: MapWheelEvent;
4859
4989
  };
4860
- export declare type MapEvent = /**
4861
- * Fired when a pointing device (usually a mouse) is pressed within the map.
4862
- *
4863
- * **Note:** This event is compatible with the optional `layerId` parameter.
4864
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4865
- * the cursor is pressed while inside a visible portion of the specifed layer.
4866
- *
4867
- * @event mousedown
4868
- * @memberof Map
4869
- * @instance
4870
- * @property {MapMouseEvent} data
4871
- * @example
4872
- * // Initialize the map
4873
- * var map = new maplibregl.Map({ // map options });
4874
- * // Set an event listener
4875
- * map.on('mousedown', function() {
4876
- * console.log('A mousedown event has occurred.');
4877
- * });
4878
- * @example
4879
- * // Initialize the map
4880
- * var map = new maplibregl.Map({ // map options });
4881
- * // Set an event listener for a specific layer
4882
- * map.on('mousedown', 'poi-label', function() {
4883
- * console.log('A mousedown event has occurred on a visible portion of the poi-label layer.');
4884
- * });
4885
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
4886
- */ "mousedown"
4990
+ export declare type MapEvent =
4887
4991
  /**
4888
- * Fired when a pointing device (usually a mouse) is released within the map.
4889
- *
4890
- * **Note:** This event is compatible with the optional `layerId` parameter.
4891
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4892
- * the cursor is released while inside a visible portion of the specifed layer.
4893
- *
4894
- * @event mouseup
4895
- * @memberof Map
4896
- * @instance
4897
- * @property {MapMouseEvent} data
4898
- * @example
4899
- * // Initialize the map
4900
- * var map = new maplibregl.Map({ // map options });
4901
- * // Set an event listener
4902
- * map.on('mouseup', function() {
4903
- * console.log('A mouseup event has occurred.');
4904
- * });
4905
- * @example
4906
- * // Initialize the map
4907
- * var map = new maplibregl.Map({ // map options });
4908
- * // Set an event listener for a specific layer
4909
- * map.on('mouseup', 'poi-label', function() {
4910
- * console.log('A mouseup event has occurred on a visible portion of the poi-label layer.');
4911
- * });
4912
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
4913
- */ | "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"
4914
5019
  /**
4915
- * Fired when a pointing device (usually a mouse) is moved within the map.
4916
- * As you move the cursor across a web page containing a map,
4917
- * the event will fire each time it enters the map or any child elements.
4918
- *
4919
- * **Note:** This event is compatible with the optional `layerId` parameter.
4920
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4921
- * the cursor is moved inside a visible portion of the specifed layer.
4922
- *
4923
- * @event mouseover
4924
- * @memberof Map
4925
- * @instance
4926
- * @property {MapMouseEvent} data
4927
- * @example
4928
- * // Initialize the map
4929
- * var map = new maplibregl.Map({ // map options });
4930
- * // Set an event listener
4931
- * map.on('mouseover', function() {
4932
- * console.log('A mouseover event has occurred.');
4933
- * });
4934
- * @example
4935
- * // Initialize the map
4936
- * var map = new maplibregl.Map({ // map options });
4937
- * // Set an event listener for a specific layer
4938
- * map.on('mouseover', 'poi-label', function() {
4939
- * console.log('A mouseover event has occurred on a visible portion of the poi-label layer.');
4940
- * });
4941
- * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
4942
- * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
4943
- * @see [Display a popup on hover](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
4944
- */ | "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"
4945
5047
  /**
4946
- * Fired when a pointing device (usually a mouse) is moved while the cursor is inside the map.
4947
- * As you move the cursor across the map, the event will fire every time the cursor changes position within the map.
4948
- *
4949
- * **Note:** This event is compatible with the optional `layerId` parameter.
4950
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4951
- * the cursor is inside a visible portion of the specified layer.
4952
- *
4953
- * @event mousemove
4954
- * @memberof Map
4955
- * @instance
4956
- * @property {MapMouseEvent} data
4957
- * @example
4958
- * // Initialize the map
4959
- * var map = new maplibregl.Map({ // map options });
4960
- * // Set an event listener
4961
- * map.on('mousemove', function() {
4962
- * console.log('A mousemove event has occurred.');
4963
- * });
4964
- * @example
4965
- * // Initialize the map
4966
- * var map = new maplibregl.Map({ // map options });
4967
- * // Set an event listener for a specific layer
4968
- * map.on('mousemove', 'poi-label', function() {
4969
- * console.log('A mousemove event has occurred on a visible portion of the poi-label layer.');
4970
- * });
4971
- * @see [Get coordinates of the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/mouse-position/)
4972
- * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
4973
- * @see [Display a popup on over](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-hover/)
4974
- */ | "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"
4975
5079
  /**
4976
- * Fired when a pointing device (usually a mouse) is pressed and released at the same point on the map.
4977
- *
4978
- * **Note:** This event is compatible with the optional `layerId` parameter.
4979
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only when the
4980
- * point that is pressed and released contains a visible portion of the specifed layer.
4981
- *
4982
- * @event click
4983
- * @memberof Map
4984
- * @instance
4985
- * @property {MapMouseEvent} data
4986
- * @example
4987
- * // Initialize the map
4988
- * var map = new maplibregl.Map({ // map options });
4989
- * // Set an event listener
4990
- * map.on('click', function(e) {
4991
- * console.log('A click event has occurred at ' + e.lngLat);
4992
- * });
4993
- * @example
4994
- * // Initialize the map
4995
- * var map = new maplibregl.Map({ // map options });
4996
- * // Set an event listener for a specific layer
4997
- * map.on('click', 'poi-label', function(e) {
4998
- * console.log('A click event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
4999
- * });
5000
- * @see [Measure distances](https://maplibre.org/maplibre-gl-js-docs/example/measure/)
5001
- * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
5002
- */ | "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"
5003
5110
  /**
5004
- * Fired when a pointing device (usually a mouse) is pressed and released twice at the same point on
5005
- * the map in rapid succession.
5006
- *
5007
- * **Note:** This event is compatible with the optional `layerId` parameter.
5008
- * If `layerId` is included as the second argument in {@link Map#on}, the event listener will fire only
5009
- * when the point that is clicked twice contains a visible portion of the specifed layer.
5010
- *
5011
- * @event dblclick
5012
- * @memberof Map
5013
- * @instance
5014
- * @property {MapMouseEvent} data
5015
- * @example
5016
- * // Initialize the map
5017
- * var map = new maplibregl.Map({ // map options });
5018
- * // Set an event listener
5019
- * map.on('dblclick', function(e) {
5020
- * console.log('A dblclick event has occurred at ' + e.lngLat);
5021
- * });
5022
- * @example
5023
- * // Initialize the map
5024
- * var map = new maplibregl.Map({ // map options });
5025
- * // Set an event listener for a specific layer
5026
- * map.on('dblclick', 'poi-label', function(e) {
5027
- * console.log('A dblclick event has occurred on a visible portion of the poi-label layer at ' + e.lngLat);
5028
- * });
5029
- */ | "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"
5030
5139
  /**
5031
- * Fired when a pointing device (usually a mouse) enters a visible portion of a specified layer from
5032
- * outside that layer or outside the map canvas.
5033
- *
5034
- * **Important:** This event can only be listened for when {@link Map#on} includes three arguments,
5035
- * where the second argument specifies the desired layer.
5036
- *
5037
- * @event mouseenter
5038
- * @memberof Map
5039
- * @instance
5040
- * @property {MapMouseEvent} data
5041
- * @example
5042
- * // Initialize the map
5043
- * var map = new maplibregl.Map({ // map options });
5044
- * // Set an event listener
5045
- * map.on('mouseenter', 'water', function() {
5046
- * console.log('A mouseenter event occurred on a visible portion of the water layer.');
5047
- * });
5048
- * @see [Center the map on a clicked symbol](https://maplibre.org/maplibre-gl-js-docs/example/center-on-symbol/)
5049
- * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
5050
- */ | "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"
5051
5167
  /**
5052
- * Fired when a pointing device (usually a mouse) leaves a visible portion of a specified layer, or leaves
5053
- * the map canvas.
5054
- *
5055
- * **Important:** This event can only be listened for when {@link Map#on} includes three arguements,
5056
- * where the second argument specifies the desired layer.
5057
- *
5058
- * @event mouseleave
5059
- * @memberof Map
5060
- * @instance
5061
- * @property {MapMouseEvent} data
5062
- * @example
5063
- * // Initialize the map
5064
- * var map = new maplibregl.Map({ // map options });
5065
- * // Set an event listener that fires
5066
- * // when the pointing device leaves
5067
- * // a visible portion of the specified layer.
5068
- * map.on('mouseleave', 'water', function() {
5069
- * console.log('A mouseleave event occurred.');
5070
- * });
5071
- * @see [Highlight features under the mouse pointer](https://maplibre.org/maplibre-gl-js-docs/example/hover-styles/)
5072
- * @see [Display a popup on click](https://maplibre.org/maplibre-gl-js-docs/example/popup-on-click/)
5073
- */ | "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"
5074
5189
  /**
5075
- * Fired when a point device (usually a mouse) leaves the map's canvas.
5076
- *
5077
- * @event mouseout
5078
- * @memberof Map
5079
- * @instance
5080
- * @property {MapMouseEvent} data
5081
- * @example
5082
- * // Initialize the map
5083
- * var map = new maplibregl.Map({ // map options });
5084
- * // Set an event listener that fires
5085
- * // when the pointing device leave's
5086
- * // the map's canvas.
5087
- * map.on('mouseout', function() {
5088
- * console.log('A mouseout event occurred.');
5089
- * });
5090
- */ | "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"
5091
5213
  /**
5092
- * Fired when the right button of the mouse is clicked or the context menu key is pressed within the map.
5093
- *
5094
- * @event contextmenu
5095
- * @memberof Map
5096
- * @instance
5097
- * @property {MapMouseEvent} data
5098
- * @example
5099
- * // Initialize the map
5100
- * var map = new maplibregl.Map({ // map options });
5101
- * // Set an event listener that fires
5102
- * // when the right mouse button is
5103
- * // pressed within the map.
5104
- * map.on('contextmenu', function() {
5105
- * console.log('A contextmenu event occurred.');
5106
- * });
5107
- */ | "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"
5108
5231
  /**
5109
- * Fired when a [`wheel`](https://developer.mozilla.org/en-US/docs/Web/Events/wheel) event occurs within the map.
5110
- *
5111
- * @event wheel
5112
- * @memberof Map
5113
- * @instance
5114
- * @property {MapWheelEvent} data
5115
- * @example
5116
- * // Initialize the map
5117
- * var map = new maplibregl.Map({ // map options });
5118
- * // Set an event listener that fires
5119
- * // when a wheel event occurs within the map.
5120
- * map.on('wheel', function() {
5121
- * console.log('A wheel event occurred.');
5122
- * });
5123
- */ | "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"
5124
5249
  /**
5125
- * Fired when a [`touchstart`](https://developer.mozilla.org/en-US/docs/Web/Events/touchstart) event occurs within the map.
5126
- *
5127
- * @event touchstart
5128
- * @memberof Map
5129
- * @instance
5130
- * @property {MapTouchEvent} data
5131
- * // Initialize the map
5132
- * var map = new maplibregl.Map({ // map options });
5133
- * // Set an event listener that fires
5134
- * // when a touchstart event occurs within the map.
5135
- * map.on('touchstart', function() {
5136
- * console.log('A touchstart event occurred.');
5137
- * });
5138
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
5139
- */ | "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"
5140
5266
  /**
5141
- * Fired when a [`touchend`](https://developer.mozilla.org/en-US/docs/Web/Events/touchend) event occurs within the map.
5142
- *
5143
- * @event touchend
5144
- * @memberof Map
5145
- * @instance
5146
- * @property {MapTouchEvent} data
5147
- * @example
5148
- * // Initialize the map
5149
- * var map = new maplibregl.Map({ // map options });
5150
- * // Set an event listener that fires
5151
- * // when a touchstart event occurs within the map.
5152
- * map.on('touchstart', function() {
5153
- * console.log('A touchstart event occurred.');
5154
- * });
5155
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
5156
- */ | "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"
5157
5283
  /**
5158
- * Fired when a [`touchmove`](https://developer.mozilla.org/en-US/docs/Web/Events/touchmove) event occurs within the map.
5159
- *
5160
- * @event touchmove
5161
- * @memberof Map
5162
- * @instance
5163
- * @property {MapTouchEvent} data
5164
- * @example
5165
- * // Initialize the map
5166
- * var map = new maplibregl.Map({ // map options });
5167
- * // Set an event listener that fires
5168
- * // when a touchmove event occurs within the map.
5169
- * map.on('touchmove', function() {
5170
- * console.log('A touchmove event occurred.');
5171
- * });
5172
- * @see [Create a draggable point](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-point/)
5173
- */ | "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"
5174
5301
  /**
5175
- * Fired when a [`touchcancel`](https://developer.mozilla.org/en-US/docs/Web/Events/touchcancel) event occurs within the map.
5176
- *
5177
- * @event touchcancel
5178
- * @memberof Map
5179
- * @instance
5180
- * @property {MapTouchEvent} data
5181
- * @example
5182
- * // Initialize the map
5183
- * var map = new maplibregl.Map({ // map options });
5184
- * // Set an event listener that fires
5185
- * // when a touchcancel event occurs within the map.
5186
- * map.on('touchcancel', function() {
5187
- * console.log('A touchcancel event occurred.');
5188
- * });
5189
- */ | "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"
5190
5319
  /**
5191
- * Fired just before the map begins a transition from one
5192
- * view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
5193
- *
5194
- * @event movestart
5195
- * @memberof Map
5196
- * @instance
5197
- * @property {{originalEvent: DragEvent}} data
5198
- * @example
5199
- * // Initialize the map
5200
- * var map = new maplibregl.Map({ // map options });
5201
- * // Set an event listener that fires
5202
- * // just before the map begins a transition
5203
- * // from one view to another.
5204
- * map.on('movestart', function() {
5205
- * console.log('A movestart` event occurred.');
5206
- * });
5207
- */ | "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"
5208
5336
  /**
5209
- * Fired repeatedly during an animated transition from one view to
5210
- * another, as the result of either user interaction or methods such as {@link Map#flyTo}.
5211
- *
5212
- * @event move
5213
- * @memberof Map
5214
- * @instance
5215
- * @property {MapMouseEvent | MapTouchEvent} data
5216
- * @example
5217
- * // Initialize the map
5218
- * var map = new maplibregl.Map({ // map options });
5219
- * // Set an event listener that fires
5220
- * // repeatedly during an animated transition.
5221
- * map.on('move', function() {
5222
- * console.log('A move event occurred.');
5223
- * });
5224
- * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
5225
- */ | "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"
5226
5355
  /**
5227
- * Fired just after the map completes a transition from one
5228
- * view to another, as the result of either user interaction or methods such as {@link Map#jumpTo}.
5229
- *
5230
- * @event moveend
5231
- * @memberof Map
5232
- * @instance
5233
- * @property {{originalEvent: DragEvent}} data
5234
- * @example
5235
- * // Initialize the map
5236
- * var map = new maplibregl.Map({ // map options });
5237
- * // Set an event listener that fires
5238
- * // just after the map completes a transition.
5239
- * map.on('moveend', function() {
5240
- * console.log('A moveend event occurred.');
5241
- * });
5242
- * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
5243
- */ | "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"
5244
5374
  /**
5245
- * Fired when a "drag to pan" interaction starts. See {@link DragPanHandler}.
5246
- *
5247
- * @event dragstart
5248
- * @memberof Map
5249
- * @instance
5250
- * @property {{originalEvent: DragEvent}} data
5251
- * @example
5252
- * // Initialize the map
5253
- * var map = new maplibregl.Map({ // map options });
5254
- * // Set an event listener that fires
5255
- * // when a "drag to pan" interaction starts.
5256
- * map.on('dragstart', function() {
5257
- * console.log('A dragstart event occurred.');
5258
- * });
5259
- */ | "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"
5260
5393
  /**
5261
- * Fired repeatedly during a "drag to pan" interaction. See {@link DragPanHandler}.
5262
- *
5263
- * @event drag
5264
- * @memberof Map
5265
- * @instance
5266
- * @property {MapMouseEvent | MapTouchEvent} data
5267
- * @example
5268
- * // Initialize the map
5269
- * var map = new maplibregl.Map({ // map options });
5270
- * // Set an event listener that fires
5271
- * // repeatedly during a "drag to pan" interaction.
5272
- * map.on('drag', function() {
5273
- * console.log('A drag event occurred.');
5274
- * });
5275
- */ | "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"
5276
5410
  /**
5277
- * Fired when a "drag to pan" interaction ends. See {@link DragPanHandler}.
5278
- *
5279
- * @event dragend
5280
- * @memberof Map
5281
- * @instance
5282
- * @property {{originalEvent: DragEvent}} data
5283
- * @example
5284
- * // Initialize the map
5285
- * var map = new maplibregl.Map({ // map options });
5286
- * // Set an event listener that fires
5287
- * // when a "drag to pan" interaction ends.
5288
- * map.on('dragend', function() {
5289
- * console.log('A dragend event occurred.');
5290
- * });
5291
- * @see [Create a draggable marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
5292
- */ | "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"
5293
5427
  /**
5294
- * Fired just before the map begins a transition from one zoom level to another,
5295
- * as the result of either user interaction or methods such as {@link Map#flyTo}.
5296
- *
5297
- * @event zoomstart
5298
- * @memberof Map
5299
- * @instance
5300
- * @property {MapMouseEvent | MapTouchEvent} data
5301
- * @example
5302
- * // Initialize the map
5303
- * var map = new maplibregl.Map({ // map options });
5304
- * // Set an event listener that fires
5305
- * // just before a zoom transition starts.
5306
- * map.on('zoomstart', function() {
5307
- * console.log('A zoomstart event occurred.');
5308
- * });
5309
- */ | "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"
5310
5445
  /**
5311
- * Fired repeatedly during an animated transition from one zoom level to another,
5312
- * as the result of either user interaction or methods such as {@link Map#flyTo}.
5313
- *
5314
- * @event zoom
5315
- * @memberof Map
5316
- * @instance
5317
- * @property {MapMouseEvent | MapTouchEvent} data
5318
- * @example
5319
- * // Initialize the map
5320
- * var map = new maplibregl.Map({ // map options });
5321
- * // Set an event listener that fires
5322
- * // repeatedly during a zoom transition.
5323
- * map.on('zoom', function() {
5324
- * console.log('A zoom event occurred.');
5325
- * });
5326
- */ | "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"
5327
5463
  /**
5328
- * Fired just after the map completes a transition from one zoom level to another,
5329
- * as the result of either user interaction or methods such as {@link Map#flyTo}.
5330
- *
5331
- * @event zoomend
5332
- * @memberof Map
5333
- * @instance
5334
- * @property {MapMouseEvent | MapTouchEvent} data
5335
- * @example
5336
- * // Initialize the map
5337
- * var map = new maplibregl.Map({ // map options });
5338
- * // Set an event listener that fires
5339
- * // just after a zoom transition finishes.
5340
- * map.on('zoomend', function() {
5341
- * console.log('A zoomend event occurred.');
5342
- * });
5343
- */ | "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"
5344
5481
  /**
5345
- * Fired when a "drag to rotate" interaction starts. See {@link DragRotateHandler}.
5346
- *
5347
- * @event rotatestart
5348
- * @memberof Map
5349
- * @instance
5350
- * @property {MapMouseEvent | MapTouchEvent} data
5351
- * @example
5352
- * // Initialize the map
5353
- * var map = new maplibregl.Map({ // map options });
5354
- * // Set an event listener that fires
5355
- * // just before a "drag to rotate" interaction starts.
5356
- * map.on('rotatestart', function() {
5357
- * console.log('A rotatestart event occurred.');
5358
- * });
5359
- */ | "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"
5360
5499
  /**
5361
- * Fired repeatedly during a "drag to rotate" interaction. See {@link DragRotateHandler}.
5362
- *
5363
- * @event rotate
5364
- * @memberof Map
5365
- * @instance
5366
- * @property {MapMouseEvent | MapTouchEvent} data
5367
- * @example
5368
- * // Initialize the map
5369
- * var map = new maplibregl.Map({ // map options });
5370
- * // Set an event listener that fires
5371
- * // repeatedly during "drag to rotate" interaction.
5372
- * map.on('rotate', function() {
5373
- * console.log('A rotate event occurred.');
5374
- * });
5375
- */ | "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"
5376
5516
  /**
5377
- * Fired when a "drag to rotate" interaction ends. See {@link DragRotateHandler}.
5378
- *
5379
- * @event rotateend
5380
- * @memberof Map
5381
- * @instance
5382
- * @property {MapMouseEvent | MapTouchEvent} data
5383
- * @example
5384
- * // Initialize the map
5385
- * var map = new maplibregl.Map({ // map options });
5386
- * // Set an event listener that fires
5387
- * // just after a "drag to rotate" interaction ends.
5388
- * map.on('rotateend', function() {
5389
- * console.log('A rotateend event occurred.');
5390
- * });
5391
- */ | "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"
5392
5533
  /**
5393
- * Fired whenever the map's pitch (tilt) begins a change as
5394
- * the result of either user interaction or methods such as {@link Map#flyTo} .
5395
- *
5396
- * @event pitchstart
5397
- * @memberof Map
5398
- * @instance
5399
- * @property {MapEventData} data
5400
- * @example
5401
- * // Initialize the map
5402
- * var map = new maplibregl.Map({ // map options });
5403
- * // Set an event listener that fires
5404
- * // just before a pitch (tilt) transition starts.
5405
- * map.on('pitchstart', function() {
5406
- * console.log('A pitchstart event occurred.');
5407
- * });
5408
- */ | "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"
5409
5550
  /**
5410
- * Fired repeatedly during the map's pitch (tilt) animation between
5411
- * one state and another as the result of either user interaction
5412
- * or methods such as {@link Map#flyTo}.
5413
- *
5414
- * @event pitch
5415
- * @memberof Map
5416
- * @instance
5417
- * @property {MapEventData} data
5418
- * @example
5419
- * // Initialize the map
5420
- * var map = new maplibregl.Map({ // map options });
5421
- * // Set an event listener that fires
5422
- * // repeatedly during a pitch (tilt) transition.
5423
- * map.on('pitch', function() {
5424
- * console.log('A pitch event occurred.');
5425
- * });
5426
- */ | "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"
5427
5568
  /**
5428
- * Fired immediately after the map's pitch (tilt) finishes changing as
5429
- * the result of either user interaction or methods such as {@link Map#flyTo}.
5430
- *
5431
- * @event pitchend
5432
- * @memberof Map
5433
- * @instance
5434
- * @property {MapEventData} data
5435
- * @example
5436
- * // Initialize the map
5437
- * var map = new maplibregl.Map({ // map options });
5438
- * // Set an event listener that fires
5439
- * // just after a pitch (tilt) transition ends.
5440
- * map.on('pitchend', function() {
5441
- * console.log('A pitchend event occurred.');
5442
- * });
5443
- */ | "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"
5444
5587
  /**
5445
- * Fired when a "box zoom" interaction starts. See {@link BoxZoomHandler}.
5446
- *
5447
- * @event boxzoomstart
5448
- * @memberof Map
5449
- * @instance
5450
- * @property {MapLibreZoomEvent} data
5451
- * @example
5452
- * // Initialize the map
5453
- * var map = new maplibregl.Map({ // map options });
5454
- * // Set an event listener that fires
5455
- * // just before a "box zoom" interaction starts.
5456
- * map.on('boxzoomstart', function() {
5457
- * console.log('A boxzoomstart event occurred.');
5458
- * });
5459
- */ | "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"
5460
5605
  /**
5461
- * Fired when a "box zoom" interaction ends. See {@link BoxZoomHandler}.
5462
- *
5463
- * @event boxzoomend
5464
- * @memberof Map
5465
- * @instance
5466
- * @type {Object}
5467
- * @property {MapLibreZoomEvent} data
5468
- * @example
5469
- * // Initialize the map
5470
- * var map = new maplibregl.Map({ // map options });
5471
- * // Set an event listener that fires
5472
- * // just after a "box zoom" interaction ends.
5473
- * map.on('boxzoomend', function() {
5474
- * console.log('A boxzoomend event occurred.');
5475
- * });
5476
- */ | "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"
5477
5622
  /**
5478
- * Fired when the user cancels a "box zoom" interaction, or when the bounding box does not meet the minimum size threshold.
5479
- * See {@link BoxZoomHandler}.
5480
- *
5481
- * @event boxzoomcancel
5482
- * @memberof Map
5483
- * @instance
5484
- * @property {MapLibreZoomEvent} data
5485
- * @example
5486
- * // Initialize the map
5487
- * var map = new maplibregl.Map({ // map options });
5488
- * // Set an event listener that fires
5489
- * // the user cancels a "box zoom" interaction.
5490
- * map.on('boxzoomcancel', function() {
5491
- * console.log('A boxzoomcancel event occurred.');
5492
- * });
5493
- */ | "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"
5494
5640
  /**
5495
- * Fired immediately after the map has been resized.
5496
- *
5497
- * @event resize
5498
- * @memberof Map
5499
- * @instance
5500
- * @example
5501
- * // Initialize the map
5502
- * var map = new maplibregl.Map({ // map options });
5503
- * // Set an event listener that fires
5504
- * // immediately after the map has been resized.
5505
- * map.on('resize', function() {
5506
- * console.log('A resize event occurred.');
5507
- * });
5508
- */ | "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"
5509
5658
  /**
5510
- * Fired when the WebGL context is lost.
5511
- *
5512
- * @event webglcontextlost
5513
- * @memberof Map
5514
- * @instance
5515
- * @example
5516
- * // Initialize the map
5517
- * var map = new maplibregl.Map({ // map options });
5518
- * // Set an event listener that fires
5519
- * // when the WebGL context is lost.
5520
- * map.on('webglcontextlost', function() {
5521
- * console.log('A webglcontextlost event occurred.');
5522
- * });
5523
- */ | "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"
5524
5674
  /**
5525
- * Fired when the WebGL context is restored.
5526
- *
5527
- * @event webglcontextrestored
5528
- * @memberof Map
5529
- * @instance
5530
- * @example
5531
- * // Initialize the map
5532
- * var map = new maplibregl.Map({ // map options });
5533
- * // Set an event listener that fires
5534
- * // when the WebGL context is restored.
5535
- * map.on('webglcontextrestored', function() {
5536
- * console.log('A webglcontextrestored event occurred.');
5537
- * });
5538
- */ | "webglcontextrestored"
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"
5940
+ /**
5941
+ * @event style.load
5942
+ * @memberof Map
5943
+ * @instance
5944
+ * @private
5945
+ */
5946
+ | "style.load"
5539
5947
  /**
5540
- * Fired immediately after all necessary resources have been downloaded
5541
- * and the first visually complete rendering of the map has occurred.
5542
- *
5543
- * @event load
5544
- * @memberof Map
5545
- * @instance
5546
- * @type {Object}
5547
- * @example
5548
- * // Initialize the map
5549
- * var map = new maplibregl.Map({ // map options });
5550
- * // Set an event listener that fires
5551
- * // when the map has finished loading.
5552
- * map.on('load', function() {
5553
- * console.log('A load event occurred.');
5554
- * });
5555
- * @see [Draw GeoJSON points](https://maplibre.org/maplibre-gl-js-docs/example/geojson-markers/)
5556
- * @see [Add live realtime data](https://maplibre.org/maplibre-gl-js-docs/example/live-geojson/)
5557
- * @see [Animate a point](https://maplibre.org/maplibre-gl-js-docs/example/animate-point-along-line/)
5558
- */ | "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"
5559
5965
  /**
5560
- * Fired whenever the map is drawn to the screen, as the result of
5561
- *
5562
- * - a change to the map's position, zoom, pitch, or bearing
5563
- * - a change to the map's style
5564
- * - a change to a GeoJSON source
5565
- * - 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.
5566
6013
  *
5567
- * @event render
5568
- * @memberof Map
5569
- * @instance
5570
- * @example
5571
- * // Initialize the map
5572
- * var map = new maplibregl.Map({ // map options });
5573
- * // Set an event listener that fires
5574
- * // whenever the map is drawn to the screen.
5575
- * map.on('render', function() {
5576
- * console.log('A render event occurred.');
5577
- * });
5578
- */ | "render"
5579
- /**
5580
- * Fired after the last frame rendered before the map enters an
5581
- * "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.
5582
6020
  *
5583
- * - No camera transitions are in progress
5584
- * - All currently requested tiles have loaded
5585
- * - 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).
5586
6028
  *
5587
- * @event idle
5588
- * @memberof Map
5589
- * @instance
5590
- * @example
5591
- * // Initialize the map
5592
- * var map = new maplibregl.Map({ // map options });
5593
- * // Set an event listener that fires
5594
- * // just before the map enters an "idle" state.
5595
- * map.on('idle', function() {
5596
- * console.log('A idle event occurred.');
5597
- * });
5598
- */ | "idle"
5599
- /**
5600
- * 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).
5601
6036
  *
5602
- * @event remove
5603
- * @memberof Map
5604
- * @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
5605
6042
  * @example
5606
- * // Initialize the map
5607
- * var map = new maplibregl.Map({ // map options });
5608
- * // Set an event listener that fires
5609
- * // just after the map is removed.
5610
- * map.on('remove', function() {
5611
- * console.log('A remove event occurred.');
5612
- * });
5613
- */ | "remove"
5614
- /**
5615
- * Fired when an error occurs. This is GL JS's primary error reporting
5616
- * mechanism. We use an event instead of `throw` to better accommodate
5617
- * asyncronous operations. If no listeners are bound to the `error` event, the
5618
- * error will be printed to the console.
5619
- *
5620
- * @event error
5621
- * @memberof Map
5622
- * @instance
5623
- * @property {{error: {message: string}}} data
5624
- * @example
5625
- * // Initialize the map
5626
- * var map = new maplibregl.Map({ // map options });
5627
- * // Set an event listener that fires
5628
- * // when an error occurs.
5629
- * map.on('error', function() {
5630
- * console.log('A error event occurred.');
5631
- * });
5632
- */ | "error"
5633
- /**
5634
- * Fired when any map data loads or changes. See {@link MapDataEvent}
5635
- * 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
+ * });
5636
6048
  *
5637
- * @event data
5638
- * @memberof Map
5639
- * @instance
5640
- * @property {MapDataEvent} data
5641
- * @example
5642
- * // Initialize the map
5643
- * var map = new maplibregl.Map({ // map options });
5644
- * // Set an event listener that fires
5645
- * // when map data loads or changes.
5646
- * map.on('data', function() {
5647
- * console.log('A data event occurred.');
5648
- * });
5649
- * @see [Display HTML clusters with custom properties](https://maplibre.org/maplibre-gl-js-docs/example/cluster-html/)
5650
- */ | "data"
5651
- /**
5652
- * Fired when the map's style loads or changes. See
5653
- * {@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');
5654
6052
  *
5655
- * @event styledata
5656
- * @memberof Map
5657
- * @instance
5658
- * @property {MapDataEvent} data
5659
- * @example
5660
- * // Initialize the map
5661
- * var map = new maplibregl.Map({ // map options });
5662
- * // Set an event listener that fires
5663
- * // when the map's style loads or changes.
5664
- * map.on('styledata', function() {
5665
- * 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
+ * })
5666
6057
  * });
5667
- */ | "styledata"
5668
- /**
5669
- * Fired when one of the map's sources loads or changes, including if a tile belonging
5670
- * to a source loads or changes. See {@link MapDataEvent} for more information.
5671
- *
5672
- * @event sourcedata
5673
- * @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
5674
6108
  * @instance
5675
- * @property {MapDataEvent} data
5676
- * @example
5677
- * // Initialize the map
5678
- * var map = new maplibregl.Map({ // map options });
5679
- * // Set an event listener that fires
5680
- * // when one of the map's sources loads or changes.
5681
- * map.on('sourcedata', function() {
5682
- * console.log('A sourcedata event occurred.');
5683
- * });
5684
- */ | "sourcedata"
5685
- /**
5686
- * Fired when any map data (style, source, tile, etc) begins loading or
5687
- * changing asyncronously. All `dataloading` events are followed by a `data`
5688
- * or `error` event. See {@link MapDataEvent} for more information.
5689
- *
5690
- * @event dataloading
5691
- * @memberof Map
6109
+ * @memberof CanvasSource
6110
+ */
6111
+ /**
6112
+ * Disables animation. The map will display a static copy of the canvas image.
6113
+ * @method pause
5692
6114
  * @instance
5693
- * @property {MapDataEvent} data
5694
- * @example
5695
- * // Initialize the map
5696
- * var map = new maplibregl.Map({ // map options });
5697
- * // Set an event listener that fires
5698
- * // when any map data begins loading
5699
- * // or changing asynchronously.
5700
- * map.on('dataloading', function() {
5701
- * console.log('A dataloading event occurred.');
5702
- * });
5703
- */ | "dataloading"
5704
- /**
5705
- * Fired when the map's style begins loading or changing asyncronously.
5706
- * All `styledataloading` events are followed by a `styledata`
5707
- * or `error` event. See {@link MapDataEvent} for more information.
6115
+ * @memberof CanvasSource
6116
+ */
6117
+ load(): void;
6118
+ /**
6119
+ * Returns the HTML `canvas` element.
5708
6120
  *
5709
- * @event styledataloading
5710
- * @memberof Map
5711
- * @instance
5712
- * @property {MapDataEvent} data
5713
- * @example
5714
- * // Initialize the map
5715
- * var map = new maplibregl.Map({ // map options });
5716
- * // Set an event listener that fires
5717
- * // map's style begins loading or
5718
- * // changing asyncronously.
5719
- * map.on('styledataloading', function() {
5720
- * console.log('A styledataloading event occurred.');
5721
- * });
5722
- */ | "styledataloading"
5723
- /**
5724
- * Fired when one of the map's sources begins loading or changing asyncronously.
5725
- * All `sourcedataloading` events are followed by a `sourcedata` or `error` event.
5726
- * 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.
5727
6179
  *
5728
- * @event sourcedataloading
5729
- * @memberof Map
5730
- * @instance
5731
- * @property {MapDataEvent} data
5732
- * @example
5733
- * // Initialize the map
5734
- * var map = new maplibregl.Map({ // map options });
5735
- * // Set an event listener that fires
5736
- * // map's sources begin loading or
5737
- * // changing asyncronously.
5738
- * map.on('sourcedataloading', function() {
5739
- * console.log('A sourcedataloading event occurred.');
5740
- * });
5741
- */ | "sourcedataloading"
5742
- /**
5743
- * Fired when an icon or pattern needed by the style is missing. The missing image can
5744
- * be added with {@link Map#addImage} within this event listener callback to prevent the image from
5745
- * 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.
5746
6196
  *
5747
- * @event styleimagemissing
5748
- * @memberof Map
5749
- * @instance
5750
- * @property {string} id The id of the missing image.
5751
- * @example
5752
- * // Initialize the map
5753
- * var map = new maplibregl.Map({ // map options });
5754
- * // Set an event listener that fires
5755
- * // an icon or pattern is missing.
5756
- * map.on('styleimagemissing', function() {
5757
- * console.log('A styleimagemissing event occurred.');
5758
- * });
5759
- * @see [Generate and add a missing icon to the map](https://maplibre.org/maplibre-gl-js-docs/example/add-image-missing-generated/)
5760
- */ | "styleimagemissing"
5761
- /**
5762
- * @event style.load
5763
- * @memberof Map
5764
- * @instance
5765
- * @private
5766
- */ | "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
+ }
5767
6209
  /**
5768
6210
  * The `Source` interface must be implemented by each source type, including "core" types (`vector`, `raster`,
5769
6211
  * `video`, etc.) and all custom, third-party types.
@@ -5811,11 +6253,11 @@ export interface Source {
5811
6253
  readonly abortTile?: (tile: Tile, callback: Callback<void>) => void;
5812
6254
  readonly unloadTile?: (tile: Tile, callback: Callback<void>) => void;
5813
6255
  /**
5814
- * @returns A plain (stringifiable) JS object representing the current state of the source.
5815
- * Creating a source using the returned object as the `options` should result in a Source that is
5816
- * equivalent to this one.
5817
- * @private
5818
- */
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
+ */
5819
6261
  serialize(): any;
5820
6262
  readonly prepare?: () => void;
5821
6263
  }
@@ -6082,6 +6524,19 @@ export declare class SourceCache extends Evented {
6082
6524
  */
6083
6525
  reloadTilesForDependencies(namespaces: Array<string>, keys: Array<string>): void;
6084
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;
6085
6540
  export declare type QueryResult<T> = {
6086
6541
  key: T;
6087
6542
  x1: number;
@@ -6089,7 +6544,10 @@ export declare type QueryResult<T> = {
6089
6544
  x2: number;
6090
6545
  y2: number;
6091
6546
  };
6092
- export declare class GridIndex<T> {
6547
+ export declare type GridKey = {
6548
+ overlapMode?: OverlapMode;
6549
+ };
6550
+ export declare class GridIndex<T extends GridKey> {
6093
6551
  circleKeys: Array<T>;
6094
6552
  boxKeys: Array<T>;
6095
6553
  boxCells: Array<Array<number>>;
@@ -6112,8 +6570,8 @@ export declare class GridIndex<T> {
6112
6570
  private _insertCircleCell;
6113
6571
  private _query;
6114
6572
  query(x1: number, y1: number, x2: number, y2: number): Array<QueryResult<T>>;
6115
- hitTest(x1: number, y1: number, x2: number, y2: number, predicate?: (key: T) => boolean): boolean;
6116
- hitTestCircle(x: number, y: number, radius: number, predicate?: (key: T) => boolean): boolean;
6573
+ hitTest(x1: number, y1: number, x2: number, y2: number, overlapMode: OverlapMode, predicate?: (key: T) => boolean): boolean;
6574
+ hitTestCircle(x: number, y: number, radius: number, overlapMode: OverlapMode, predicate?: (key: T) => boolean): boolean;
6117
6575
  private _queryCell;
6118
6576
  private _queryCellCircle;
6119
6577
  private _forEachCell;
@@ -6126,6 +6584,7 @@ export declare type FeatureKey = {
6126
6584
  bucketInstanceId: number;
6127
6585
  featureIndex: number;
6128
6586
  collisionGroupID: number;
6587
+ overlapMode: OverlapMode;
6129
6588
  };
6130
6589
  export declare class CollisionIndex {
6131
6590
  grid: GridIndex<FeatureKey>;
@@ -6137,11 +6596,11 @@ export declare class CollisionIndex {
6137
6596
  gridRightBoundary: number;
6138
6597
  gridBottomBoundary: number;
6139
6598
  constructor(transform: Transform, grid?: GridIndex<FeatureKey>, ignoredGrid?: GridIndex<FeatureKey>);
6140
- placeCollisionBox(collisionBox: SingleCollisionBox, allowOverlap: boolean, textPixelRatio: number, posMatrix: mat4, collisionGroupPredicate?: (key: FeatureKey) => boolean): {
6599
+ placeCollisionBox(collisionBox: SingleCollisionBox, overlapMode: OverlapMode, textPixelRatio: number, posMatrix: mat4, collisionGroupPredicate?: (key: FeatureKey) => boolean): {
6141
6600
  box: Array<number>;
6142
6601
  offscreen: boolean;
6143
6602
  };
6144
- placeCollisionCircles(allowOverlap: boolean, symbol: any, lineVertexArray: SymbolLineVertexArray, glyphOffsetArray: GlyphOffsetArray, fontSize: number, posMatrix: mat4, labelPlaneMatrix: mat4, labelToScreenMatrix: mat4, showCollisionCircles: boolean, pitchWithMap: boolean, collisionGroupPredicate: (key: FeatureKey) => boolean, circlePixelDiameter: number, textPixelPadding: number): {
6603
+ placeCollisionCircles(overlapMode: OverlapMode, symbol: any, lineVertexArray: SymbolLineVertexArray, glyphOffsetArray: GlyphOffsetArray, fontSize: number, posMatrix: mat4, labelPlaneMatrix: mat4, labelToScreenMatrix: mat4, showCollisionCircles: boolean, pitchWithMap: boolean, collisionGroupPredicate: (key: FeatureKey) => boolean, circlePixelDiameter: number, textPixelPadding: number): {
6145
6604
  circles: Array<number>;
6146
6605
  offscreen: boolean;
6147
6606
  collisionDetected: boolean;
@@ -6154,8 +6613,8 @@ export declare class CollisionIndex {
6154
6613
  * @private
6155
6614
  */
6156
6615
  queryRenderedSymbols(viewportQueryGeometry: Array<Point>): {};
6157
- insertCollisionBox(collisionBox: Array<number>, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
6158
- insertCollisionCircles(collisionCircles: Array<number>, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
6616
+ insertCollisionBox(collisionBox: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
6617
+ insertCollisionCircles(collisionCircles: Array<number>, overlapMode: OverlapMode, ignorePlacement: boolean, bucketInstanceId: number, featureIndex: number, collisionGroupID: number): void;
6159
6618
  projectAndGetPerspectiveRatio(posMatrix: mat4, x: number, y: number): {
6160
6619
  point: Point;
6161
6620
  perspectiveRatio: number;
@@ -6200,7 +6659,7 @@ export declare class RetainedQueryData {
6200
6659
  }
6201
6660
  export declare type CollisionGroup = {
6202
6661
  ID: number;
6203
- predicate?: any;
6662
+ predicate?: (key: FeatureKey) => boolean;
6204
6663
  };
6205
6664
  export declare class CollisionGroups {
6206
6665
  collisionGroups: {
@@ -6276,7 +6735,7 @@ export declare class Placement {
6276
6735
  };
6277
6736
  constructor(transform: Transform, fadeDuration: number, crossSourceCollisions: boolean, prevPlacement?: Placement);
6278
6737
  getBucketParts(results: Array<BucketPart>, styleLayer: StyleLayer, tile: Tile, sortAcrossTiles: boolean): void;
6279
- attemptAnchorPlacement(anchor: TextAnchor, textBox: SingleCollisionBox, width: number, height: number, textBoxScale: number, rotateWithMap: boolean, pitchWithMap: boolean, textPixelRatio: number, posMatrix: mat4, collisionGroup: CollisionGroup, textAllowOverlap: boolean, symbolInstance: SymbolInstance, bucket: SymbolBucket, orientation: number, iconBox?: SingleCollisionBox | null): {
6738
+ attemptAnchorPlacement(anchor: TextAnchor, textBox: SingleCollisionBox, width: number, height: number, textBoxScale: number, rotateWithMap: boolean, pitchWithMap: boolean, textPixelRatio: number, posMatrix: mat4, collisionGroup: CollisionGroup, textOverlapMode: OverlapMode, symbolInstance: SymbolInstance, bucket: SymbolBucket, orientation: number, iconBox?: SingleCollisionBox | null): {
6280
6739
  shift: Point;
6281
6740
  placedGlyphBoxes: {
6282
6741
  box: Array<number>;
@@ -6493,10 +6952,10 @@ export declare class Style extends Evented {
6493
6952
  */
6494
6953
  removeSource(id: string): this;
6495
6954
  /**
6496
- * Set the data of a GeoJSON source, given its id.
6497
- * @param {string} id id of the source
6498
- * @param {GeoJSON|string} data GeoJSON source
6499
- */
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
+ */
6500
6959
  setGeoJSONSourceData(id: string, data: GeoJSON.GeoJSON | string): void;
6501
6960
  /**
6502
6961
  * Get a source by id.
@@ -6516,7 +6975,7 @@ export declare class Style extends Evented {
6516
6975
  /**
6517
6976
  * Moves a layer to a different z-position. The layer will be inserted before the layer with
6518
6977
  * ID `before`, or appended if `before` is omitted.
6519
- * @param {string} id ID of the layer to move
6978
+ * @param {string} id ID of the layer to move
6520
6979
  * @param {string} [before] ID of an existing layer to insert before
6521
6980
  */
6522
6981
  moveLayer(id: string, before?: string): void;
@@ -6640,6 +7099,7 @@ export declare class Painter {
6640
7099
  emptyProgramConfiguration: ProgramConfiguration;
6641
7100
  width: number;
6642
7101
  height: number;
7102
+ pixelRatio: number;
6643
7103
  tileExtentBuffer: VertexBuffer;
6644
7104
  tileExtentSegments: SegmentVector;
6645
7105
  debugBuffer: VertexBuffer;
@@ -6679,7 +7139,7 @@ export declare class Painter {
6679
7139
  debugOverlayTexture: Texture;
6680
7140
  debugOverlayCanvas: HTMLCanvasElement;
6681
7141
  constructor(gl: WebGLRenderingContext, transform: Transform);
6682
- resize(width: number, height: number): void;
7142
+ resize(width: number, height: number, pixelRatio: number): void;
6683
7143
  setup(): void;
6684
7144
  clearStencil(): void;
6685
7145
  _renderTileClippingMasks(layer: StyleLayer, tileIDs: Array<OverscaledTileID>): void;
@@ -7662,12 +8122,12 @@ export declare class ScrollZoomHandler {
7662
8122
  */
7663
8123
  setZoomRate(zoomRate: number): void;
7664
8124
  /**
7665
- * Set the zoom rate of a mouse wheel
7666
- * @param {number} [wheelZoomRate=1/450] The rate used to scale mouse wheel movement to a zoom value.
7667
- * @example
7668
- * // Slow down zoom of mouse wheel
7669
- * map.scrollZoom.setWheelZoomRate(1/600);
7670
- */
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
+ */
7671
8131
  setWheelZoomRate(wheelZoomRate: number): void;
7672
8132
  /**
7673
8133
  * Returns a Boolean indicating whether the "scroll to zoom" interaction is enabled.
@@ -8255,6 +8715,7 @@ export declare type MapOptions = {
8255
8715
  localIdeographFontFamily?: string;
8256
8716
  style: StyleSpecification | string;
8257
8717
  pitchWithRotate?: boolean;
8718
+ pixelRatio?: number;
8258
8719
  };
8259
8720
  export declare type Complete<T> = {
8260
8721
  [P in keyof Required<T>]: Pick<T, P> extends Required<Pick<T, P>> ? T[P] : (T[P] | undefined);
@@ -8304,6 +8765,7 @@ export declare class Map extends Camera {
8304
8765
  _locale: any;
8305
8766
  _removed: boolean;
8306
8767
  _clickTolerance: number;
8768
+ _pixelRatio: number;
8307
8769
  /**
8308
8770
  * The map's {@link ScrollZoomHandler}, which implements zooming in and out with a scroll wheel or trackpad.
8309
8771
  * Find more details and examples using `scrollZoom` in the {@link ScrollZoomHandler} section.
@@ -8407,6 +8869,18 @@ export declare class Map extends Camera {
8407
8869
  * if (mapDiv.style.visibility === true) map.resize();
8408
8870
  */
8409
8871
  resize(eventData?: any): this;
8872
+ /**
8873
+ * Returns the map's pixel ratio.
8874
+ * @returns {number} The pixel ratio.
8875
+ */
8876
+ getPixelRatio(): number;
8877
+ /**
8878
+ * Sets the map's pixel ratio. This allows to override `devicePixelRatio`.
8879
+ * After this call, the canvas' `width` attribute will be `container.clientWidth * pixelRatio`
8880
+ * and its height attribute will be `container.clientHeight * pixelRatio`.
8881
+ * @param {number} pixelRatio The pixel ratio.
8882
+ */
8883
+ setPixelRatio(pixelRatio: number): void;
8410
8884
  /**
8411
8885
  * Returns the map's geographical bounds. When the bearing or pitch is non-zero, the visible region is not
8412
8886
  * an axis-aligned rectangle, and the result is the smallest bounds that encompasses the visible region.
@@ -8666,6 +9140,8 @@ export declare class Map extends Camera {
8666
9140
  * | [`styledataloading`](#map.event:styledataloading) | |
8667
9141
  * | [`sourcedataloading`](#map.event:sourcedataloading) | |
8668
9142
  * | [`styleimagemissing`](#map.event:styleimagemissing) | |
9143
+ * | [`dataabort`](#map.event:dataabort) | |
9144
+ * | [`sourcedataabort`](#map.event:sourcedataabort) | |
8669
9145
  *
8670
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
8671
9147
  * is within a visible feature in this layer. The event will have a `features` property containing
@@ -8919,10 +9395,10 @@ export declare class Map extends Camera {
8919
9395
  /**
8920
9396
  * Updates the requestManager's transform request with a new function
8921
9397
  *
8922
- * @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.
8923
9399
  * Expected to return an object with a `url` property and optionally `headers` and `credentials` properties
8924
9400
  *
8925
- * @returns {Map} `this`
9401
+ * @returns {Map} `this`
8926
9402
  *
8927
9403
  * @example
8928
9404
  * map.setTransformRequest((url: string, resourceType: string) => {});
@@ -9063,9 +9539,9 @@ export declare class Map extends Camera {
9063
9539
  * @param options Options object.
9064
9540
  * @param options.pixelRatio The ratio of pixels in the image to physical pixels on the screen
9065
9541
  * @param options.sdf Whether the image should be interpreted as an SDF image
9066
- * @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`.
9067
- * @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.
9068
- * @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.
9069
9545
  *
9070
9546
  * @example
9071
9547
  * // If the style's sprite does not already contain an image with ID 'cat',
@@ -9127,7 +9603,7 @@ export declare class Map extends Camera {
9127
9603
  *
9128
9604
  * @param id The ID of the image.
9129
9605
  *
9130
- * @returns {boolean} A Boolean indicating whether the image exists.
9606
+ * @returns {boolean} A Boolean indicating whether the image exists.
9131
9607
  * @example
9132
9608
  * // Check if an image with the ID 'cat' exists in
9133
9609
  * // the style's sprite.
@@ -9166,16 +9642,16 @@ export declare class Map extends Camera {
9166
9642
  */
9167
9643
  loadImage(url: string, callback: Callback<HTMLImageElement | ImageBitmap>): void;
9168
9644
  /**
9169
- * Returns an Array of strings containing the IDs of all images currently available in the map.
9170
- * This includes both images from the style's original sprite
9171
- * and any images that have been added at runtime using {@link Map#addImage}.
9172
- *
9173
- * @returns {Array<string>} An Array of strings containing the names of all sprites/images currently available in the map.
9174
- *
9175
- * @example
9176
- * var allImages = map.listImages();
9177
- *
9178
- */
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
+ */
9179
9655
  listImages(): string[];
9180
9656
  /**
9181
9657
  * Adds a [MapLibre style layer](https://maplibre.org/maplibre-gl-js-docs/style-spec/#layers)
@@ -9534,7 +10010,7 @@ export declare class Map extends Camera {
9534
10010
  * }, 'hover');
9535
10011
  * });
9536
10012
  *
9537
- */
10013
+ */
9538
10014
  removeFeatureState(target: {
9539
10015
  source: string;
9540
10016
  sourceLayer?: string;
@@ -9604,7 +10080,7 @@ export declare class Map extends Camera {
9604
10080
  getCanvas(): HTMLCanvasElement;
9605
10081
  _containerDimensions(): number[];
9606
10082
  _setupContainer(): void;
9607
- _resizeCanvas(width: number, height: number): void;
10083
+ _resizeCanvas(width: number, height: number, pixelRatio: number): void;
9608
10084
  _setupPainter(): void;
9609
10085
  _contextLost(event: any): void;
9610
10086
  _contextRestored(event: any): void;
@@ -9650,11 +10126,11 @@ export declare class Map extends Camera {
9650
10126
  */
9651
10127
  _render(paintStartTimeStamp: number): this;
9652
10128
  /**
9653
- * Force a synchronous redraw of the map.
9654
- * @example
9655
- * map.redraw();
9656
- * @returns {Map} `this`
9657
- */
10129
+ * Force a synchronous redraw of the map.
10130
+ * @example
10131
+ * map.redraw();
10132
+ * @returns {Map} `this`
10133
+ */
9658
10134
  redraw(): Map;
9659
10135
  /**
9660
10136
  * Clean up and release all internal resources associated with this map.
@@ -10046,26 +10522,26 @@ export declare class Marker extends Evented {
10046
10522
  * the marker on screen.
10047
10523
  *
10048
10524
  * @returns {LngLat} A {@link LngLat} describing the marker's location.
10049
- * @example
10050
- * // Store the marker's longitude and latitude coordinates in a variable
10051
- * var lngLat = marker.getLngLat();
10052
- * // Print the marker's longitude and latitude values in the console
10053
- * console.log('Longitude: ' + lngLat.lng + ', Latitude: ' + lngLat.lat )
10054
- * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
10055
- */
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
+ */
10056
10532
  getLngLat(): LngLat;
10057
10533
  /**
10058
- * Set the marker's geographical position and move it.
10059
- * @param {LngLat} lnglat A {@link LngLat} describing where the marker should be located.
10060
- * @returns {Marker} `this`
10061
- * @example
10062
- * // Create a new marker, set the longitude and latitude, and add it to the map
10063
- * new maplibregl.Marker()
10064
- * .setLngLat([-65.017, -16.457])
10065
- * .addTo(map);
10066
- * @see [Add custom icons with Markers](https://maplibre.org/maplibre-gl-js-docs/example/custom-marker-icons/)
10067
- * @see [Create a draggable Marker](https://maplibre.org/maplibre-gl-js-docs/example/drag-a-marker/)
10068
- */
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
+ */
10069
10545
  setLngLat(lnglat: LngLatLike): this;
10070
10546
  /**
10071
10547
  * Returns the `Marker`'s HTML element.
@@ -10234,23 +10710,23 @@ export declare class GeolocateControl extends Evented implements IControl {
10234
10710
  _finish(): void;
10235
10711
  _setupUI(supported: boolean): void;
10236
10712
  /**
10237
- * Programmatically request and move the map to the user's location.
10238
- *
10239
- * @returns {boolean} Returns `false` if called before control was added to a map, otherwise returns `true`.
10240
- * @example
10241
- * // Initialize the geolocate control.
10242
- * var geolocate = new maplibregl.GeolocateControl({
10243
- * positionOptions: {
10244
- * enableHighAccuracy: true
10245
- * },
10246
- * trackUserLocation: true
10247
- * });
10248
- * // Add the control to the map.
10249
- * map.addControl(geolocate);
10250
- * map.on('load', function() {
10251
- * geolocate.trigger();
10252
- * });
10253
- */
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
+ */
10254
10730
  trigger(): boolean;
10255
10731
  _clearWatch(): void;
10256
10732
  }
@@ -10261,6 +10737,7 @@ export declare type AttributionOptions = {
10261
10737
  export declare class AttributionControl implements IControl {
10262
10738
  options: AttributionOptions;
10263
10739
  _map: Map;
10740
+ _compact: boolean;
10264
10741
  _container: HTMLElement;
10265
10742
  _innerContainer: HTMLElement;
10266
10743
  _compactButton: HTMLElement;
@@ -10277,6 +10754,7 @@ export declare class AttributionControl implements IControl {
10277
10754
  _updateData(e: any): void;
10278
10755
  _updateAttributions(): void;
10279
10756
  _updateCompact(): void;
10757
+ _updateCompactMinimize(): void;
10280
10758
  }
10281
10759
  export declare type Unit = "imperial" | "metric" | "nautical";
10282
10760
  export declare type ScaleOptions = {
@@ -10322,6 +10800,72 @@ export declare class FullscreenControl implements IControl {
10322
10800
  }
10323
10801
  declare function prewarm(): void;
10324
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
+ }
10325
10869
  declare const exported: {
10326
10870
  supported: import("@mapbox/mapbox-gl-supported").IsSupported;
10327
10871
  setRTLTextPlugin: (url: string, callback: (error?: Error) => void, deferred?: boolean) => void;
@@ -10340,12 +10884,20 @@ declare const exported: {
10340
10884
  Point: typeof Point;
10341
10885
  MercatorCoordinate: typeof MercatorCoordinate;
10342
10886
  Evented: typeof Evented;
10887
+ AJAXError: typeof AJAXError;
10343
10888
  config: {
10344
10889
  MAX_PARALLEL_IMAGE_REQUESTS: number;
10345
10890
  REGISTERED_PROTOCOLS: {
10346
10891
  [x: string]: any;
10347
10892
  };
10348
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;
10349
10901
  /**
10350
10902
  * Initializes resources like WebWorkers that can be shared across maps to lower load
10351
10903
  * times in some situations. `maplibregl.workerUrl` and `maplibregl.workerCount`, if being
@@ -10493,14 +11045,14 @@ declare const exported: {
10493
11045
  * @see [Add support for right-to-left scripts](https://maplibre.org/maplibre-gl-js-docs/example/mapbox-gl-rtl-text/)
10494
11046
  */
10495
11047
  /**
10496
- * Gets the map's [RTL text plugin](https://www.mapbox.com/mapbox-gl-js/plugins/#mapbox-gl-rtl-text) status.
10497
- * The status can be `unavailable` (i.e. not requested or removed), `loading`, `loaded` or `error`.
10498
- * If the status is `loaded` and the plugin is requested again, an error will be thrown.
10499
- *
10500
- * @function getRTLTextPluginStatus
10501
- * @example
10502
- * const pluginStatus = maplibregl.getRTLTextPluginStatus();
10503
- */
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
+ */
10504
11056
  export default exported;
10505
11057
 
10506
11058
  export as namespace maplibregl;