maplair 4.3.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (191) hide show
  1. package/CHANGELOG.md +151 -8
  2. package/dist/esm/control/AttributionControl.js +30 -13
  3. package/dist/esm/control/AttributionControl.js.map +1 -1
  4. package/dist/esm/control/ButtonControl.js +0 -1
  5. package/dist/esm/control/ButtonControl.js.map +1 -1
  6. package/dist/esm/control/ContextMenu.js +1 -1
  7. package/dist/esm/control/ContextMenu.js.map +1 -1
  8. package/dist/esm/control/Control.js +16 -11
  9. package/dist/esm/control/Control.js.map +1 -1
  10. package/dist/esm/control/FullscreenControl.js +0 -1
  11. package/dist/esm/control/FullscreenControl.js.map +1 -1
  12. package/dist/esm/control/LayersControl.js +46 -27
  13. package/dist/esm/control/LayersControl.js.map +1 -1
  14. package/dist/esm/control/RotateControl.js +0 -1
  15. package/dist/esm/control/RotateControl.js.map +1 -1
  16. package/dist/esm/control/ScaleControl.js +7 -8
  17. package/dist/esm/control/ScaleControl.js.map +1 -1
  18. package/dist/esm/control/SideBySideControl.js +3 -2
  19. package/dist/esm/control/SideBySideControl.js.map +1 -1
  20. package/dist/esm/control/ZoomControl.js +14 -13
  21. package/dist/esm/control/ZoomControl.js.map +1 -1
  22. package/dist/esm/core/Events.js +3 -2
  23. package/dist/esm/core/Events.js.map +1 -1
  24. package/dist/esm/core/Util.js +17 -5
  25. package/dist/esm/core/Util.js.map +1 -1
  26. package/dist/esm/dom/DomEvent.PointerEvents.js +72 -2
  27. package/dist/esm/dom/DomEvent.PointerEvents.js.map +1 -1
  28. package/dist/esm/dom/DomEvent.js +4 -7
  29. package/dist/esm/dom/DomEvent.js.map +1 -1
  30. package/dist/esm/dom/DomUtil.js +5 -5
  31. package/dist/esm/dom/DomUtil.js.map +1 -1
  32. package/dist/esm/dom/Draggable.js +10 -8
  33. package/dist/esm/dom/Draggable.js.map +1 -1
  34. package/dist/esm/geo/LatLng.js +24 -35
  35. package/dist/esm/geo/LatLng.js.map +1 -1
  36. package/dist/esm/geo/LatLngBounds.js +6 -3
  37. package/dist/esm/geo/LatLngBounds.js.map +1 -1
  38. package/dist/esm/geometry/Bounds.js +2 -2
  39. package/dist/esm/geometry/Bounds.js.map +1 -1
  40. package/dist/esm/geometry/Point.js +16 -19
  41. package/dist/esm/geometry/Point.js.map +1 -1
  42. package/dist/esm/geometry/PolyUtil.js +10 -3
  43. package/dist/esm/geometry/PolyUtil.js.map +1 -1
  44. package/dist/esm/geometry/Transformation.js +1 -7
  45. package/dist/esm/geometry/Transformation.js.map +1 -1
  46. package/dist/esm/layer/BlanketOverlay.js +3 -2
  47. package/dist/esm/layer/BlanketOverlay.js.map +1 -1
  48. package/dist/esm/layer/DivOverlay.js +25 -25
  49. package/dist/esm/layer/DivOverlay.js.map +1 -1
  50. package/dist/esm/layer/ImageOverlay.js +8 -5
  51. package/dist/esm/layer/ImageOverlay.js.map +1 -1
  52. package/dist/esm/layer/Layer.js +12 -7
  53. package/dist/esm/layer/Layer.js.map +1 -1
  54. package/dist/esm/layer/Popup.js +33 -15
  55. package/dist/esm/layer/Popup.js.map +1 -1
  56. package/dist/esm/layer/Tooltip.js +48 -56
  57. package/dist/esm/layer/Tooltip.js.map +1 -1
  58. package/dist/esm/layer/VideoOverlay.js +2 -2
  59. package/dist/esm/layer/VideoOverlay.js.map +1 -1
  60. package/dist/esm/layer/marker/DivIcon.js +4 -8
  61. package/dist/esm/layer/marker/DivIcon.js.map +1 -1
  62. package/dist/esm/layer/marker/Icon.js +37 -17
  63. package/dist/esm/layer/marker/Icon.js.map +1 -1
  64. package/dist/esm/layer/marker/Marker.Drag.js +11 -12
  65. package/dist/esm/layer/marker/Marker.Drag.js.map +1 -1
  66. package/dist/esm/layer/marker/Marker.js +54 -53
  67. package/dist/esm/layer/marker/Marker.js.map +1 -1
  68. package/dist/esm/layer/marker/SvgIcon.js +1 -1
  69. package/dist/esm/layer/marker/SvgIcon.js.map +1 -1
  70. package/dist/esm/layer/tile/GridLayer.js +29 -21
  71. package/dist/esm/layer/tile/GridLayer.js.map +1 -1
  72. package/dist/esm/layer/tile/TileLayer.js +19 -15
  73. package/dist/esm/layer/tile/TileLayer.js.map +1 -1
  74. package/dist/esm/layer/tile/WMSTileLayer.js +7 -3
  75. package/dist/esm/layer/tile/WMSTileLayer.js.map +1 -1
  76. package/dist/esm/layer/vector/Canvas.js +45 -94
  77. package/dist/esm/layer/vector/Canvas.js.map +1 -1
  78. package/dist/esm/layer/vector/Circle.js +8 -9
  79. package/dist/esm/layer/vector/Circle.js.map +1 -1
  80. package/dist/esm/layer/vector/CircleMarker.js +15 -4
  81. package/dist/esm/layer/vector/CircleMarker.js.map +1 -1
  82. package/dist/esm/layer/vector/Path.ZoomStyles.js +4 -1
  83. package/dist/esm/layer/vector/Path.ZoomStyles.js.map +1 -1
  84. package/dist/esm/layer/vector/Path.js +10 -5
  85. package/dist/esm/layer/vector/Path.js.map +1 -1
  86. package/dist/esm/layer/vector/Polygon.js +10 -11
  87. package/dist/esm/layer/vector/Polygon.js.map +1 -1
  88. package/dist/esm/layer/vector/Polyline.js +19 -26
  89. package/dist/esm/layer/vector/Polyline.js.map +1 -1
  90. package/dist/esm/layer/vector/Renderer.getRenderer.js +2 -1
  91. package/dist/esm/layer/vector/Renderer.getRenderer.js.map +1 -1
  92. package/dist/esm/layer/vector/Renderer.js +16 -0
  93. package/dist/esm/layer/vector/Renderer.js.map +1 -1
  94. package/dist/esm/layer/vector/SVG.js +3 -3
  95. package/dist/esm/layer/vector/SVG.js.map +1 -1
  96. package/dist/esm/map/Map.Rotation.js +9 -11
  97. package/dist/esm/map/Map.Rotation.js.map +1 -1
  98. package/dist/esm/map/Map.js +158 -71
  99. package/dist/esm/map/Map.js.map +1 -1
  100. package/dist/esm/map/MapSync.js +2 -5
  101. package/dist/esm/map/MapSync.js.map +1 -1
  102. package/dist/esm/map/handler/BoxZoomHandler.js +4 -0
  103. package/dist/esm/map/handler/BoxZoomHandler.js.map +1 -1
  104. package/dist/esm/map/handler/DisplaceHandler.js +68 -30
  105. package/dist/esm/map/handler/DisplaceHandler.js.map +1 -1
  106. package/dist/esm/map/handler/DragHandler.js +7 -2
  107. package/dist/esm/map/handler/DragHandler.js.map +1 -1
  108. package/dist/esm/map/handler/KeyboardHandler.js +3 -5
  109. package/dist/esm/map/handler/KeyboardHandler.js.map +1 -1
  110. package/dist/esm/map/handler/PinchZoomHandler.js +4 -7
  111. package/dist/esm/map/handler/PinchZoomHandler.js.map +1 -1
  112. package/dist/esm/map/handler/ScrollWheelZoomHandler.js +4 -7
  113. package/dist/esm/map/handler/ScrollWheelZoomHandler.js.map +1 -1
  114. package/dist/esm/map/handler/TapDragZoomHandler.js +2 -5
  115. package/dist/esm/map/handler/TapDragZoomHandler.js.map +1 -1
  116. package/dist/esm/map/handler/TapHoldHandler.js +8 -20
  117. package/dist/esm/map/handler/TapHoldHandler.js.map +1 -1
  118. package/dist/esm/package.js +1 -1
  119. package/dist/maplair-global-src.js +970 -810
  120. package/dist/maplair-global-src.js.map +1 -1
  121. package/dist/maplair-global.js +2 -2
  122. package/dist/maplair-global.js.map +1 -1
  123. package/dist/maplair-src.js +970 -810
  124. package/dist/maplair-src.js.map +1 -1
  125. package/dist/maplair.css +1 -1
  126. package/dist/maplair.js +2 -2
  127. package/dist/maplair.js.map +1 -1
  128. package/i18n/en.json +1 -0
  129. package/package.json +1 -1
  130. package/src/control/AttributionControl.js +37 -11
  131. package/src/control/ButtonControl.js +0 -1
  132. package/src/control/ContextMenu.js +1 -1
  133. package/src/control/Control.js +13 -16
  134. package/src/control/FullscreenControl.js +0 -1
  135. package/src/control/LayersControl.js +61 -37
  136. package/src/control/RotateControl.js +0 -1
  137. package/src/control/ScaleControl.js +10 -8
  138. package/src/control/SideBySideControl.js +4 -2
  139. package/src/control/ZoomControl.js +11 -13
  140. package/src/core/Events.js +6 -2
  141. package/src/core/Util.js +17 -4
  142. package/src/dom/DomEvent.PointerEvents.js +68 -2
  143. package/src/dom/DomEvent.js +5 -17
  144. package/src/dom/DomUtil.js +5 -5
  145. package/src/dom/Draggable.js +11 -8
  146. package/src/geo/LatLng.js +24 -37
  147. package/src/geo/LatLngBounds.js +10 -4
  148. package/src/geometry/Bounds.js +3 -3
  149. package/src/geometry/Point.js +22 -28
  150. package/src/geometry/PolyUtil.js +12 -3
  151. package/src/geometry/Transformation.js +1 -8
  152. package/src/layer/BlanketOverlay.js +6 -3
  153. package/src/layer/DivOverlay.js +30 -32
  154. package/src/layer/ImageOverlay.js +12 -9
  155. package/src/layer/Layer.js +19 -7
  156. package/src/layer/Popup.js +41 -21
  157. package/src/layer/Tooltip.js +50 -70
  158. package/src/layer/VideoOverlay.js +2 -2
  159. package/src/layer/marker/DivIcon.js +3 -6
  160. package/src/layer/marker/Icon.js +41 -20
  161. package/src/layer/marker/Marker.Drag.js +22 -24
  162. package/src/layer/marker/Marker.js +71 -64
  163. package/src/layer/marker/SvgIcon.js +1 -1
  164. package/src/layer/tile/GridLayer.js +41 -30
  165. package/src/layer/tile/TileLayer.js +31 -21
  166. package/src/layer/tile/WMSTileLayer.js +4 -2
  167. package/src/layer/vector/Canvas.js +53 -149
  168. package/src/layer/vector/Circle.js +13 -13
  169. package/src/layer/vector/CircleMarker.js +16 -3
  170. package/src/layer/vector/Path.ZoomStyles.js +5 -3
  171. package/src/layer/vector/Path.js +11 -5
  172. package/src/layer/vector/Polygon.js +11 -10
  173. package/src/layer/vector/Polyline.js +20 -21
  174. package/src/layer/vector/Renderer.getRenderer.js +2 -1
  175. package/src/layer/vector/Renderer.js +21 -3
  176. package/src/layer/vector/SVG.js +3 -3
  177. package/src/map/Map.Rotation.js +13 -9
  178. package/src/map/Map.js +195 -83
  179. package/src/map/MapSync.js +2 -2
  180. package/src/map/handler/BoxZoomHandler.js +5 -0
  181. package/src/map/handler/DisplaceHandler.js +53 -7
  182. package/src/map/handler/DragHandler.js +5 -5
  183. package/src/map/handler/KeyboardHandler.js +5 -10
  184. package/src/map/handler/PinchZoomHandler.js +4 -4
  185. package/src/map/handler/ScrollWheelZoomHandler.js +4 -4
  186. package/src/map/handler/TapDragZoomHandler.js +2 -2
  187. package/src/map/handler/TapHoldHandler.js +13 -25
  188. package/src/maplair.css +50 -10
  189. package/dist/esm/dom/DomEvent.DoubleTap.js +0 -90
  190. package/dist/esm/dom/DomEvent.DoubleTap.js.map +0 -1
  191. package/src/dom/DomEvent.DoubleTap.js +0 -143
@@ -1 +1 @@
1
- {"version":3,"file":"Map.js","names":["Util.setOptions","DomUtil.create","DomEvent.getPointerPosition","DomUtil.get","Util.stamp","DomEvent.off","DomEvent.on","DomEvent.isExternalTarget","DomUtil.getPosition","RendererSupport"],"sources":["../../../src/map/Map.js"],"sourcesContent":["import * as Util from '../core/Util.js';\nimport {Evented} from '../core/Events.js';\nimport {EPSG3857} from '../geo/crs/EPSG3857.js';\nimport {Point} from '../geometry/Point.js';\nimport {Bounds} from '../geometry/Bounds.js';\nimport {LatLng} from '../geo/LatLng.js';\nimport {LatLngBounds} from '../geo/LatLngBounds.js';\nimport * as DomEvent from '../dom/DomEvent.js';\nimport * as DomUtil from '../dom/DomUtil.js';\nimport {PosAnimation} from '../dom/PosAnimation.js';\nimport {I18n} from '../core/I18n.js';\nimport * as PointerEvents from '../dom/DomEvent.PointerEvents.js';\nimport {Control} from '../control/Control.js';\nimport {AttributionControl} from '../control/AttributionControl.js';\nimport {ZoomControl} from '../control/ZoomControl.js';\nimport {FullscreenControl} from '../control/FullscreenControl.js';\nimport {Layer} from '../layer/Layer.js';\nimport {DivOverlay} from '../layer/DivOverlay.js';\nimport {Popup} from '../layer/Popup.js';\nimport {Tooltip} from '../layer/Tooltip.js';\nimport * as RendererSupport from '../layer/vector/Renderer.getRenderer.js';\nimport {BoxZoomHandler} from './handler/BoxZoomHandler.js';\nimport {DoubleClickZoomHandler} from './handler/DoubleClickZoomHandler.js';\nimport {DragHandler} from './handler/DragHandler.js';\nimport {KeyboardHandler} from './handler/KeyboardHandler.js';\nimport {PinchZoomHandler} from './handler/PinchZoomHandler.js';\nimport {ScrollWheelZoomHandler} from './handler/ScrollWheelZoomHandler.js';\nimport {TapHoldHandler} from './handler/TapHoldHandler.js';\nimport {TapDragZoomHandler} from './handler/TapDragZoomHandler.js';\n\n/** @import {LatLngExpression} from '../geo/LatLng.js' */\n/** @import {LatLngBoundsExpression} from '../geo/LatLngBounds.js' */\n/** @import {PointExpression} from '../geometry/Point.js' */\n/** @import {CRS} from '../geo/crs/CRS.js' */\n/** @import {Handler} from '../core/Handler.js' */\n/** @import {Renderer} from '../layer/vector/Renderer.js' */\n/** @import {MaplairEvent, MaplairPointerEvent, MaplairKeyboardEvent, MaplairErrorEvent, LocationEvent, ResizeEvent, CrsChangeEvent, WorldCopyJumpEvent, ZoomAnimEvent} from '../core/Events.js' */\n\n// matches the zoom transition in maplair.css\nconst zoomAnimDuration = 250;\n\n/**\n * Options of `MaplairMap`.\n * @typedef {object} MaplairMapOptions\n * @property {CRS} [crs=EPSG3857] The [Coordinate Reference System](#crs) to use.\n * Don't change this if you're not sure what it means.\n * @property {LatLngExpression} [center] Initial geographic center of the map.\n * @property {number} [zoom] Initial map zoom level.\n * @property {number} [minZoom] Minimum zoom level of the map. If not specified and at\n * least one `GridLayer` or `TileLayer` is in the map, the lowest of their `minZoom`\n * options will be used instead.\n * @property {number} [maxZoom] Maximum zoom level of the map. If not specified and at\n * least one `GridLayer` or `TileLayer` is in the map, the highest of their `maxZoom`\n * options will be used instead.\n * @property {Layer[]} [layers=[]] Array of layers that will be added to the map initially.\n * @property {string} [ariaLabel] The accessible name of the map, announced by screen\n * readers, `'Map'` by default. The map container gets the ARIA role `region` with this\n * label, unless it already has a role or label. The default is translated, see `I18n`.\n * @property {LatLngBoundsExpression} [maxBounds] When this option is set, the map\n * restricts the view to the given geographical bounds, bouncing the user back if the\n * user tries to pan outside the view. To set the restriction dynamically, use\n * [`setMaxBounds`](#map-setmaxbounds) method.\n * @property {Renderer} [renderer] The default method for drawing vector layers on the\n * map. `SVG` or `Canvas` by default depending on browser support.\n * @property {boolean} [zoomAnimation=true] Whether the map zoom animation is enabled.\n * @property {number} [zoomAnimationThreshold=4] Won't animate zoom if the zoom\n * difference exceeds this value (or 1 if the user prefers\n * [reduced motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion)\n * and `animate: true` isn't passed).\n * @property {boolean} [continuousZoom=false] Whether zoom animations (e.g. of the zoom\n * control, double click and keyboard) change the view frame by frame through fractional\n * zoom levels, like `flyTo()` and pinch zoom, instead of scaling the map with a CSS\n * transition between two zoom levels. Also makes the scroll wheel zoom smoothly with\n * each wheel event (see `scrollWheelZoom`), snapping to `zoomSnap` when scrolling ends.\n * @property {boolean} [fadeAnimation=true] Whether the tile and popup fade animation is\n * enabled.\n * @property {boolean} [markerZoomAnimation=true] Whether markers animate their zoom\n * with the zoom animation, if disabled they will disappear for the length of the\n * animation.\n * @property {boolean} [markerCulling=false] Whether markers far outside of the map view\n * (more than half a view away) are taken off the page until the map is moved closer to\n * them. This reduces the browser's rendering work, and the work of repositioning\n * markers while zooming, when a map has many markers (e.g. several thousands) of which\n * only some are visible at a time.\n * @property {number} [transform3DLimit=8388608] Defines the maximum size of a CSS\n * translation transform (2^23). The default value should not be changed unless a web\n * browser positions layers in the wrong place after doing a large `panBy`.\n * @property {number} [zoomSnap=1] Forces the map's zoom level to always be a multiple\n * of this, particularly right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.\n * By default, the zoom level snaps to the nearest integer; lower values (e.g. `0.5` or\n * `0.1`) allow for greater granularity. A value of `0` means the zoom level will not be\n * snapped after `fitBounds` or a pinch-zoom.\n * @property {number} [zoomDelta=1] Controls how much the map's zoom level will change\n * after a [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+` or `-`\n * on the keyboard, or using the [zoom controls](#control-zoom). Values smaller than `1`\n * (e.g. `0.5`) allow for greater granularity.\n * @property {boolean} [trackResize=true] Whether the map automatically handles browser\n * window resize to update itself. A hidden map (with the size 0, e.g. `display: none`\n * in an inactive tab) keeps its size, view and bounds until it is shown again.\n */\n\n/**\n * Options of the geolocation methods of `MaplairMap`, e.g. `locate()`.\n * @typedef {object} LocateOptions\n * @property {boolean} [watch=false] If `true`, starts continuous watching of location\n * changes (instead of detecting it once) using W3C `watchPosition` method. You can\n * later stop watching using `map.stopLocate()` method.\n * @property {boolean} [setView=false] If `true`, automatically sets the map view to the\n * user location with respect to detection accuracy, or to world view if geolocation\n * failed.\n * @property {number} [maxZoom=Infinity] The maximum zoom for automatic view setting\n * when using `setView` option.\n * @property {number} [timeout=10000] Number of milliseconds to wait for a response from\n * geolocation before firing a `locationerror` event.\n * @property {number} [maximumAge=0] Maximum age of detected location. If less than this\n * amount of milliseconds passed since last geolocation response, `locate` will return\n * a cached location.\n * @property {boolean} [enableHighAccuracy=false] Enables high accuracy, see\n * [description in the W3C spec](https://w3c.github.io/geolocation-api/#enablehighaccuracy-member).\n */\n\n/**\n * Options of the `MaplairMap` methods which modify the zoom level.\n * @typedef {object} ZoomOptions\n * @property {boolean} [animate] If not specified, zoom animation will happen if the\n * zoom origin is inside the current view, and if the user prefers reduced motion, only\n * when zooming by at most one level. If `true`, the map will attempt animating zoom\n * disregarding where zoom origin is and the user's reduced motion preference. Setting\n * `false` will make it always reset the view completely without animation.\n */\n\n/**\n * Options of the `MaplairMap` methods which modify the center of the map.\n * @typedef {object} PanOptions\n * @property {boolean} [animate] If `true`, panning will always be animated if possible,\n * even if the user prefers reduced motion. If `false`, it will not animate panning,\n * either resetting the map view if panning more than a screen away, or just setting a\n * new offset for the map pane (except for `panBy` which always does the latter). If not\n * specified, panning is animated, except for pans longer than half the map size when\n * the user prefers reduced motion.\n * @property {number} [duration=0.25] Duration of animated panning, in seconds.\n * @property {number} [easeLinearity=0.25] The curvature factor of panning animation\n * easing (third parameter of the [Cubic Bezier curve](https://cubic-bezier.com/)).\n * 1.0 means linear animation, and the smaller this number, the more bowed the curve.\n * @property {boolean} [noMoveStart=false] If `true`, panning won't fire `movestart`\n * event on start (used internally for panning inertia).\n */\n\n/**\n * Options of the `MaplairMap` methods which modify the zoom level and the center.\n * @typedef {object} ZoomPanOptions\n * @extends ZoomOptions, PanOptions\n */\n\n/**\n * Options of `MaplairMap.invalidateSize()`.\n * @typedef {object} InvalidateSizeOptions\n * @property {boolean} [pan=true] If `false`, panning will not occur.\n * @property {boolean} [debounceMoveend=false] If `true`, it will delay `moveend` event\n * so that it doesn't happen often even if the method is called many times in a row.\n * @extends ZoomPanOptions\n */\n\n/**\n * Padding options of `MaplairMap` methods, e.g. `panInside()`.\n * @typedef {object} PaddingOptions\n * @property {PointExpression} [paddingTopLeft=[0, 0]] Sets the amount of padding in the\n * top left corner of a map container that shouldn't be accounted for when setting the\n * view to fit bounds. Useful if you have some control overlays on the map like a\n * sidebar and you don't want them to obscure objects you're zooming to.\n * @property {PointExpression} [paddingBottomRight=[0, 0]] The same for the bottom right\n * corner of the map.\n * @property {PointExpression} [padding=[0, 0]] Equivalent of setting both top left and\n * bottom right padding to the same value.\n */\n\n/**\n * Options of `MaplairMap.fitBounds()` and similar methods.\n * @typedef {object} FitBoundsOptions\n * @property {number|null} [maxZoom=null] The maximum possible zoom to use.\n * @extends ZoomPanOptions, PaddingOptions\n */\n\n/**\n * The central class of the API — it is used to create a map on a page and manipulate it.\n *\n * <h3 id=\"map-pane\">Panes</h3>\n *\n * Panes are DOM elements used to control the ordering of layers on the map. You can\n * access panes with [`map.getPane`](#map-getpane) or [`map.getPanes`](#map-getpanes)\n * methods. New panes can be created with the [`map.createPane`](#map-createpane) method.\n *\n * Every map has the following default panes that differ only in zIndex.\n *\n * | Pane | zIndex | Description |\n * |---|---|---|\n * | `mapPane` | `'auto'` | Pane that contains all other map panes |\n * | `tilePane` | 200 | Pane for `GridLayer`s and `TileLayer`s |\n * | `overlayPane` | 400 | Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s |\n * | `shadowPane` | 500 | Pane for overlay shadows (e.g. `Marker` shadows) |\n * | `markerPane` | 600 | Pane for `Icon`s of `Marker`s |\n * | `tooltipPane` | 650 | Pane for `Tooltip`s |\n * | `popupPane` | 700 | Pane for `Popup`s |\n *\n * **Map state change events**\n *\n * The map state change events `movestart`, `move`, `moveend`, `zoomstart`, `zoom`,\n * `zoomend` and `zoomanim` caused by the user (e.g. dragging, scrolling, pinching,\n * pressing a key or clicking a zoom button) have an `originalEvent` property with the\n * DOM event that started the change. It is `undefined` for changes made by code (e.g.\n * `setView()`), which allows to tell them apart, e.g. to avoid feedback loops when\n * synchronizing the view.\n *\n * @example\n * ```js\n * // initialize the map on the \"map\" div with a given center and zoom\n * const map = new MaplairMap('map', {\n * \tcenter: [51.505, -0.09],\n * \tzoom: 13\n * });\n * ```\n *\n * @fires resize {ResizeEvent} Fired when the map is resized.\n * @fires unload {MaplairEvent} Fired when the map is destroyed with [remove](#map-remove) method.\n * @fires viewprereset {MaplairEvent} Fired before the map resets its view (see `viewreset`).\n * @fires viewreset {MaplairEvent} Fired when the map needs to redraw its content (this\n * usually happens on map zoom or load). Very useful for creating custom overlays.\n * @fires load {MaplairEvent} Fired when the map is initialized (when its center and zoom\n * are set for the first time).\n * @fires zoomstart {MaplairEvent} Fired when the map zoom is about to change (e.g. before\n * zoom animation).\n * @fires movestart {MaplairEvent} Fired when the view of the map starts changing (e.g.\n * user starts dragging the map).\n * @fires zoom {MaplairEvent} Fired repeatedly during any change in zoom level, including\n * zoom and fly animations.\n * @fires move {MaplairEvent} Fired repeatedly during any movement of the map, including\n * pan and fly animations.\n * @fires zoomend {MaplairEvent} Fired when the map zoom changed, after any animations.\n * @fires moveend {MaplairEvent} Fired when the center of the map stops changing (e.g.\n * user stopped dragging the map or after non-centered zoom).\n * @fires idle {MaplairEvent} Fired when the map becomes idle: the view is not changing\n * (no dragging, panning or zooming, including their animations) and all layers have\n * finished loading (e.g. the tiles of tile layers, see `GridLayer.isLoading()`). Useful\n * e.g. for taking screenshots or for tests.\n * @fires locationerror {MaplairErrorEvent} Fired when geolocation (using the\n * [`locate`](#map-locate) method) failed.\n * @fires locationfound {LocationEvent} Fired when geolocation (using the\n * [`locate`](#map-locate) method) went successfully.\n * @fires click {MaplairPointerEvent} Fired when the user clicks (or taps) the map.\n * @fires dblclick {MaplairPointerEvent} Fired when the user double-clicks (or\n * double-taps) the map.\n * @fires pointerdown {MaplairPointerEvent} Fired when the user pushes the pointer on the map.\n * @fires pointerup {MaplairPointerEvent} Fired when the user releases the pointer on the map.\n * @fires pointerover {MaplairPointerEvent} Fired when the pointer enters the map.\n * @fires pointerout {MaplairPointerEvent} Fired when the pointer leaves the map.\n * @fires pointermove {MaplairPointerEvent} Fired while the pointer moves over the map.\n * @fires contextmenu {MaplairPointerEvent} Fired when the user pushes the right mouse\n * button on the map, prevents default browser context menu from showing if there are\n * listeners on this event. Also fired on mobile when the user holds a single touch for\n * a second (also called long press).\n * @fires preclick {MaplairPointerEvent} Fired before pointer click on the map (sometimes\n * useful when you want something to happen on click before any existing click handlers\n * start running).\n * @fires keydown {MaplairKeyboardEvent} Fired when the user presses a key from the\n * keyboard while the map is focused.\n * @fires keyup {MaplairKeyboardEvent} Fired when the user releases a key from the\n * keyboard while the map is focused.\n * @fires crschange {CrsChangeEvent} Fired when the CRS of the map changes with\n * `setCrs()`, before the view is reset.\n * @fires worldcopyjump {WorldCopyJumpEvent} Fired when [`worldCopyJump`](#maplairmapoptions-worldcopyjump)\n * moves the map pane by one or more world widths.\n * @fires pixelratiochange {MaplairEvent} Fired when the `devicePixelRatio` of the browser\n * changes, e.g. when moving the window to a screen with another resolution or when\n * zooming the page. Tile layers with `detectRetina` and canvas renderers adapt to it.\n * @fires zoomanim {ZoomAnimEvent} Fired at least once per zoom animation. For continuous\n * zoom, like pinch zooming, fired once per frame during zoom.\n */\nexport class MaplairMap extends Evented {\n\n\tstatic defaultOptions = {\n\t\tcrs: EPSG3857,\n\t\tcenter: undefined,\n\t\tzoom: undefined,\n\t\tminZoom: undefined,\n\t\tmaxZoom: undefined,\n\t\tlayers: [],\n\t\tariaLabel: undefined,\n\t\tmaxBounds: undefined,\n\t\trenderer: undefined,\n\n\t\tzoomAnimation: true,\n\t\tzoomAnimationThreshold: 4,\n\t\tcontinuousZoom: false,\n\t\tfadeAnimation: true,\n\t\tmarkerZoomAnimation: true,\n\t\tmarkerCulling: false,\n\t\ttransform3DLimit: 8388608, // Precision limit of a 32-bit float\n\n\t\tzoomSnap: 1,\n\t\tzoomDelta: 1,\n\t\ttrackResize: true\n\t};\n\n\t/**\n\t * Instantiates a map object given the DOM ID of a `<div>` element or the element\n\t * itself, and optionally an object literal with `MaplairMap` options.\n\t * @param {string|HTMLElement} id The `<div>` element or its DOM ID.\n\t * @param {MaplairMapOptions} [options]\n\t */\n\tconstructor(id, options) {\n\t\tsuper();\n\t\toptions = Util.setOptions(this, options);\n\n\t\t// Make sure to assign internal flags at the beginning,\n\t\t// to avoid inconsistent state in some edge cases.\n\t\tthis._handlers = [];\n\t\tthis._layers = {};\n\t\tthis._zoomBoundLayers = {};\n\t\tthis._sizeChanged = true;\n\n\t\tthis._initContainer(id);\n\t\tthis._initLayout();\n\n\t\tthis._initEvents();\n\n\t\tthis._watchPixelRatio();\n\n\t\tthis.on({\n\t\t\tmovestart: this._onBusy,\n\t\t\tzoomstart: this._onBusy,\n\t\t\tmove: this._onMove,\n\t\t\tmoveend: this._onViewChanged,\n\t\t\tlayerremove: this._scheduleIdleCheck\n\t\t}, this);\n\n\t\tif (options.maxBounds) {\n\t\t\tthis.setMaxBounds(options.maxBounds);\n\t\t}\n\n\t\tif (options.zoom !== undefined) {\n\t\t\tthis._zoom = this._limitZoom(options.zoom);\n\t\t}\n\n\t\tif (options.center && options.zoom !== undefined) {\n\t\t\tthis.setView(LatLng.from(options.center), options.zoom, {reset: true});\n\t\t}\n\n\t\tthis.callInitHooks(MaplairMap);\n\n\t\tthis._zoomAnimated = this.options.zoomAnimation;\n\n\t\t// zoom transitions run with the same duration for all layers, so if one of transitionend events\n\t\t// happens after starting zoom animation (propagating to the map pane), we know that it ended globally\n\t\tif (this._zoomAnimated) {\n\t\t\tthis._createAnimProxy();\n\t\t}\n\n\t\tthis._addLayers(this.options.layers);\n\t}\n\n\t/**\n\t * Sets the view of the map (geographical center and zoom) with the given\n\t * animation options.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} center\n\t * @param {number} [zoom]\n\t * @param {ZoomPanOptions} [options]\n\t * @returns {this}\n\t */\n\tsetView(center, zoom, options) {\n\n\t\tzoom = zoom === undefined ? this._zoom : this._limitZoom(zoom);\n\t\tcenter = this._limitCenter(new LatLng(center), zoom, this.options.maxBounds);\n\t\toptions ??= {};\n\n\t\tthis._stop();\n\n\t\tif (this._loaded && !options.reset && options !== true) {\n\n\t\t\tif (options.animate !== undefined) {\n\t\t\t\toptions.zoom = {animate: options.animate, ...options.zoom};\n\t\t\t\toptions.pan = {animate: options.animate, duration: options.duration, ...options.pan};\n\t\t\t}\n\n\t\t\t// try animating pan or zoom\n\t\t\tconst moved = (this._zoom !== zoom) ?\n\t\t\t\tthis._tryAnimatedZoom && this._tryAnimatedZoom(center, zoom, options.zoom) :\n\t\t\t\tthis._tryAnimatedPan(center, options.pan);\n\n\t\t\tif (moved) {\n\t\t\t\t// prevent resize handler call, the view will refresh after animation anyway\n\t\t\t\tclearTimeout(this._sizeTimer);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\t// animation didn't start, just reset the map view\n\t\tthis._resetView(center, zoom, options.pan?.noMoveStart);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the zoom of the map.\n\t * @group Methods for modifying map state\n\t * @param {number} zoom\n\t * @param {ZoomPanOptions} [options]\n\t * @returns {this}\n\t */\n\tsetZoom(zoom, options) {\n\t\tif (!this._loaded) {\n\t\t\tthis._zoom = zoom;\n\t\t\treturn this;\n\t\t}\n\t\treturn this.setView(this.getCenter(), zoom, {zoom: options});\n\t}\n\n\t/**\n\t * Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\n\t * @group Methods for modifying map state\n\t * @param {number} [delta]\n\t * @param {ZoomOptions} [options]\n\t * @returns {this}\n\t */\n\tzoomIn(delta, options) {\n\t\tdelta ??= this.options.zoomDelta;\n\t\treturn this.setZoom(this._zoom + delta, options);\n\t}\n\n\t/**\n\t * Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\n\t * @group Methods for modifying map state\n\t * @param {number} [delta]\n\t * @param {ZoomOptions} [options]\n\t * @returns {this}\n\t */\n\tzoomOut(delta, options) {\n\t\tdelta ??= this.options.zoomDelta;\n\t\treturn this.setZoom(this._zoom - delta, options);\n\t}\n\n\t/**\n\t * Zooms the map while keeping a specified geographical point on the map\n\t * stationary (e.g. used internally for scroll zoom and double-click zoom). Given a\n\t * `Point`, it keeps the specified pixel on the map (relative to the top-left corner)\n\t * stationary instead.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression|Point} latlng The geographical point or the pixel offset.\n\t * @param {number} zoom\n\t * @param {ZoomOptions} [options]\n\t * @returns {this}\n\t */\n\tsetZoomAround(latlng, zoom, options) {\n\t\t// work in unrounded projected coordinates so that zooming back and forth around the same point\n\t\t// doesn't accumulate pixel rounding errors (amplified by the zoom scale) and drift the view;\n\t\t// a pixel offset goes through layer points, which account for a rotation of the map\n\t\tconst center = this.project(this.getCenter()),\n\t\toffset = latlng instanceof Point ?\n\t\t\tthis.containerPointToLayerPoint(latlng).subtract(this.containerPointToLayerPoint(this.getSize().divideBy(2))) :\n\t\t\tthis.project(latlng).subtract(center),\n\t\tnewCenter = this.unproject(center.add(offset.multiplyBy(1 - 1 / this.getZoomScale(zoom))));\n\n\t\treturn this.setView(newCenter, zoom, {zoom: options});\n\t}\n\n\t_getBoundsCenterZoom(bounds, options) {\n\n\t\toptions ??= {};\n\t\tbounds = bounds.getBounds ? bounds.getBounds() : LatLngBounds.from(bounds);\n\n\t\tconst paddingTL = Point.from(options.paddingTopLeft || options.padding || [0, 0]),\n\t\tpaddingBR = Point.from(options.paddingBottomRight || options.padding || [0, 0]);\n\n\t\tlet zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\n\n\t\tzoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;\n\n\t\tif (zoom === Infinity) {\n\t\t\treturn {\n\t\t\t\tcenter: bounds.getCenter(),\n\t\t\t\tzoom\n\t\t\t};\n\t\t}\n\n\t\tconst paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),\n\n\t\tswPoint = this.project(bounds.getSouthWest(), zoom),\n\t\tnePoint = this.project(bounds.getNorthEast(), zoom),\n\t\tcenter = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);\n\n\t\treturn {\n\t\t\tcenter,\n\t\t\tzoom\n\t\t};\n\t}\n\n\t/**\n\t * Sets a map view that contains the given geographical bounds with the\n\t * maximum zoom level possible.\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {FitBoundsOptions} [options]\n\t * @returns {this}\n\t */\n\tfitBounds(bounds, options) {\n\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\tif (!bounds.isValid()) {\n\t\t\tthrow new Error('Bounds are not valid.');\n\t\t}\n\n\t\tconst target = this._getBoundsCenterZoom(bounds, options);\n\t\treturn this.setView(target.center, target.zoom, options);\n\t}\n\n\t/**\n\t * Sets a map view that mostly contains the whole world with the maximum\n\t * zoom level possible.\n\t * @group Methods for modifying map state\n\t * @param {FitBoundsOptions} [options]\n\t * @returns {this}\n\t */\n\tfitWorld(options) {\n\t\treturn this.fitBounds([[-90, -180], [90, 180]], options);\n\t}\n\n\t/**\n\t * Pans the map to a given center.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} center\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanTo(center, options) {\n\t\treturn this.setView(center, this._zoom, {pan: options});\n\t}\n\t/**\n\t * Pans the map by a given number of pixels (animated unless `animate: false` is passed,\n\t * or the user prefers reduced motion and the pan is longer than half the map size\n\t * without `animate: true`).\n\t * @group Methods for modifying map state\n\t * @param {PointExpression} offset\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanBy(offset, options) {\n\t\toffset = Point.from(offset).round();\n\t\toptions ??= {};\n\n\t\tif (!offset.x && !offset.y) {\n\t\t\treturn this.fire('moveend');\n\t\t}\n\t\t// If we pan too far, Chrome gets issues with tiles\n\t\t// and makes them disappear or appear in the wrong place (slightly offset) #2602\n\t\tconst size = this.getSize();\n\t\tif (options.animate !== true && !size.contains(offset)) {\n\t\t\tconst center = this.unproject(this.project(this.getCenter()).add(offset));\n\t\t\tthis._resetView(this.options.worldCopyJump ? this.wrapLatLng(center) : center, this.getZoom());\n\t\t\treturn this;\n\t\t}\n\n\t\tif (!this._panAnim) {\n\t\t\tthis._panAnim = new PosAnimation();\n\n\t\t\tthis._panAnim.on({\n\t\t\t\t'step': this._onPanTransitionStep,\n\t\t\t\t'end': this._onPanTransitionEnd\n\t\t\t}, this);\n\t\t}\n\n\t\t// don't fire movestart if animating inertia\n\t\tif (!options.noMoveStart) {\n\t\t\tthis.fire('movestart');\n\t\t}\n\n\t\t// with reduced motion, only short pans are animated unless animate: true is specified\n\t\tconst tooFarForReducedMotion = this._prefersReducedMotion() && !size.divideBy(2).contains(offset);\n\t\tif (options.animate === true || (options.animate !== false && !tooFarForReducedMotion)) {\n\t\t\tthis._mapPane.classList.add('maplair-pan-anim');\n\n\t\t\tconst newPos = this._getMapPanePos().subtract(offset).round();\n\t\t\tthis._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity);\n\t\t} else {\n\t\t\tthis._rawPanBy(offset);\n\t\t\tthis._wrapWorldCopy();\n\t\t\tthis.fire('move').fire('moveend');\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the view of the map (geographical center and zoom) performing a smooth\n\t * pan-zoom animation. If the user prefers reduced motion (and `animate: true` isn't\n\t * passed), it behaves like `setView` instead, only animating short pans and zooms.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} targetCenter\n\t * @param {number} [targetZoom]\n\t * @param {ZoomPanOptions} [options]\n\t * @returns {this}\n\t */\n\tflyTo(targetCenter, targetZoom, options) {\n\n\t\toptions ??= {};\n\t\tif (options.animate === false) {\n\t\t\treturn this.setView(targetCenter, targetZoom, {...options, zoom: {...options.zoom, animate: false}});\n\t\t}\n\t\tif (options.animate !== true && this._prefersReducedMotion()) {\n\t\t\treturn this.setView(targetCenter, targetZoom, options);\n\t\t}\n\n\t\tthis._stop();\n\n\t\ttargetZoom = targetZoom === undefined ? this._zoom : this._limitZoom(targetZoom);\n\t\ttargetCenter = this._limitCenter(new LatLng(targetCenter), targetZoom, this.options.maxBounds);\n\n\t\tconst from = this.project(this.getCenter()),\n\t\tto = this.project(targetCenter),\n\t\tsize = this.getSize(),\n\t\tstartZoom = this._zoom;\n\n\t\tconst w0 = Math.max(size.x, size.y),\n\t\tw1 = w0 * this.getZoomScale(startZoom, targetZoom),\n\t\tu1 = (to.distanceTo(from)) || 1,\n\t\trho = 1.42,\n\t\trho2 = rho * rho;\n\n\t\tfunction r(i) {\n\t\t\tconst s1 = i ? -1 : 1,\n\t\t\ts2 = i ? w1 : w0,\n\t\t\tt1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1,\n\t\t\tb1 = 2 * s2 * rho2 * u1;\n\n\t\t\treturn -Math.asinh(t1 / b1);\n\t\t}\n\n\t\tconst r0 = r(0);\n\n\t\tfunction u(s) { return w0 * (Math.cosh(r0) * Math.tanh(r0 + rho * s) - Math.sinh(r0)) / rho2; }\n\n\t\tfunction easeOut(t) { return 1 - (1 - t) ** 1.5; }\n\n\t\tconst start = Date.now(),\n\t\tS = (r(1) - r0) / rho,\n\t\tduration = options.duration ? 1000 * options.duration : 1000 * S * 0.8;\n\n\t\tconst frame = () => {\n\t\t\tconst t = (Date.now() - start) / duration,\n\t\t\ts = easeOut(t) * S;\n\n\t\t\tif (t <= 1) {\n\t\t\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\n\t\t\t\tthis._move(\n\t\t\t\t\tthis.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom),\n\t\t\t\t\tthis.getScaleZoom(Math.cosh(r0 + rho * s) / Math.cosh(r0), startZoom),\n\t\t\t\t\t{flyTo: true});\n\n\t\t\t} else {\n\t\t\t\t// the last step shifts the pixel origin even at the same zoom, and layers like GridLayer only\n\t\t\t\t// re-anchor on 'zoom' (#9438)\n\t\t\t\tconst zoomChanged = this._zoom !== targetZoom;\n\t\t\t\tthis._move(targetCenter, targetZoom);\n\t\t\t\tif (!zoomChanged) { this.fire('zoom'); }\n\t\t\t\tthis._moveEnd(true);\n\t\t\t}\n\t\t};\n\n\t\tthis._moveStart(true, options.noMoveStart);\n\n\t\tframe(this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\n\t * but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {FitBoundsOptions} [options]\n\t * @returns {this}\n\t */\n\tflyToBounds(bounds, options) {\n\t\tconst target = this._getBoundsCenterZoom(bounds, options);\n\t\treturn this.flyTo(target.center, target.zoom, options);\n\t}\n\n\t/**\n\t * Changes the [Coordinate Reference System](#crs) of the map, keeping its center\n\t * and (as far as possible with the zoom levels and `zoomSnap`) its scale at the\n\t * center. All layers are redrawn in the new CRS; note that tile layers only work\n\t * with the CRS their tiles were made for.\n\t * @group Methods for modifying map state\n\t * @param {CRS} crs\n\t * @returns {this}\n\t */\n\tsetCrs(crs) {\n\t\tconst oldCrs = this.options.crs;\n\t\tif (crs === oldCrs) { return this; }\n\n\t\tif (!this._loaded) {\n\t\t\tthis.options.crs = crs;\n\t\t\tthis.fire('crschange', {oldCrs, crs});\n\t\t\treturn this;\n\t\t}\n\n\t\tthis._stop();\n\t\tconst center = this.getCenter(),\n\t\tresolution = this._getResolution(center);\n\n\t\tthis.options.crs = crs;\n\n\t\t// the zoom with the same distance per pixel at the center\n\t\tconst zoom = this._limitZoom(crs.zoom(crs.scale(this._zoom) * this._getResolution(center) / resolution));\n\n\t\tthis.fire('crschange', {oldCrs, crs});\n\n\t\tthis._resetView(center, zoom);\n\t\treturn this;\n\t}\n\n\t// The distance per pixel at `latlng` at the current zoom, in the units of the CRS.\n\t_getResolution(latlng) {\n\t\tconst crs = this.options.crs,\n\t\tpoint = crs.latLngToPoint(latlng, this._zoom);\n\t\treturn crs.distance(latlng, crs.pointToLatLng(point.add([1, 0]), this._zoom));\n\t}\n\n\t/**\n\t * Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {this}\n\t */\n\tsetMaxBounds(bounds) {\n\t\tbounds = new LatLngBounds(bounds);\n\n\t\tif (this.listens('moveend', this._panInsideMaxBounds)) {\n\t\t\tthis.off('moveend', this._panInsideMaxBounds);\n\t\t}\n\n\t\tif (!bounds.isValid()) {\n\t\t\tthis.options.maxBounds = null;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.options.maxBounds = bounds;\n\n\t\tif (this._loaded) {\n\t\t\tthis._panInsideMaxBounds();\n\t\t}\n\n\t\treturn this.on('moveend', this._panInsideMaxBounds);\n\t}\n\n\t/**\n\t * Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).\n\t * @group Methods for modifying map state\n\t * @param {number} zoom\n\t * @returns {this}\n\t */\n\tsetMinZoom(zoom) {\n\t\tconst oldZoom = this.options.minZoom;\n\t\tthis.options.minZoom = zoom;\n\n\t\tif (this._loaded && oldZoom !== zoom) {\n\t\t\tthis.fire('zoomlevelschange');\n\n\t\t\tif (this.getZoom() < this.options.minZoom) {\n\t\t\t\treturn this.setZoom(zoom);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).\n\t * @group Methods for modifying map state\n\t * @param {number} zoom\n\t * @returns {this}\n\t */\n\tsetMaxZoom(zoom) {\n\t\tconst oldZoom = this.options.maxZoom;\n\t\tthis.options.maxZoom = zoom;\n\n\t\tif (this._loaded && oldZoom !== zoom) {\n\t\t\tthis.fire('zoomlevelschange');\n\n\t\t\tif (this.getZoom() > this.options.maxZoom) {\n\t\t\t\treturn this.setZoom(zoom);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Pans the map to the closest view that would lie inside the given bounds (if\n\t * it's not already), controlling the animation using the options specific, if any.\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanInsideBounds(bounds, options) {\n\t\tthis._enforcingBounds = true;\n\t\tconst center = this.getCenter(),\n\t\tnewCenter = this._limitCenter(center, this._zoom, LatLngBounds.from(bounds));\n\n\t\tif (!center.equals(newCenter)) {\n\t\t\tthis.panTo(newCenter, options);\n\t\t}\n\n\t\tthis._enforcingBounds = false;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Pans the map the minimum amount to make the `latlng` visible. Use\n\t * padding options to fit the display to more restricted bounds.\n\t * If `latlng` is already within the (optionally padded) display bounds,\n\t * the map will not be panned.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} latlng\n\t * @param {PaddingOptions & PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanInside(latlng, options) {\n\t\toptions ??= {};\n\n\t\tconst paddingTL = Point.from(options.paddingTopLeft || options.padding || [0, 0]),\n\t\tpaddingBR = Point.from(options.paddingBottomRight || options.padding || [0, 0]),\n\t\tpixelCenter = this.project(this.getCenter()),\n\t\tpixelPoint = this.project(latlng),\n\t\tpixelBounds = this.getPixelBounds(),\n\t\tpaddedBounds = new Bounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]),\n\t\tpaddedSize = paddedBounds.getSize();\n\n\t\tif (!paddedBounds.contains(pixelPoint)) {\n\t\t\tthis._enforcingBounds = true;\n\t\t\tconst centerOffset = pixelPoint.subtract(paddedBounds.getCenter());\n\t\t\tconst offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);\n\t\t\tpixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x;\n\t\t\tpixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y;\n\t\t\tthis.panTo(this.unproject(pixelCenter), options);\n\t\t\tthis._enforcingBounds = false;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Checks if the map container size changed and updates the map if so —\n\t * call it after you've changed the map size dynamically, also animating\n\t * pan by default. If `options.pan` is `false`, panning will not occur.\n\t * If `options.debounceMoveend` is `true`, it will delay `moveend` event so\n\t * that it doesn't happen often even if the method is called many\n\t * times in a row. Passing `true` instead of options animates the panning.\n\t * @group Methods for modifying map state\n\t * @param {InvalidateSizeOptions|boolean} [options]\n\t * @returns {this}\n\t */\n\tinvalidateSize(options) {\n\t\tif (!this._loaded) { return this; }\n\n\t\toptions = {\n\t\t\tanimate: false,\n\t\t\tpan: true,\n\t\t\t...(options === true ? {animate: true} : options)\n\t\t};\n\n\t\tconst oldSize = this.getSize();\n\t\tthis._sizeChanged = true;\n\t\tthis._lastCenter = null;\n\n\t\tconst newSize = this.getSize(),\n\t\toldCenter = oldSize.divideBy(2).round(),\n\t\tnewCenter = newSize.divideBy(2).round(),\n\t\toffset = oldCenter.subtract(newCenter);\n\n\t\tif (!offset.x && !offset.y) { return this; }\n\n\t\tif (options.animate && options.pan) {\n\t\t\tthis.panBy(offset);\n\n\t\t} else {\n\t\t\tif (options.pan) {\n\t\t\t\tthis._rawPanBy(offset);\n\t\t\t}\n\n\t\t\tthis.fire('move');\n\n\t\t\tif (options.debounceMoveend) {\n\t\t\t\tclearTimeout(this._sizeTimer);\n\t\t\t\tthis._sizeTimer = setTimeout(this.fire.bind(this, 'moveend'), 200);\n\t\t\t} else {\n\t\t\t\tthis.fire('moveend');\n\t\t\t}\n\t\t}\n\n\t\treturn this.fire('resize', {\n\t\t\toldSize,\n\t\t\tnewSize\n\t\t});\n\t}\n\n\t/**\n\t * Stops the currently running `panTo` or `flyTo` animation, if any.\n\t * @group Methods for modifying map state\n\t * @returns {this}\n\t */\n\tstop() {\n\t\tthis.setZoom(this._limitZoom(this._zoom));\n\t\tif (!this.options.zoomSnap) {\n\t\t\tthis.fire('viewreset');\n\t\t}\n\t\treturn this._stop();\n\t}\n\n\t/**\n\t * Tries to locate the user using the Geolocation API, firing a\n\t * [`locationfound`](#map-locationfound) event with location data on success or a\n\t * [`locationerror`](#map-locationerror) event on failure, and optionally sets the map\n\t * view to the user's location with respect to detection accuracy (or to the world view\n\t * if geolocation failed).\n\t * Note that, if your page doesn't use HTTPS, this method will fail in\n\t * modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))\n\t * See `LocateOptions` for more details.\n\t * @group Geolocation methods\n\t * @param {LocateOptions} [options]\n\t * @returns {this}\n\t */\n\tlocate(options) {\n\n\t\toptions = this._locateOptions = {\n\t\t\ttimeout: 10000,\n\t\t\twatch: false,\n\t\t\t// setView: false\n\t\t\t// maxZoom: <Number>\n\t\t\t// maximumAge: 0\n\t\t\t// enableHighAccuracy: false\n\t\t\t...options\n\t\t};\n\n\t\tif (!('geolocation' in navigator)) {\n\t\t\tthis._handleGeolocationError({\n\t\t\t\tcode: 0,\n\t\t\t\tmessage: 'Geolocation not supported.'\n\t\t\t});\n\t\t\treturn this;\n\t\t}\n\n\t\tconst onResponse = this._handleGeolocationResponse.bind(this),\n\t\tonError = this._handleGeolocationError.bind(this);\n\n\t\tif (options.watch) {\n\t\t\tif (this._locationWatchId !== undefined) {\n\t\t\t\tnavigator.geolocation.clearWatch(this._locationWatchId);\n\t\t\t}\n\t\t\tthis._locationWatchId = navigator.geolocation.watchPosition(onResponse, onError, options);\n\t\t} else {\n\t\t\tnavigator.geolocation.getCurrentPosition(onResponse, onError, options);\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Stops watching location previously initiated by `map.locate({watch: true})`\n\t * and aborts resetting the map view if map.locate was called with\n\t * `{setView: true}`.\n\t * @group Geolocation methods\n\t * @returns {this}\n\t */\n\tstopLocate() {\n\t\tnavigator.geolocation?.clearWatch?.(this._locationWatchId);\n\t\tif (this._locateOptions) {\n\t\t\tthis._locateOptions.setView = false;\n\t\t}\n\t\treturn this;\n\t}\n\n\t_handleGeolocationError(error) {\n\t\tif (!this._container._maplair_id) { return; }\n\n\t\tconst c = error.code,\n\t\tmessage = error.message ||\n\t\t (c === 1 ? 'permission denied' :\n\t\t (c === 2 ? 'position unavailable' : 'timeout'));\n\n\t\tif (this._locateOptions.setView && !this._loaded) {\n\t\t\tthis.fitWorld();\n\t\t}\n\n\t\tthis.fire('locationerror', {\n\t\t\tcode: c,\n\t\t\tmessage: `Geolocation error: ${message}.`\n\t\t});\n\t}\n\n\t_handleGeolocationResponse(pos) {\n\t\tif (!this._container._maplair_id) { return; }\n\n\t\tconst lat = pos.coords.latitude,\n\t\tlng = pos.coords.longitude,\n\t\tlatlng = new LatLng(lat, lng),\n\t\tbounds = latlng.toBounds(pos.coords.accuracy * 2),\n\t\toptions = this._locateOptions;\n\n\t\tif (options.setView) {\n\t\t\tconst zoom = this.getBoundsZoom(bounds);\n\t\t\tthis.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\n\t\t}\n\n\t\tconst data = {\n\t\t\tlatlng,\n\t\t\tbounds,\n\t\t\ttimestamp: pos.timestamp\n\t\t};\n\n\t\tfor (const i in pos.coords) { // do not use Object.keys here to access getters of GeolocationCoordinates\n\t\t\tif (typeof pos.coords[i] === 'number') {\n\t\t\t\tdata[i] = pos.coords[i];\n\t\t\t}\n\t\t}\n\n\t\tthis.fire('locationfound', data);\n\t}\n\n\t/**\n\t * Adds a new `Handler` to the map, given its name and constructor function.\n\t * @group Other methods\n\t * @param {string} name\n\t * @param {new (map: MaplairMap) => Handler} HandlerClass\n\t * @returns {this}\n\t */\n\taddHandler(name, HandlerClass) {\n\t\tif (!HandlerClass) { return this; }\n\n\t\tconst handler = this[name] = new HandlerClass(this);\n\n\t\tthis._handlers.push(handler);\n\n\t\tif (this.options[name]) {\n\t\t\thandler.enable();\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Destroys the map and clears all related event listeners.\n\t * @group Other methods\n\t * @returns {this}\n\t */\n\tremove() {\n\n\t\tthis._initEvents(true);\n\t\tif (this.options.maxBounds) { this.off('moveend', this._panInsideMaxBounds); }\n\n\t\tif (this._containerId !== this._container._maplair_id) {\n\t\t\tthrow new Error('Map container is being reused by another instance');\n\t\t}\n\n\t\tdelete this._container._maplair_id;\n\t\tdelete this._containerId;\n\n\t\tif (this._locationWatchId !== undefined) {\n\t\t\tthis.stopLocate();\n\t\t}\n\n\t\tthis._stop();\n\n\t\tPointerEvents.disablePointerDetection(this._container);\n\t\tthis._mapPane.remove();\n\t\tfor (const name of this._ariaAttributes) {\n\t\t\tthis._container.removeAttribute(name);\n\t\t}\n\n\t\tif (this._clearControlPos) {\n\t\t\tthis._clearControlPos();\n\t\t}\n\t\tcancelAnimationFrame(this._resizeRequest);\n\t\tcancelAnimationFrame(this._idleRequest);\n\t\tthis._watchPixelRatio(true);\n\n\t\tfor (const handler of this._handlers) {\n\t\t\thandler.disable();\n\t\t}\n\n\t\tclearTimeout(this._transitionEndTimer);\n\t\tclearTimeout(this._sizeTimer);\n\n\t\tif (this._loaded) {\n\t\t\tthis.fire('unload');\n\t\t}\n\n\t\tfor (const layer of Object.values(this._layers)) {\n\t\t\tlayer.remove();\n\t\t}\n\t\tfor (const pane of Object.values(this._panes)) {\n\t\t\tpane.remove();\n\t\t}\n\n\n\t\tthis._layers = {};\n\t\tthis._panes = {};\n\t\tdelete this._mapPane;\n\t\tdelete this._renderer;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,\n\t * then returns it. The pane is created as a child of `container`, or\n\t * as a child of the main map pane if not set.\n\t * @group Other methods\n\t * @param {string} name\n\t * @param {HTMLElement} [container]\n\t * @returns {HTMLElement}\n\t */\n\tcreatePane(name, container) {\n\t\tconst className = `maplair-pane${name ? ` maplair-${name.replace('Pane', '')}-pane` : ''}`,\n\t\tpane = DomUtil.create('div', className, container || this._mapPane);\n\n\t\tif (name) {\n\t\t\tthis._panes[name] = pane;\n\t\t}\n\t\treturn pane;\n\t}\n\n\t/**\n\t * Returns the geographical center of the map view.\n\t * @group Methods for getting map state\n\t * @returns {LatLng}\n\t */\n\tgetCenter() {\n\t\tthis._checkIfLoaded();\n\n\t\tif (this._lastCenter && this._getMapPanePos().equals(this._lastCenterPanePos)) {\n\t\t\treturn new LatLng(this._lastCenter);\n\t\t}\n\t\treturn this.layerPointToLatLng(this._getCenterLayerPoint());\n\t}\n\n\t/**\n\t * Returns the current zoom level of the map view.\n\t * @group Methods for getting map state\n\t * @returns {number}\n\t */\n\tgetZoom() {\n\t\treturn this._zoom;\n\t}\n\n\t/**\n\t * Returns the geographical bounds visible in the current map view.\n\t * @group Methods for getting map state\n\t * @returns {LatLngBounds}\n\t */\n\tgetBounds() {\n\t\tconst bounds = this.getPixelBounds(),\n\t\tsw = this.unproject(bounds.getBottomLeft()),\n\t\tne = this.unproject(bounds.getTopRight());\n\n\t\treturn new LatLngBounds(sw, ne);\n\t}\n\n\t/**\n\t * Returns the minimum zoom level of the map (if set in the `minZoom` option of the\n\t * map or of any layers), or `0` by default.\n\t * @group Methods for getting map state\n\t * @returns {number}\n\t */\n\tgetMinZoom() {\n\t\treturn this.options.minZoom ?? this._layersMinZoom ?? 0;\n\t}\n\n\t/**\n\t * Returns the maximum zoom level of the map (if set in the `maxZoom` option of the\n\t * map or of any layers).\n\t * @group Methods for getting map state\n\t * @returns {number}\n\t */\n\tgetMaxZoom() {\n\t\treturn this.options.maxZoom ?? this._layersMaxZoom ?? Infinity;\n\t}\n\n\t/**\n\t * Returns the maximum zoom level on which the given bounds fit to the map\n\t * view in its entirety. If `inside` (optional) is set to `true`, the method\n\t * instead returns the minimum zoom level on which the map view fits into\n\t * the given bounds in its entirety.\n\t * @group Methods for getting map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {boolean} [inside]\n\t * @param {PointExpression} [padding]\n\t * @returns {number}\n\t */\n\tgetBoundsZoom(bounds, inside, padding) {\n\t\tbounds = LatLngBounds.from(bounds);\n\t\tpadding = Point.from(padding ?? [0, 0]);\n\n\t\tlet zoom = this.getZoom() ?? 0;\n\t\tconst min = this.getMinZoom(),\n\t\tmax = this.getMaxZoom(),\n\t\tnw = bounds.getNorthWest(),\n\t\tse = bounds.getSouthEast(),\n\t\tsize = this.getSize().subtract(padding),\n\t\tboundsSize = new Bounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),\n\t\tsnap = this.options.zoomSnap,\n\t\tscalex = size.x / boundsSize.x,\n\t\tscaley = size.y / boundsSize.y,\n\t\tscale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\n\n\t\tzoom = this.getScaleZoom(scale, zoom);\n\n\t\tif (snap) {\n\t\t\tzoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\n\t\t\tzoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\n\t\t}\n\n\t\treturn Math.max(min, Math.min(max, zoom));\n\t}\n\n\t/**\n\t * Returns the current size of the map container (in pixels).\n\t * @group Methods for getting map state\n\t * @returns {Point}\n\t */\n\tgetSize() {\n\t\tif (!this._size || this._sizeChanged) {\n\t\t\tthis._size = new Point(\n\t\t\t\tthis._container.clientWidth || 0,\n\t\t\t\tthis._container.clientHeight || 0);\n\n\t\t\tthis._sizeChanged = false;\n\t\t}\n\t\treturn new Point(this._size);\n\t}\n\n\t/**\n\t * Returns the bounds of the current map view in projected pixel\n\t * coordinates (sometimes useful in layer and overlay implementations).\n\t * If `center` and `zoom` is omitted, the map's current zoom level and center is used.\n\t * @group Methods for getting map state\n\t * @param {LatLngExpression} [center]\n\t * @param {number} [zoom]\n\t * @returns {Bounds}\n\t */\n\tgetPixelBounds(center, zoom) {\n\t\tconst topLeftPoint = this._getTopLeftPoint(center, zoom);\n\t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\n\t}\n\n\t// TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to\n\t// the map pane? \"left point of the map layer\" can be confusing, specially\n\t// since there can be negative offsets.\n\t/**\n\t * Returns the projected pixel coordinates of the top left point of\n\t * the map layer (useful in custom layer and overlay implementations).\n\t * @group Methods for getting map state\n\t * @returns {Point}\n\t */\n\tgetPixelOrigin() {\n\t\tthis._checkIfLoaded();\n\t\treturn this._pixelOrigin;\n\t}\n\n\t/**\n\t * Returns the world's bounds in pixel coordinates for zoom level `zoom`.\n\t * If `zoom` is omitted, the map's current zoom level is used.\n\t * @group Methods for getting map state\n\t * @param {number} [zoom]\n\t * @returns {Bounds|null} `null` for CRSs with infinite bounds.\n\t */\n\tgetPixelWorldBounds(zoom) {\n\t\treturn this.options.crs.getProjectedBounds(zoom ?? this.getZoom());\n\t}\n\n\t/**\n\t * Returns a [map pane](#map-pane), given its name or its HTML element (its identity).\n\t * @group Other methods\n\t * @param {string|HTMLElement} pane\n\t * @returns {HTMLElement}\n\t */\n\tgetPane(pane) {\n\t\treturn typeof pane === 'string' ? this._panes[pane] : pane;\n\t}\n\n\t/**\n\t * Returns a plain object containing the names of all [panes](#map-pane) as keys and\n\t * the panes as values.\n\t * @group Other methods\n\t * @returns {Record<string, HTMLElement>}\n\t */\n\tgetPanes() {\n\t\treturn this._panes;\n\t}\n\n\t/**\n\t * Returns the HTML element that contains the map.\n\t * @group Other methods\n\t * @returns {HTMLElement}\n\t */\n\tgetContainer() {\n\t\treturn this._container;\n\t}\n\n\n\t/**\n\t * Returns the scale factor to be applied to a map transition from zoom level\n\t * `fromZoom` to `toZoom`. Used internally to help with zoom animations.\n\t * @group Conversion methods\n\t * @param {number} toZoom\n\t * @param {number} [fromZoom]\n\t * @returns {number}\n\t */\n\tgetZoomScale(toZoom, fromZoom) {\n\t\t// TODO replace with universal implementation after refactoring projections\n\t\tconst crs = this.options.crs;\n\t\tfromZoom ??= this._zoom;\n\t\treturn crs.scale(toZoom) / crs.scale(fromZoom);\n\t}\n\n\t/**\n\t * Returns the zoom level that the map would end up at, if it is at `fromZoom`\n\t * level and everything is scaled by a factor of `scale`. Inverse of\n\t * [`getZoomScale`](#map-getZoomScale).\n\t * @group Conversion methods\n\t * @param {number} scale\n\t * @param {number} [fromZoom]\n\t * @returns {number}\n\t */\n\tgetScaleZoom(scale, fromZoom) {\n\t\tconst crs = this.options.crs;\n\t\tfromZoom ??= this._zoom;\n\t\tconst zoom = crs.zoom(scale * crs.scale(fromZoom));\n\t\treturn isNaN(zoom) ? Infinity : zoom;\n\t}\n\n\t/**\n\t * Projects a geographical coordinate `LatLng` according to the projection\n\t * of the map's CRS, then scales it according to `zoom` and the CRS's\n\t * `Transformation`. The result is pixel coordinate relative to\n\t * the CRS origin.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @param {number} [zoom]\n\t * @returns {Point}\n\t */\n\tproject(latlng, zoom) {\n\t\tzoom ??= this._zoom;\n\t\treturn this.options.crs.latLngToPoint(LatLng.from(latlng), zoom);\n\t}\n\n\t/**\n\t * Inverse of [`project`](#map-project).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @param {number} [zoom]\n\t * @returns {LatLng}\n\t */\n\tunproject(point, zoom) {\n\t\tzoom ??= this._zoom;\n\t\treturn this.options.crs.pointToLatLng(Point.from(point), zoom);\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\n\t * returns the corresponding geographical coordinate (for the current zoom level).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {LatLng}\n\t */\n\tlayerPointToLatLng(point) {\n\t\tconst projectedPoint = Point.from(point).add(this.getPixelOrigin());\n\t\treturn this.unproject(projectedPoint);\n\t}\n\n\t/**\n\t * Given a geographical coordinate, returns the corresponding pixel coordinate\n\t * relative to the [origin pixel](#map-getpixelorigin).\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @returns {Point}\n\t */\n\tlatLngToLayerPoint(latlng) {\n\t\treturn this.project(LatLng.from(latlng))._subtract(this.getPixelOrigin());\n\t}\n\n\t/**\n\t * Returns a `LatLng` where `lat` and `lng` has been wrapped according to the\n\t * map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the\n\t * CRS's bounds.\n\t * By default this means longitude is wrapped around the dateline so its\n\t * value is between -180 and +180 degrees.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @returns {LatLng}\n\t */\n\twrapLatLng(latlng) {\n\t\treturn this.options.crs.wrapLatLng(LatLng.from(latlng));\n\t}\n\n\t/**\n\t * Returns a `LatLngBounds` with the same size as the given one, ensuring that\n\t * its center is within the CRS's bounds.\n\t * By default this means the center longitude is wrapped around the dateline so its\n\t * value is between -180 and +180 degrees, and the majority of the bounds\n\t * overlaps the CRS's bounds.\n\t * @group Conversion methods\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {LatLngBounds}\n\t */\n\twrapLatLngBounds(bounds) {\n\t\treturn this.options.crs.wrapLatLngBounds(new LatLngBounds(bounds));\n\t}\n\n\t/**\n\t * Returns the distance between two geographical coordinates according to\n\t * the map's CRS. By default this measures distance in meters.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng1\n\t * @param {LatLngExpression} latlng2\n\t * @returns {number}\n\t */\n\tdistance(latlng1, latlng2) {\n\t\treturn this.options.crs.distance(LatLng.from(latlng1), LatLng.from(latlng2));\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the map container, returns the corresponding\n\t * pixel coordinate relative to the [origin pixel](#map-getpixelorigin).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tcontainerPointToLayerPoint(point) {\n\t\treturn Point.from(point).subtract(this._getMapPanePos());\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\n\t * returns the corresponding pixel coordinate relative to the map container.\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tlayerPointToContainerPoint(point) {\n\t\treturn Point.from(point).add(this._getMapPanePos());\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the map container, returns\n\t * the corresponding geographical coordinate (for the current zoom level).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {LatLng}\n\t */\n\tcontainerPointToLatLng(point) {\n\t\tconst layerPoint = this.containerPointToLayerPoint(Point.from(point));\n\t\treturn this.layerPointToLatLng(layerPoint);\n\t}\n\n\t/**\n\t * Given a geographical coordinate, returns the corresponding pixel coordinate\n\t * relative to the map container.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @returns {Point}\n\t */\n\tlatLngToContainerPoint(latlng) {\n\t\treturn this.layerPointToContainerPoint(this.latLngToLayerPoint(LatLng.from(latlng)));\n\t}\n\n\t/**\n\t * Given a PointerEvent object, returns the pixel coordinate relative to the\n\t * map container where the event took place.\n\t * @group Conversion methods\n\t * @param {MouseEvent|PointerEvent} e\n\t * @returns {Point}\n\t */\n\tpointerEventToContainerPoint(e) {\n\t\treturn DomEvent.getPointerPosition(e, this._container);\n\t}\n\n\t/**\n\t * Given a PointerEvent object, returns the pixel coordinate relative to\n\t * the [origin pixel](#map-getpixelorigin) where the event took place.\n\t * @group Conversion methods\n\t * @param {MouseEvent|PointerEvent} e\n\t * @returns {Point}\n\t */\n\tpointerEventToLayerPoint(e) {\n\t\treturn this.containerPointToLayerPoint(this.pointerEventToContainerPoint(e));\n\t}\n\n\t/**\n\t * Given a PointerEvent object, returns geographical coordinate where the\n\t * event took place.\n\t * @group Conversion methods\n\t * @param {MouseEvent|PointerEvent} e\n\t * @returns {LatLng}\n\t */\n\tpointerEventToLatLng(e) {\n\t\treturn this.layerPointToLatLng(this.pointerEventToLayerPoint(e));\n\t}\n\n\n\t// map initialization methods\n\n\t_initContainer(id) {\n\t\tconst container = this._container = DomUtil.get(id);\n\n\t\tif (!container) {\n\t\t\tthrow new Error('Map container not found.');\n\t\t} else if (container._maplair_id) {\n\t\t\tthrow new Error('Map container is already initialized.');\n\t\t}\n\n\t\tPointerEvents.enablePointerDetection(container);\n\t\tDomEvent.on(container, 'scroll', this._onScroll, this);\n\t\tthis._containerId = Util.stamp(container);\n\n\t}\n\n\t_initLayout() {\n\t\tconst container = this._container;\n\n\t\tthis._fadeAnimated = this.options.fadeAnimation;\n\n\t\t// maplair-touch and maplair-retina have no rules in maplair.css, but custom stylesheets may still target them\n\t\tconst classes = ['maplair-container', 'maplair-touch'];\n\n\t\tif (window.devicePixelRatio > 1) { classes.push('maplair-retina'); }\n\t\tif (this._fadeAnimated) { classes.push('maplair-fade-anim'); }\n\n\t\tcontainer.classList.add(...classes);\n\n\t\t// an accessible name for the map, e.g. for the landmarks of screen readers\n\t\tthis._ariaAttributes = [];\n\t\tif (!container.hasAttribute('role')) {\n\t\t\tcontainer.setAttribute('role', 'region');\n\t\t\tthis._ariaAttributes.push('role');\n\t\t}\n\t\tif (!container.hasAttribute('aria-label') && !container.hasAttribute('aria-labelledby')) {\n\t\t\tcontainer.setAttribute('aria-label', this.options.ariaLabel ?? I18n.translate('Map'));\n\t\t\tthis._ariaAttributes.push('aria-label');\n\t\t}\n\n\t\tconst {position} = getComputedStyle(container);\n\n\t\tif (position !== 'absolute' && position !== 'relative' && position !== 'fixed' && position !== 'sticky') {\n\t\t\tcontainer.style.position = 'relative';\n\t\t}\n\n\t\tthis._initPanes();\n\n\t\tif (this._initControlPos) {\n\t\t\tthis._initControlPos();\n\t\t}\n\t}\n\n\t_initPanes() {\n\t\tconst panes = this._panes = {};\n\t\tthis._paneRenderers = {};\n\n\t\t// the default panes, see the class description\n\t\tthis._mapPane = this.createPane('mapPane', this._container);\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\n\n\t\tthis.createPane('tilePane');\n\t\tthis.createPane('overlayPane');\n\t\tthis.createPane('shadowPane');\n\t\tthis.createPane('markerPane');\n\t\tthis.createPane('tooltipPane');\n\t\tthis.createPane('popupPane');\n\n\t\tif (!this.options.markerZoomAnimation) {\n\t\t\tpanes.markerPane.classList.add('maplair-zoom-hide');\n\t\t\tpanes.shadowPane.classList.add('maplair-zoom-hide');\n\t\t}\n\t}\n\n\n\t// private methods that modify map state\n\n\t_resetView(center, zoom, noMoveStart) {\n\t\tconst loading = !this._loaded;\n\t\tthis._loaded = true;\n\t\tzoom = this._limitZoom(zoom);\n\n\t\t// before the pane reset, so that listeners still see the current view\n\t\tthis.fire('viewprereset', {center, zoom});\n\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\n\n\t\tconst zoomChanged = this._zoom !== zoom;\n\t\tif (zoomChanged && !loading) {\n\t\t\tthis._instantZoomEnd = Date.now() + zoomAnimDuration;\n\t\t}\n\t\tthis\n\t\t\t._moveStart(zoomChanged, noMoveStart)\n\t\t\t._move(center, zoom)\n\t\t\t._moveEnd(zoomChanged);\n\n\t\tthis.fire('viewreset');\n\n\t\tif (loading) {\n\t\t\tthis.fire('load');\n\t\t}\n\t}\n\n\t/**\n\t * Fires an event of the specified type, see `Evented.fire()`. The map state change\n\t * events caused by the user get an `originalEvent` property (see the class\n\t * description).\n\t * @param {string} type\n\t * @param {object} [data]\n\t * @param {boolean} [propagate]\n\t * @returns {this}\n\t */\n\tfire(type, data, propagate) {\n\t\tif (this._userEvent && MaplairMap._viewEvents.has(type)) {\n\t\t\tdata = {originalEvent: this._userEvent, ...data};\n\t\t\tif (type === 'moveend') {\n\t\t\t\tthis._userEvent = null;\n\t\t\t} else {\n\t\t\t\tthis._userMoving = true;\n\t\t\t}\n\t\t}\n\t\treturn super.fire(type, data, propagate);\n\t}\n\n\tstatic _viewEvents = new Set(['movestart', 'move', 'moveend', 'zoomstart', 'zoom', 'zoomend', 'zoomanim']);\n\n\t_watchPixelRatio(remove) {\n\t\tthis._pixelRatioQuery?.removeEventListener('change', this._onPixelRatioChange);\n\t\tif (remove || typeof window === 'undefined' || !window.matchMedia) { return; }\n\n\t\tthis._onPixelRatioChange ??= () => {\n\t\t\tthis._watchPixelRatio();\n\t\t\tthis.fire('pixelratiochange');\n\t\t};\n\t\t// matches until the ratio changes, then a new query is needed\n\t\tthis._pixelRatioQuery = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);\n\t\tthis._pixelRatioQuery.addEventListener('change', this._onPixelRatioChange);\n\t}\n\n\t_onBusy() {\n\t\tthis._viewChanging = true;\n\t\tthis._idle = false;\n\t}\n\n\t// resets the bounds of the `markerCulling` option, computed once per view by `Marker._updateCulling()`\n\t_onMove() {\n\t\tthis._cullingBounds = null;\n\t}\n\n\t_onViewChanged() {\n\t\tthis._viewChanging = false;\n\t\tthis._scheduleIdleCheck();\n\t}\n\n\t// Called by layers when they start loading, see `GridLayer`.\n\t_onLayerLoading() {\n\t\tthis._idle = false;\n\t}\n\n\t// Called by layers when they finished loading, see `GridLayer`.\n\t_scheduleIdleCheck() {\n\t\tcancelAnimationFrame(this._idleRequest);\n\t\t// After the current task, so that layers can start loading on the same `moveend`\n\t\tthis._idleRequest = requestAnimationFrame(() => this._checkIdle());\n\t}\n\n\t_checkIdle() {\n\t\tif (this._idle || !this._loaded || this._viewChanging || this._animatingZoom) { return; }\n\t\tfor (const layer of Object.values(this._layers)) {\n\t\t\tif (layer.isLoading?.()) { return; }\n\t\t}\n\t\tthis._idle = true;\n\t\tthis.fire('idle');\n\t}\n\n\t// Marks the following view change (until `moveend`) as caused by the DOM event `e`\n\t// of the user, see the map state change events. If no view change starts right\n\t// away, the mark is dropped.\n\t_setUserEvent(e) {\n\t\tthis._userEvent = e;\n\t\tthis._userMoving = false;\n\t\tqueueMicrotask(() => {\n\t\t\tif (this._userEvent === e && !this._userMoving) {\n\t\t\t\tthis._userEvent = null;\n\t\t\t}\n\t\t});\n\t}\n\n\t_moveStart(zoomChanged, noMoveStart) {\n\t\tif (zoomChanged) {\n\t\t\tthis.fire('zoomstart');\n\t\t}\n\t\tif (!noMoveStart) {\n\t\t\tthis.fire('movestart');\n\t\t}\n\t\treturn this;\n\t}\n\n\t_move(center, zoom, data, suppressEvent) {\n\t\tif (zoom === undefined) {\n\t\t\tzoom = this._zoom;\n\t\t}\n\t\tconst zoomChanged = this._zoom !== zoom;\n\n\t\tthis._zoom = zoom;\n\t\tthis._lastCenter = center;\n\t\tthis._lastCenterPanePos = this._getMapPanePos();\n\t\tthis._pixelOrigin = this._getNewPixelOrigin(center);\n\n\t\tif (!suppressEvent) {\n\t\t\tif (zoomChanged || (data?.pinch)) {\t// Always fire 'zoom' if pinching because #3530\n\t\t\t\tthis.fire('zoom', data);\n\t\t\t}\n\n\t\t\tthis.fire('move', data);\n\t\t} else if (data?.pinch) {\t// Always fire 'zoom' if pinching because #3530\n\t\t\tthis.fire('zoom', data);\n\t\t}\n\t\treturn this;\n\t}\n\n\t_moveEnd(zoomChanged) {\n\t\tif (zoomChanged) {\n\t\t\tthis.fire('zoomend');\n\t\t}\n\n\t\treturn this.fire('moveend');\n\t}\n\n\t_stop() {\n\t\tcancelAnimationFrame(this._flyToFrame);\n\t\tcancelAnimationFrame(this._zoomAnimFrame);\n\t\tthis._panAnim?.stop();\n\t\treturn this;\n\t}\n\n\t_rawPanBy(offset) {\n\t\tDomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(offset));\n\t}\n\n\t// Shifts a map pane position by whole world widths to bring the view center back into the original world, moving\n\t// the pane and firing `worldcopyjump` if that makes it jump from where it is now.\n\t_wrapWorldCopy(pos = this._getMapPanePos()) {\n\t\t// an infinite CRS has no world to wrap around, and no pixel world bounds either\n\t\tif (!this._loaded || !this.options.worldCopyJump || this.options.crs.infinite) { return pos; }\n\n\t\tconst width = this.getPixelWorldBounds().getSize().x,\n\t\tx = pos.x - width * Math.round((pos.x + this.latLngToLayerPoint([0, 0]).x - this.getSize().x / 2) / width),\n\t\tworlds = Math.round((x - this._getMapPanePos().x) / width);\n\n\t\tpos = new Point(x, pos.y);\n\n\t\tif (worlds) {\n\t\t\tDomUtil.setPosition(this._mapPane, pos);\n\t\t\tthis.fire('worldcopyjump', {worlds});\n\t\t}\n\t\treturn pos;\n\t}\n\n\t_getZoomSpan() {\n\t\treturn this.getMaxZoom() - this.getMinZoom();\n\t}\n\n\t_panInsideMaxBounds() {\n\t\tif (!this._enforcingBounds) {\n\t\t\tthis.panInsideBounds(this.options.maxBounds);\n\t\t}\n\t}\n\n\t_checkIfLoaded() {\n\t\tif (!this._loaded) {\n\t\t\tthrow new Error('Set map center and zoom first.');\n\t\t}\n\t}\n\n\t// DOM event handling\n\n\t_initEvents(remove) {\n\t\tthis._targets = {};\n\t\tthis._targets[Util.stamp(this._container)] = this;\n\n\t\tconst onOff = remove ? DomEvent.off : DomEvent.on;\n\n\t\tonOff(this._container, 'click dblclick pointerdown pointerup ' +\n\t\t\t'pointerover pointerout pointermove contextmenu keydown keyup', this._handleDOMEvent, this);\n\n\t\tif (this.options.trackResize) {\n\t\t\tif (!remove) {\n\t\t\t\tif (!this._resizeObserver) {\n\t\t\t\t\tthis._resizeObserver = new ResizeObserver(this._onResize.bind(this));\n\t\t\t\t}\n\t\t\t\tthis._resizeObserver.observe(this._container);\n\t\t\t} else {\n\t\t\t\tthis._resizeObserver.disconnect();\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.transform3DLimit) {\n\t\t\t(remove ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\n\t\t}\n\t}\n\n\t_onResize() {\n\t\tcancelAnimationFrame(this._resizeRequest);\n\t\tthis._resizeRequest = requestAnimationFrame(() => {\n\t\t\t// a hidden map keeps the view of its last visible state\n\t\t\tif (this._container.clientWidth || this._container.clientHeight) {\n\t\t\t\tthis.invalidateSize({debounceMoveend: true});\n\t\t\t}\n\t\t});\n\t}\n\n\t_onScroll() {\n\t\tthis._container.scrollTop = 0;\n\t\tthis._container.scrollLeft = 0;\n\t}\n\n\t_onMoveEnd() {\n\t\tconst pos = this._getMapPanePos();\n\t\tif (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) {\n\t\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have\n\t\t\t// a pixel offset on very high values, see: https://jsfiddle.net/dg6r5hhb/\n\t\t\tthis._resetView(this.getCenter(), this.getZoom());\n\t\t}\n\t}\n\n\t_findEventTargets(e, type) {\n\t\tlet targets = [],\n\t\ttarget,\n\t\tsrc = e.target,\n\t\tdragging = false;\n\t\tconst isHover = type === 'pointerout' || type === 'pointerover';\n\n\t\twhile (src) {\n\t\t\ttarget = this._targets[Util.stamp(src)];\n\t\t\tif (target && (type === 'click' || type === 'preclick') && this._draggableMoved(target)) {\n\t\t\t\t// Prevent firing click after you just dragged an object.\n\t\t\t\tdragging = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (target && target.listens(type, true)) {\n\t\t\t\tif (isHover && !DomEvent.isExternalTarget(src, e)) { break; }\n\t\t\t\ttargets.push(target);\n\t\t\t\tif (isHover) { break; }\n\t\t\t}\n\t\t\tif (src === this._container) { break; }\n\t\t\tsrc = src.parentNode;\n\t\t}\n\t\tif (!targets.length && !dragging && !isHover && this.listens(type, true)) {\n\t\t\ttargets = [this];\n\t\t}\n\t\treturn targets;\n\t}\n\n\t_isClickDisabled(el) {\n\t\twhile (el && el !== this._container) {\n\t\t\tif (el['_maplair_disable_click'] || !el.parentNode) { return true; }\n\t\t\tel = el.parentNode;\n\t\t}\n\t}\n\n\t_handleDOMEvent(e) {\n\t\tconst el = e.target;\n\t\tif (!this._loaded || el['_maplair_disable_events'] || e.type === 'click' && this._isClickDisabled(el)) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis._fireDOMEvent(e, e.type);\n\t};\n\n\tstatic _pointerEvents = ['click', 'dblclick', 'pointerover', 'pointerout', 'contextmenu'];\n\n\t_fireDOMEvent(e, type, canvasTargets) {\n\n\t\tif (type === 'click') {\n\t\t\t// Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\n\t\t\tthis._fireDOMEvent(e, 'preclick', canvasTargets);\n\t\t}\n\n\t\t// Find the layer the event is propagating from and its parents.\n\t\tlet targets = this._findEventTargets(e, type);\n\n\t\tif (canvasTargets) {\n\t\t\t// pick only targets with listeners\n\t\t\tconst filtered = canvasTargets.filter(t => t.listens(type, true));\n\t\t\ttargets = [...filtered, ...targets];\n\t\t}\n\n\t\tif (!targets.length) { return; }\n\n\t\tif (type === 'contextmenu') {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tconst target = targets[0];\n\t\tconst data = {\n\t\t\toriginalEvent: e\n\t\t};\n\n\t\tif (e.type !== 'keydown' && e.type !== 'keyup') {\n\t\t\tconst latlng = (!target._pxRadius || target._pxRadius <= 10) && target.getLatLng?.();\n\t\t\tdata.containerPoint = latlng ?\n\t\t\t\tthis.latLngToContainerPoint(latlng) : this.pointerEventToContainerPoint(e);\n\t\t\tdata.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\n\t\t\tdata.latlng = latlng || this.layerPointToLatLng(data.layerPoint);\n\t\t}\n\n\t\tfor (const t of targets) {\n\t\t\tt.fire(type, data, true);\n\t\t\t// bubblingMouseEvents is the Leaflet 1 name of the option\n\t\t\tconst bubbling = t.options.bubblingMouseEvents ?? t.options.bubblingPointerEvents;\n\t\t\tif (data.originalEvent._stopped ||\n\t\t\t\t(bubbling === false && MaplairMap._pointerEvents.includes(type))) { return; }\n\t\t}\n\t}\n\n\t_draggableMoved(obj) {\n\t\tobj = obj.dragging?.enabled() ? obj : this;\n\t\treturn obj.dragging?.moved() || this.boxZoom?.moved();\n\t}\n\n\n\t/**\n\t * Runs the given function `callback` when the map gets initialized with\n\t * a view (center and zoom) and at least one layer, or immediately\n\t * if it's already initialized, optionally passing a function context.\n\t * @group Other methods\n\t * @param {(event: {target: MaplairMap}) => void} callback\n\t * @param {object} [context]\n\t * @returns {this}\n\t */\n\twhenReady(callback, context) {\n\t\tif (this._loaded) {\n\t\t\tcallback.call(context || this, {target: this});\n\t\t} else {\n\t\t\tthis.on('load', callback, context);\n\t\t}\n\t\treturn this;\n\t}\n\n\n\t// private methods for getting map state\n\n\t_getMapPanePos() {\n\t\treturn DomUtil.getPosition(this._mapPane);\n\t}\n\n\t_getTopLeftPoint(center, zoom) {\n\t\tconst pixelOrigin = center && zoom !== undefined ?\n\t\t\tthis._getNewPixelOrigin(center, zoom) :\n\t\t\tthis.getPixelOrigin();\n\t\treturn pixelOrigin.subtract(this._getMapPanePos());\n\t}\n\n\t_getNewPixelOrigin(center, zoom) {\n\t\tconst viewHalf = this.getSize()._divideBy(2);\n\t\treturn this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos())._round();\n\t}\n\n\t_latLngToNewLayerPoint(latlng, zoom, center) {\n\t\tconst topLeft = this._getNewPixelOrigin(center, zoom);\n\t\treturn this.project(latlng, zoom)._subtract(topLeft);\n\t}\n\n\t// layer point of the current center\n\t_getCenterLayerPoint() {\n\t\treturn this.containerPointToLayerPoint(this.getSize()._divideBy(2));\n\t}\n\n\t// offset of the specified place to the current center in pixels\n\t_getCenterOffset(latlng) {\n\t\treturn this.latLngToLayerPoint(latlng)._round()._subtract(this._getCenterLayerPoint());\n\t}\n\n\t// adjust center for view to get inside bounds\n\t_limitCenter(center, zoom, bounds) {\n\n\t\tif (!bounds) { return center; }\n\n\t\tconst centerPoint = this.project(center, zoom),\n\t\tviewHalf = this.getSize().divideBy(2),\n\t\tviewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\n\t\toffset = this._getBoundsOffset(viewBounds, bounds, zoom);\n\n\t\t// If offset is less than a pixel, ignore.\n\t\t// This prevents unstable projections from getting into\n\t\t// an infinite loop of tiny offsets.\n\t\tif (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) {\n\t\t\treturn center;\n\t\t}\n\n\t\treturn this.unproject(centerPoint.add(offset), zoom);\n\t}\n\n\t// not cached, so that a preference changed mid-session applies right away\n\t_prefersReducedMotion() {\n\t\treturn window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\t}\n\n\t// adjust offset for view to get inside bounds\n\t_limitOffset(offset, bounds) {\n\t\tif (!bounds) { return offset; }\n\n\t\tconst viewBounds = this.getPixelBounds(),\n\t\tnewBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));\n\n\t\treturn offset.add(this._getBoundsOffset(newBounds, bounds));\n\t}\n\n\t// returns offset needed for pxBounds to get inside maxBounds at a specified zoom\n\t_getBoundsOffset(pxBounds, maxBounds, zoom) {\n\t\tconst projectedMaxBounds = new Bounds(\n\t\t\tthis.project(maxBounds.getNorthEast(), zoom),\n\t\t\tthis.project(maxBounds.getSouthWest(), zoom)\n\t\t),\n\t\tminOffset = projectedMaxBounds.min.subtract(pxBounds.min),\n\t\tmaxOffset = projectedMaxBounds.max.subtract(pxBounds.max),\n\n\t\tdx = this._rebound(minOffset.x, -maxOffset.x),\n\t\tdy = this._rebound(minOffset.y, -maxOffset.y);\n\n\t\treturn new Point(dx, dy);\n\t}\n\n\t_rebound(left, right) {\n\t\treturn left + right > 0 ?\n\t\t\tMath.round(left - right) / 2 :\n\t\t\tMath.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));\n\t}\n\n\t_limitZoom(zoom) {\n\t\tconst min = this.getMinZoom(),\n\t\tmax = this.getMaxZoom(),\n\t\tsnap = this.options.zoomSnap;\n\t\tif (snap) {\n\t\t\tzoom = Math.round(zoom / snap) * snap;\n\t\t}\n\t\treturn Math.max(min, Math.min(max, zoom));\n\t}\n\n\t_onPanTransitionStep() {\n\t\tthis.fire('move');\n\t}\n\n\t_onPanTransitionEnd() {\n\t\tthis._mapPane.classList.remove('maplair-pan-anim');\n\t\tthis._wrapWorldCopy();\n\t\tthis.fire('moveend');\n\t}\n\n\t_tryAnimatedPan(center, options) {\n\t\t// difference between the new and current centers in pixels\n\t\tconst offset = this._getCenterOffset(center)._trunc();\n\n\t\t// don't animate too far unless animate: true specified in options\n\t\tif (options?.animate !== true && !this.getSize().contains(offset)) { return false; }\n\n\t\tthis.panBy(offset, options);\n\n\t\treturn true;\n\t}\n\n\t_createAnimProxy() {\n\t\tthis._proxy = DomUtil.create('div', 'maplair-proxy maplair-zoom-animated');\n\t\tthis._panes.mapPane.appendChild(this._proxy);\n\n\t\tthis.on('zoomanim', this._animateProxyZoom, this);\n\t\tthis.on('load moveend', this._animMoveEnd, this);\n\n\t\tDomEvent.on(this._proxy, 'transitionend', this._catchTransitionEnd, this);\n\t}\n\n\t_animateProxyZoom(e) {\n\t\tconst transform = this._proxy.style.transform;\n\n\t\tDomUtil.setTransform(\n\t\t\tthis._proxy,\n\t\t\tthis.project(e.center, e.zoom),\n\t\t\tthis.getZoomScale(e.zoom, 1),\n\t\t);\n\n\t\t// workaround for case when transform is the same and so transitionend event is not fired\n\t\tif (transform === this._proxy.style.transform && this._animatingZoom) {\n\t\t\tthis._onZoomTransitionEnd();\n\t\t}\n\t}\n\n\t_animMoveEnd() {\n\t\tconst c = this.getCenter();\n\t\tconst z = this.getZoom();\n\n\n\n\t\tDomUtil.setTransform(\n\t\t\tthis._proxy,\n\t\t\tthis.project(c, z),\n\t\t\tthis.getZoomScale(z, 1),\n\t\t);\n\t}\n\n\t_catchTransitionEnd(e) {\n\t\tif (this._animatingZoom && e.propertyName.includes('transform')) {\n\t\t\tthis._onZoomTransitionEnd();\n\t\t}\n\t}\n\n\t_nothingToAnimate() {\n\t\treturn !this._container.getElementsByClassName('maplair-zoom-animated').length;\n\t}\n\n\t// Zooms to `center` and `zoom` frame by frame around the zoom origin at `offset`\n\t// from the center (as the CSS zoom animation does), see the `continuousZoom` option.\n\t_continuousZoom(center, zoom, offset, options) {\n\t\tconst startZoom = this._zoom,\n\t\toriginOffset = offset.multiplyBy(-1),\n\t\torigin = this.containerPointToLatLng(this.getSize()._divideBy(2).add(offset)),\n\t\tstart = performance.now(),\n\t\tduration = 250;\n\n\t\tthis._moveStart(true, options.noMoveStart ?? false);\n\n\t\tconst frame = () => {\n\t\t\tconst t = Math.min(1, (performance.now() - start) / duration);\n\t\t\tif (t < 1) {\n\t\t\t\t// ease out, like the CSS zoom transition\n\t\t\t\tconst z = startZoom + (zoom - startZoom) * (1 - (1 - t) ** 2);\n\t\t\t\tthis._move(this.unproject(this.project(origin, z).add(originOffset), z), z, {continuous: true});\n\t\t\t\t// cancelled by `_stop()`\n\t\t\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\t\t} else {\n\t\t\t\tthis._move(center, zoom)._moveEnd(true);\n\t\t\t}\n\t\t};\n\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t}\n\n\t// an animated zoom drops zooms from input until it ends, so hold them as long after an instant zoom too,\n\t// or a trackpad swipe or a held key zooms several times as far\n\t_zoomInputBlocked() {\n\t\treturn this._animatingZoom || Date.now() < this._instantZoomEnd;\n\t}\n\n\t_tryAnimatedZoom(center, zoom, options) {\n\n\t\tif (this._animatingZoom) { return true; }\n\n\t\toptions ??= {};\n\n\t\t// don't animate if disabled, not supported or zoom difference is too large (over 1 with reduced motion,\n\t\t// unless animate: true is specified)\n\t\tconst threshold = this.options.zoomAnimationThreshold,\n\t\tmaxZoomDiff = this._prefersReducedMotion() && options.animate !== true ? Math.min(threshold, 1) : threshold;\n\t\tif (!this._zoomAnimated || options.animate === false ||\n\t\t (this._nothingToAnimate() && !this.options.continuousZoom) ||\n\t\t Math.abs(zoom - this._zoom) > maxZoomDiff) { return false; }\n\n\t\t// offset is the pixel coords of the zoom origin relative to the current center\n\t\tconst scale = this.getZoomScale(zoom),\n\t\toffset = this._getCenterOffset(center)._divideBy(1 - 1 / scale);\n\n\t\t// don't animate if the zoom origin isn't within one screen from the current center, unless forced\n\t\tif (options.animate !== true && !this.getSize().contains(offset)) { return false; }\n\n\t\tif (this.options.continuousZoom) {\n\t\t\tthis._continuousZoom(center, zoom, offset, options);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst userEvent = this._userEvent;\n\t\tthis._zoomAnimFrame = requestAnimationFrame(() => {\n\t\t\tthis._zoomAnimFrame = null;\n\t\t\tif (userEvent) {\n\t\t\t\tthis._setUserEvent(userEvent);\n\t\t\t}\n\t\t\tthis\n\t\t\t\t._moveStart(true, options.noMoveStart ?? false)\n\t\t\t\t._animateZoom(center, zoom, true);\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t_animateZoom(center, zoom, startAnim, noUpdate) {\n\t\tif (!this._mapPane) { return; }\n\n\t\tif (startAnim) {\n\t\t\tthis._animatingZoom = true;\n\n\t\t\t// remember what center/zoom to set after animation\n\t\t\tthis._animateToCenter = center;\n\t\t\tthis._animateToZoom = zoom;\n\n\t\t\tthis._mapPane.classList.add('maplair-zoom-anim');\n\t\t}\n\n\t\tthis.fire('zoomanim', {\n\t\t\tcenter,\n\t\t\tzoom,\n\t\t\tnoUpdate\n\t\t});\n\n\t\tif (!this._tempFireZoomEvent) {\n\t\t\tthis._tempFireZoomEvent = this._zoom !== this._animateToZoom;\n\t\t}\n\n\t\tthis._move(this._animateToCenter, this._animateToZoom, undefined, true);\n\n\t\t// Work around webkit not firing 'transitionend', see https://github.com/Leaflet/Leaflet/issues/3689, 2693\n\t\tthis._transitionEndTimer = setTimeout(this._onZoomTransitionEnd.bind(this), zoomAnimDuration);\n\t}\n\n\t_onZoomTransitionEnd() {\n\t\tif (!this._animatingZoom) { return; }\n\n\t\tthis._mapPane?.classList.remove('maplair-zoom-anim');\n\n\t\tthis._animatingZoom = false;\n\n\t\tthis._move(this._animateToCenter, this._animateToZoom, undefined, true);\n\n\t\tif (this._tempFireZoomEvent) {\n\t\t\tthis.fire('zoom');\n\t\t}\n\t\tdelete this._tempFireZoomEvent;\n\n\t\tthis.fire('move');\n\n\t\tthis._moveEnd(true);\n\t}\n}\n\n// The default features (layers, popups, tooltips, vector renderers, controls\n// and interaction handlers) come with every map: they are registered here\n// rather than by the entry module, so that they are included whenever\n// `MaplairMap` is, while bundlers can still drop other features (e.g. GeoJSON,\n// the layers and scale controls) when an application doesn't use them.\n//\n// Possible tree-shaking optimization: popups, tooltips and the vector renderers\n// (DivOverlay, Popup, Tooltip, RendererSupport; about 25 kB of a minimal map's\n// 100 kB minified) could become optional by registering themselves when their\n// module is imported (without importing this module, to avoid circular imports)\n// instead of here. But then `layer.bindPopup()`/`bindTooltip()` and the map's\n// popup/tooltip methods would only exist in production bundles of apps that\n// actually use the `Popup`/`Tooltip` classes (bundlers drop an unused\n// `import {Tooltip}`), while they would always work in development builds.\nfor (const feature of [\n\tAttributionControl,\n\tControl,\n\tDivOverlay,\n\tLayer,\n\tBoxZoomHandler,\n\tDoubleClickZoomHandler,\n\tDragHandler,\n\tKeyboardHandler,\n\tPinchZoomHandler,\n\tScrollWheelZoomHandler,\n\tTapHoldHandler,\n\tTapDragZoomHandler,\n\tPopup,\n\tTooltip,\n\tRendererSupport,\n\tZoomControl,\n\tFullscreenControl\n]) {\n\tfeature.register(MaplairMap);\n}\n\nexport {MaplairMap as Map};\nexport {MaplairMap as LeafletMap};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8OzB,IAAa,aAAb,MAAa,mBAAmB,QAAQ;CAEvC,OAAO,iBAAiB;EACvB,KAAK;EACL,QAAQ,KAAA;EACR,MAAM,KAAA;EACN,SAAS,KAAA;EACT,SAAS,KAAA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K,sBAAsB,WAAW,KAAK,qBAAqB,KAAK,IAAI,GAAG,gBAAgB;CAC7F;CAEA,uBAAuB;EACtB,IAAI,CAAC,KAAK,gBAAkB;EAE5B,KAAK,UAAU,UAAU,OAAO,mBAAmB;EAEnD,KAAK,iBAAiB;EAEtB,KAAK,MAAM,KAAK,kBAAkB,KAAK,gBAAgB,KAAA,GAAW,IAAI;EAEtE,IAAI,KAAK,oBACR,KAAK,KAAK,MAAM;EAEjB,OAAO,KAAK;EAEZ,KAAK,KAAK,MAAM;EAEhB,KAAK,SAAS,IAAI;CACnB;AACD;AAgBA,KAAK,MAAM,WAAW;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACAQ;CACA;CACA;AACD,GACC,QAAQ,SAAS,UAAU"}
1
+ {"version":3,"file":"Map.js","names":["Util.setOptions","DomUtil.create","DomEvent.getPointerPosition","DomUtil.getScale","DomUtil.get","Util.stamp","DomEvent.off","DomEvent.on","DomEvent.isExternalTarget","PointerEvents.isClickDisabled","DomUtil.getPosition","RendererSupport"],"sources":["../../../src/map/Map.js"],"sourcesContent":["import * as Util from '../core/Util.js';\nimport {Evented} from '../core/Events.js';\nimport {EPSG3857} from '../geo/crs/EPSG3857.js';\nimport {Point} from '../geometry/Point.js';\nimport {Bounds} from '../geometry/Bounds.js';\nimport {LatLng} from '../geo/LatLng.js';\nimport {LatLngBounds} from '../geo/LatLngBounds.js';\nimport * as DomEvent from '../dom/DomEvent.js';\nimport * as DomUtil from '../dom/DomUtil.js';\nimport {PosAnimation} from '../dom/PosAnimation.js';\nimport {I18n} from '../core/I18n.js';\nimport * as PointerEvents from '../dom/DomEvent.PointerEvents.js';\nimport {Control} from '../control/Control.js';\nimport {AttributionControl} from '../control/AttributionControl.js';\nimport {ZoomControl} from '../control/ZoomControl.js';\nimport {FullscreenControl} from '../control/FullscreenControl.js';\nimport {Layer} from '../layer/Layer.js';\nimport {DivOverlay} from '../layer/DivOverlay.js';\nimport {Popup} from '../layer/Popup.js';\nimport {Tooltip} from '../layer/Tooltip.js';\nimport * as RendererSupport from '../layer/vector/Renderer.getRenderer.js';\nimport {BoxZoomHandler} from './handler/BoxZoomHandler.js';\nimport {DoubleClickZoomHandler} from './handler/DoubleClickZoomHandler.js';\nimport {DragHandler} from './handler/DragHandler.js';\nimport {KeyboardHandler} from './handler/KeyboardHandler.js';\nimport {PinchZoomHandler} from './handler/PinchZoomHandler.js';\nimport {ScrollWheelZoomHandler} from './handler/ScrollWheelZoomHandler.js';\nimport {TapHoldHandler} from './handler/TapHoldHandler.js';\nimport {TapDragZoomHandler} from './handler/TapDragZoomHandler.js';\n\n/** @import {LatLngExpression} from '../geo/LatLng.js' */\n/** @import {LatLngBoundsExpression} from '../geo/LatLngBounds.js' */\n/** @import {PointExpression} from '../geometry/Point.js' */\n/** @import {CRS} from '../geo/crs/CRS.js' */\n/** @import {Handler} from '../core/Handler.js' */\n/** @import {Renderer} from '../layer/vector/Renderer.js' */\n/** @import {MaplairEvent, MaplairPointerEvent, MaplairKeyboardEvent, MaplairErrorEvent, LocationEvent, ResizeEvent, CrsChangeEvent, WorldCopyJumpEvent, ZoomAnimEvent} from '../core/Events.js' */\n\n// matches the zoom transition in maplair.css\nconst zoomAnimDuration = 250;\n\n/**\n * Options of `MaplairMap`.\n * @typedef {object} MaplairMapOptions\n * @property {CRS} [crs=EPSG3857] The [Coordinate Reference System](#crs) to use.\n * Don't change this if you're not sure what it means.\n * @property {LatLngExpression} [center] Initial geographic center of the map.\n * @property {number} [zoom] Initial map zoom level.\n * @property {number} [minZoom] Minimum zoom level of the map. If not specified and at\n * least one `GridLayer` or `TileLayer` is in the map, the lowest of their `minZoom`\n * options will be used instead.\n * @property {number} [maxZoom] Maximum zoom level of the map. If not specified and at\n * least one `GridLayer` or `TileLayer` is in the map, the highest of their `maxZoom`\n * options will be used instead.\n * @property {Layer[]} [layers=[]] Array of layers that will be added to the map initially.\n * @property {string} [ariaLabel] The accessible name of the map, announced by screen\n * readers, `'Map'` by default. The map container gets the ARIA role `region` with this\n * label, unless it already has a role or label. The default is translated, see `I18n`.\n * @property {LatLngBoundsExpression} [maxBounds] When this option is set, the map\n * restricts the view to the given geographical bounds, bouncing the user back if the\n * user tries to pan outside the view. To set the restriction dynamically, use\n * [`setMaxBounds`](#map-setmaxbounds) method.\n * @property {Renderer} [renderer] The default method for drawing vector layers on the\n * map. A new `SVG` renderer by default; pass `new Canvas()` to draw them on a canvas\n * instead. Paths in custom panes get their own renderer for that pane, of the same\n * class and with the same options as this one.\n * @property {boolean} [zoomAnimation=true] Whether the map zoom animation is enabled.\n * @property {number} [zoomAnimationThreshold=4] Won't animate zoom if the zoom\n * difference exceeds this value (or 1 if the user prefers\n * [reduced motion](https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/At-rules/@media/prefers-reduced-motion)\n * and `animate: true` isn't passed).\n * @property {boolean} [continuousZoom=false] Whether zoom animations (e.g. of the zoom\n * control, double click and keyboard) change the view frame by frame through fractional\n * zoom levels, like `flyTo()` and pinch zoom, instead of scaling the map with a CSS\n * transition between two zoom levels. Also makes the scroll wheel zoom smoothly with\n * each wheel event (see `scrollWheelZoom`), snapping to `zoomSnap` when scrolling ends.\n * @property {boolean} [fadeAnimation=true] Whether the tile and popup fade animation is\n * enabled.\n * @property {boolean} [markerZoomAnimation=true] Whether markers animate their zoom\n * with the zoom animation, if disabled they will disappear for the length of the\n * animation.\n * @property {boolean} [markerCulling=false] Whether markers far outside of the map view\n * (more than half a view away) are taken off the page until the map is moved closer to\n * them. This reduces the browser's rendering work, and the work of repositioning\n * markers while zooming, when a map has many markers (e.g. several thousands) of which\n * only some are visible at a time.\n * @property {number} [transform3DLimit=8388608] Defines the maximum size of a CSS\n * translation transform (2^23). The default value should not be changed unless a web\n * browser positions layers in the wrong place after doing a large `panBy`.\n * @property {number} [zoomSnap=1] Forces the map's zoom level to always be a multiple\n * of this, particularly right after a [`fitBounds()`](#map-fitbounds) or a pinch-zoom.\n * By default, the zoom level snaps to the nearest integer; lower values (e.g. `0.5` or\n * `0.1`) allow for greater granularity. A value of `0` means the zoom level will not be\n * snapped after `fitBounds` or a pinch-zoom.\n * @property {number} [zoomDelta=1] Controls how much the map's zoom level will change\n * after a [`zoomIn()`](#map-zoomin), [`zoomOut()`](#map-zoomout), pressing `+` or `-`\n * on the keyboard, or using the [zoom controls](#control-zoom). Values smaller than `1`\n * (e.g. `0.5`) allow for greater granularity.\n * @property {boolean} [trackResize=true] Whether the map automatically handles browser\n * window resize to update itself. A hidden map (with the size 0, e.g. `display: none`\n * in an inactive tab) keeps its size, view and bounds until it is shown again.\n */\n\n/**\n * Options of the geolocation methods of `MaplairMap`, e.g. `locate()`.\n * @typedef {object} LocateOptions\n * @property {boolean} [watch=false] If `true`, starts continuous watching of location\n * changes (instead of detecting it once) using W3C `watchPosition` method. You can\n * later stop watching using `map.stopLocate()` method.\n * @property {boolean} [setView=false] If `true`, automatically sets the map view to the\n * user location with respect to detection accuracy, or to world view if geolocation\n * failed.\n * @property {number} [maxZoom=Infinity] The maximum zoom for automatic view setting\n * when using `setView` option.\n * @property {number} [timeout=10000] Number of milliseconds to wait for a response from\n * geolocation before firing a `locationerror` event.\n * @property {number} [maximumAge=0] Maximum age of detected location. If less than this\n * amount of milliseconds passed since last geolocation response, `locate` will return\n * a cached location.\n * @property {boolean} [enableHighAccuracy=false] Enables high accuracy, see\n * [description in the W3C spec](https://w3c.github.io/geolocation-api/#enablehighaccuracy-member).\n */\n\n/**\n * Options of the `MaplairMap` methods which modify the zoom level.\n * @typedef {object} ZoomOptions\n * @property {boolean} [animate] If not specified, zoom animation will happen if the\n * zoom origin is inside the current view, and if the user prefers reduced motion, only\n * when zooming by at most one level. If `true`, the map will attempt animating zoom\n * disregarding where zoom origin is and the user's reduced motion preference. Setting\n * `false` will make it always reset the view completely without animation.\n */\n\n/**\n * Options of the `MaplairMap` methods which modify the center of the map.\n * @typedef {object} PanOptions\n * @property {boolean} [animate] If `true`, panning will always be animated if possible,\n * even if the user prefers reduced motion. If `false`, it will not animate panning,\n * either resetting the map view if panning more than a screen away, or just setting a\n * new offset for the map pane (except for `panBy` which always does the latter). If not\n * specified, panning is animated, except for pans longer than half the map size when\n * the user prefers reduced motion.\n * @property {number} [duration=0.25] Duration of animated panning, in seconds.\n * @property {number} [easeLinearity=0.25] The curvature factor of panning animation\n * easing (third parameter of the [Cubic Bezier curve](https://cubic-bezier.com/)).\n * 1.0 means linear animation, and the smaller this number, the more bowed the curve.\n * @property {boolean} [noMoveStart=false] If `true`, panning won't fire `movestart`\n * event on start (used internally for panning inertia).\n */\n\n/**\n * Options of the `MaplairMap` methods which modify the zoom level and the center.\n * @typedef {object} ZoomPanOptions\n * @property {boolean} [animate] Whether to animate the change: like `ZoomOptions.animate`\n * if the zoom level changes, and like `PanOptions.animate` otherwise. The `zoom` and\n * `pan` options can set it for each case separately.\n * @property {boolean} [reset] If `true`, the view is reset without animation.\n * @property {ZoomOptions} [zoom] Options for the zoom part of the change, taking\n * precedence over `animate`.\n * @property {PanOptions} [pan] Options for the pan part of the change, taking\n * precedence over `animate`.\n * @extends ZoomOptions, PanOptions\n */\n\n/**\n * Options of `MaplairMap.invalidateSize()`.\n * @typedef {object} InvalidateSizeOptions\n * @property {boolean} [animate=false] If `true`, the map pans to its new center with\n * animation.\n * @property {boolean} [pan=true] If `false`, panning will not occur.\n * @property {boolean} [debounceMoveend=false] If `true`, it will delay `moveend` event\n * so that it doesn't happen often even if the method is called many times in a row.\n * @extends PanOptions\n */\n\n/**\n * Padding options of `MaplairMap` methods, e.g. `panInside()`.\n * @typedef {object} PaddingOptions\n * @property {PointExpression} [paddingTopLeft=[0, 0]] Sets the amount of padding in the\n * top left corner of a map container that shouldn't be accounted for when setting the\n * view to fit bounds. Useful if you have some control overlays on the map like a\n * sidebar and you don't want them to obscure objects you're zooming to.\n * @property {PointExpression} [paddingBottomRight=[0, 0]] The same for the bottom right\n * corner of the map.\n * @property {PointExpression} [padding=[0, 0]] Equivalent of setting both top left and\n * bottom right padding to the same value.\n */\n\n/**\n * Options of `MaplairMap.fitBounds()` and similar methods.\n * @typedef {object} FitBoundsOptions\n * @property {number|null} [maxZoom=null] The maximum possible zoom to use.\n * @extends ZoomPanOptions, PaddingOptions\n */\n\n/**\n * The central class of the API — it is used to create a map on a page and manipulate it.\n *\n * <h3 id=\"map-pane\">Panes</h3>\n *\n * Panes are DOM elements used to control the ordering of layers on the map. You can\n * access panes with [`map.getPane`](#map-getpane) or [`map.getPanes`](#map-getpanes)\n * methods. New panes can be created with the [`map.createPane`](#map-createpane) method.\n *\n * Every map has the following default panes that differ only in zIndex.\n *\n * | Pane | zIndex | Description |\n * |---|---|---|\n * | `mapPane` | `'auto'` | Pane that contains all other map panes |\n * | `tilePane` | 200 | Pane for `GridLayer`s and `TileLayer`s |\n * | `overlayPane` | 400 | Pane for vectors (`Path`s, like `Polyline`s and `Polygon`s), `ImageOverlay`s and `VideoOverlay`s |\n * | `shadowPane` | 500 | Pane for overlay shadows (e.g. `Marker` shadows) |\n * | `markerPane` | 600 | Pane for `Icon`s of `Marker`s |\n * | `tooltipPane` | 650 | Pane for `Tooltip`s |\n * | `popupPane` | 700 | Pane for `Popup`s |\n *\n * **Map state change events**\n *\n * The map state change events `movestart`, `move`, `moveend`, `zoomstart`, `zoom`,\n * `zoomend` and `zoomanim` caused by the user (e.g. dragging, scrolling, pinching,\n * pressing a key or clicking a zoom button) have an `originalEvent` property with the\n * DOM event that started the change. It is `undefined` for changes made by code (e.g.\n * `setView()`), which allows to tell them apart, e.g. to avoid feedback loops when\n * synchronizing the view. The `move` and `zoom` events also have `flyTo: true` on each\n * [`flyTo`](#map-flyto) animation frame, and `pinch: true` while the user pinch-zooms\n * the map.\n *\n * @example\n * ```js\n * // initialize the map on the \"map\" div with a given center and zoom\n * const map = new MaplairMap('map', {\n * \tcenter: [51.505, -0.09],\n * \tzoom: 13\n * });\n * ```\n *\n * @fires resize {ResizeEvent} Fired when the map is resized.\n * @fires unload {MaplairEvent} Fired when the map is destroyed with [remove](#map-remove) method.\n * @fires viewprereset {MaplairEvent} Fired before the map resets its view (see `viewreset`).\n * @fires viewreset {MaplairEvent} Fired when the map needs to redraw its content (this\n * usually happens on map zoom or load). Very useful for creating custom overlays.\n * @fires load {MaplairEvent} Fired when the map is initialized (when its center and zoom\n * are set for the first time).\n * @fires zoomstart {MaplairEvent} Fired when the map zoom is about to change (e.g. before\n * zoom animation).\n * @fires movestart {MaplairEvent} Fired when the view of the map starts changing (e.g.\n * user starts dragging the map).\n * @fires zoom {MaplairEvent} Fired repeatedly during any change in zoom level, including\n * zoom and fly animations.\n * @fires move {MaplairEvent} Fired repeatedly during any movement of the map, including\n * pan and fly animations.\n * @fires zoomend {MaplairEvent} Fired when the map zoom changed, after any animations.\n * @fires moveend {MaplairEvent} Fired when the center of the map stops changing (e.g.\n * user stopped dragging the map or after non-centered zoom).\n * @fires idle {MaplairEvent} Fired when the map becomes idle: the view is not changing\n * (no dragging, panning or zooming, including their animations) and all layers have\n * finished loading (e.g. the tiles of tile layers, see `GridLayer.isLoading()`). Useful\n * e.g. for taking screenshots or for tests.\n * @fires locationerror {MaplairErrorEvent} Fired when geolocation (using the\n * [`locate`](#map-locate) method) failed.\n * @fires locationfound {LocationEvent} Fired when geolocation (using the\n * [`locate`](#map-locate) method) went successfully.\n * @fires click {MaplairPointerEvent} Fired when the user clicks (or taps) the map.\n * @fires dblclick {MaplairPointerEvent} Fired when the user double-clicks (or\n * double-taps) the map.\n * @fires pointerdown {MaplairPointerEvent} Fired when the user pushes the pointer on the map.\n * @fires pointerup {MaplairPointerEvent} Fired when the user releases the pointer on the map.\n * @fires pointerover {MaplairPointerEvent} Fired when the pointer enters the map.\n * @fires pointerout {MaplairPointerEvent} Fired when the pointer leaves the map.\n * @fires pointermove {MaplairPointerEvent} Fired while the pointer moves over the map.\n * @fires contextmenu {MaplairPointerEvent} Fired when the user pushes the right mouse\n * button on the map, prevents default browser context menu from showing if there are\n * listeners on this event. Also fired on mobile when the user holds a single touch for\n * a second (also called long press).\n * @fires preclick {MaplairPointerEvent} Fired before pointer click on the map (sometimes\n * useful when you want something to happen on click before any existing click handlers\n * start running).\n * @fires keydown {MaplairKeyboardEvent} Fired when the user presses a key from the\n * keyboard while the map is focused.\n * @fires keyup {MaplairKeyboardEvent} Fired when the user releases a key from the\n * keyboard while the map is focused.\n * @fires crschange {CrsChangeEvent} Fired when the CRS of the map changes with\n * `setCrs()`, before the view is reset.\n * @fires worldcopyjump {WorldCopyJumpEvent} Fired when [`worldCopyJump`](#maplairmapoptions-worldcopyjump)\n * moves the map pane by one or more world widths.\n * @fires pixelratiochange {MaplairEvent} Fired when the `devicePixelRatio` of the browser\n * changes, e.g. when moving the window to a screen with another resolution or when\n * zooming the page. Tile layers with `detectRetina` and canvas renderers adapt to it.\n * @fires zoomanim {ZoomAnimEvent} Fired at least once per zoom animation. For continuous\n * zoom, like pinch zooming, fired once per frame during zoom.\n */\nexport class MaplairMap extends Evented {\n\n\tstatic defaultOptions = {\n\t\tcrs: EPSG3857,\n\t\tcenter: undefined,\n\t\tzoom: undefined,\n\t\tminZoom: undefined,\n\t\tmaxZoom: undefined,\n\t\tlayers: [],\n\t\tariaLabel: undefined,\n\t\tmaxBounds: undefined,\n\t\trenderer: undefined,\n\n\t\tzoomAnimation: true,\n\t\tzoomAnimationThreshold: 4,\n\t\tcontinuousZoom: false,\n\t\tfadeAnimation: true,\n\t\tmarkerZoomAnimation: true,\n\t\tmarkerCulling: false,\n\t\ttransform3DLimit: 8388608, // Precision limit of a 32-bit float\n\n\t\tzoomSnap: 1,\n\t\tzoomDelta: 1,\n\t\ttrackResize: true\n\t};\n\n\t/**\n\t * Instantiates a map object given the DOM ID of a `<div>` element or the element\n\t * itself, and optionally an object literal with `MaplairMap` options.\n\t * @param {string|HTMLElement} id The `<div>` element or its DOM ID.\n\t * @param {MaplairMapOptions} [options]\n\t */\n\tconstructor(id, options) {\n\t\tsuper();\n\t\toptions = Util.setOptions(this, options);\n\n\t\t// Make sure to assign internal flags at the beginning,\n\t\t// to avoid inconsistent state in some edge cases.\n\t\tthis._handlers = [];\n\t\tthis._layers = {};\n\t\tthis._zoomBoundLayers = {};\n\t\t// canvas renderers on the map, topmost first\n\t\tthis._canvases = [];\n\t\tthis._sizeChanged = true;\n\n\t\tthis._initContainer(id);\n\t\tthis._initLayout();\n\n\t\tthis._initEvents();\n\n\t\tthis._watchPixelRatio();\n\n\t\tthis.on({\n\t\t\tmovestart: this._onBusy,\n\t\t\tzoomstart: this._onBusy,\n\t\t\tmove: this._onMove,\n\t\t\tmoveend: this._onViewChanged,\n\t\t\tlayerremove: this._scheduleIdleCheck\n\t\t}, this);\n\n\t\tif (options.maxBounds) {\n\t\t\tthis.setMaxBounds(options.maxBounds);\n\t\t}\n\n\t\tif (options.zoom !== undefined) {\n\t\t\tthis._zoom = this._limitZoom(options.zoom);\n\t\t}\n\n\t\tif (options.center && options.zoom !== undefined) {\n\t\t\tthis.setView(LatLng.from(options.center), options.zoom, {reset: true});\n\t\t}\n\n\t\tthis.callInitHooks(MaplairMap);\n\n\t\tthis._zoomAnimated = this.options.zoomAnimation;\n\n\t\t// zoom transitions run with the same duration for all layers, so if one of transitionend events\n\t\t// happens after starting zoom animation (propagating to the map pane), we know that it ended globally\n\t\tif (this._zoomAnimated) {\n\t\t\tthis._createAnimProxy();\n\t\t}\n\n\t\tthis._addLayers(this.options.layers);\n\t}\n\n\t/**\n\t * Sets the view of the map (geographical center and zoom) with the given\n\t * animation options.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} center\n\t * @param {number} [zoom]\n\t * @param {ZoomPanOptions} [options]\n\t * @returns {this}\n\t */\n\tsetView(center, zoom, options) {\n\n\t\tzoom = zoom === undefined ? this._targetZoom() : this._limitZoom(zoom);\n\t\tconst targetCenter = center;\n\t\tcenter = this._limitCenter(new LatLng(center), zoom, this.options.maxBounds);\n\t\toptions ??= {};\n\n\t\tthis._stop();\n\n\t\t// cleared by the moveend that completes this view, so set it before anything can fire one\n\t\tthis._targetView = {center: targetCenter, zoom};\n\n\t\t// the end of a running zoom animation would override the new view, so apply it afterwards\n\t\tif (this._animatingZoom) {\n\t\t\tthis._pendingView = {center, zoom, options};\n\t\t\treturn this;\n\t\t}\n\n\t\tif (this._loaded && !options.reset && options !== true) {\n\n\t\t\tif (options.animate !== undefined) {\n\t\t\t\toptions.zoom = {animate: options.animate, ...options.zoom};\n\t\t\t\toptions.pan = {animate: options.animate, duration: options.duration, ...options.pan};\n\t\t\t}\n\n\t\t\t// try animating pan or zoom\n\t\t\tconst moved = (this._zoom !== zoom) ?\n\t\t\t\tthis._tryAnimatedZoom?.(center, zoom, options.zoom) :\n\t\t\t\tthis._tryAnimatedPan(center, options.pan);\n\n\t\t\tif (moved) {\n\t\t\t\t// prevent resize handler call, the view will refresh after animation anyway\n\t\t\t\tclearTimeout(this._sizeTimer);\n\t\t\t\treturn this;\n\t\t\t}\n\t\t}\n\n\t\t// animation didn't start, just reset the map view\n\t\tthis._resetView(this.options.worldCopyJump ? this.wrapLatLng(center) : center, zoom, options.pan?.noMoveStart);\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the zoom of the map.\n\t * @group Methods for modifying map state\n\t * @param {number} zoom\n\t * @param {ZoomPanOptions} [options]\n\t * @returns {this}\n\t */\n\tsetZoom(zoom, options) {\n\t\tif (!this._loaded) {\n\t\t\tthis._zoom = zoom;\n\t\t\treturn this;\n\t\t}\n\t\t// zoom around where a running animation is heading, so that setView(c) then setZoom(z) ends at c\n\t\treturn this.setView(this._targetView?.center ?? this.getCenter(), zoom, {zoom: options});\n\t}\n\n\t/**\n\t * Increases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\n\t * @group Methods for modifying map state\n\t * @param {number} [delta]\n\t * @param {ZoomOptions} [options]\n\t * @returns {this}\n\t */\n\tzoomIn(delta, options) {\n\t\tdelta ??= this.options.zoomDelta;\n\t\treturn this.setZoom(this._targetZoom() + delta, options);\n\t}\n\n\t/**\n\t * Decreases the zoom of the map by `delta` ([`zoomDelta`](#map-zoomdelta) by default).\n\t * @group Methods for modifying map state\n\t * @param {number} [delta]\n\t * @param {ZoomOptions} [options]\n\t * @returns {this}\n\t */\n\tzoomOut(delta, options) {\n\t\tdelta ??= this.options.zoomDelta;\n\t\treturn this.setZoom(this._targetZoom() - delta, options);\n\t}\n\n\t/**\n\t * Zooms the map while keeping a specified geographical point on the map\n\t * stationary (e.g. used internally for scroll zoom and double-click zoom). Given a\n\t * `Point`, it keeps the specified pixel on the map (relative to the top-left corner)\n\t * stationary instead.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression|Point} latlng The geographical point or the pixel offset.\n\t * @param {number} zoom\n\t * @param {ZoomOptions} [options]\n\t * @returns {this}\n\t */\n\tsetZoomAround(latlng, zoom, options) {\n\t\t// work in unrounded projected coordinates so that zooming back and forth around the same point\n\t\t// doesn't accumulate pixel rounding errors (amplified by the zoom scale) and drift the view;\n\t\t// a pixel offset goes through layer points, which account for a rotation of the map\n\t\tconst center = this.project(this.getCenter()),\n\t\toffset = latlng instanceof Point ?\n\t\t\tthis.containerPointToLayerPoint(latlng).subtract(this.containerPointToLayerPoint(this.getSize().divideBy(2))) :\n\t\t\tthis.project(latlng).subtract(center),\n\t\tnewCenter = this.unproject(center.add(offset.multiplyBy(1 - 1 / this.getZoomScale(zoom))));\n\n\t\treturn this.setView(newCenter, zoom, {zoom: options});\n\t}\n\n\t_getBoundsCenterZoom(bounds, options) {\n\n\t\toptions ??= {};\n\t\tbounds = bounds.getBounds ? bounds.getBounds() : LatLngBounds.from(bounds);\n\n\t\tconst paddingTL = Point.from(options.paddingTopLeft || options.padding || [0, 0]),\n\t\tpaddingBR = Point.from(options.paddingBottomRight || options.padding || [0, 0]);\n\n\t\tlet zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\n\n\t\tzoom = Math.min(options.maxZoom ?? Infinity, zoom);\n\n\t\tif (zoom === Infinity) {\n\t\t\treturn {\n\t\t\t\tcenter: bounds.getCenter(),\n\t\t\t\tzoom\n\t\t\t};\n\t\t}\n\n\t\tconst paddingOffset = paddingBR.subtract(paddingTL).divideBy(2),\n\n\t\tswPoint = this.project(bounds.getSouthWest(), zoom),\n\t\tnePoint = this.project(bounds.getNorthEast(), zoom),\n\t\tcenter = this.unproject(swPoint.add(nePoint).divideBy(2).add(paddingOffset), zoom);\n\n\t\treturn {\n\t\t\tcenter,\n\t\t\tzoom\n\t\t};\n\t}\n\n\t/**\n\t * Sets a map view that contains the given geographical bounds with the\n\t * maximum zoom level possible.\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {FitBoundsOptions} [options]\n\t * @returns {this}\n\t */\n\tfitBounds(bounds, options) {\n\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\tif (!bounds.isValid()) {\n\t\t\tthrow new Error('Bounds are not valid.');\n\t\t}\n\n\t\tconst target = this._getBoundsCenterZoom(bounds, options);\n\t\treturn this.setView(target.center, target.zoom, options);\n\t}\n\n\t/**\n\t * Sets a map view that mostly contains the whole world with the maximum\n\t * zoom level possible.\n\t * @group Methods for modifying map state\n\t * @param {FitBoundsOptions} [options]\n\t * @returns {this}\n\t */\n\tfitWorld(options) {\n\t\treturn this.fitBounds([[-90, -180], [90, 180]], options);\n\t}\n\n\t/**\n\t * Pans the map to a given center.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} center\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanTo(center, options) {\n\t\treturn this.setView(center, undefined, {pan: options});\n\t}\n\t/**\n\t * Pans the map by a given number of pixels (animated unless `animate: false` is passed,\n\t * or the user prefers reduced motion and the pan is longer than half the map size\n\t * without `animate: true`).\n\t * @group Methods for modifying map state\n\t * @param {PointExpression} offset\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanBy(offset, options) {\n\t\t// pan from where a running animation is heading, so that panTo(c) then panBy(o) ends at c + o\n\t\tconst {center = this.getCenter(), zoom = this._zoom} = this._targetView ?? {},\n\t\tnewCenter = this.unproject(this.project(center, zoom).add(Point.from(offset).round()), zoom);\n\n\t\treturn this.setView(newCenter, zoom, {pan: options});\n\t}\n\n\t// Pans the map pane by `offset` pixels, see `_tryAnimatedPan()`.\n\t_panBy(offset, options) {\n\t\toptions ??= {};\n\n\t\tif (!offset.x && !offset.y) {\n\t\t\treturn this._moveStart(false, true)._moveEnd(false);\n\t\t}\n\n\t\tif (!this._panAnim) {\n\t\t\tthis._panAnim = new PosAnimation().on({\n\t\t\t\tstep: this._onPanTransitionStep,\n\t\t\t\tend: this._onPanTransitionEnd\n\t\t\t}, this);\n\t\t}\n\n\t\t// don't fire movestart if animating inertia\n\t\tif (!options.noMoveStart) {\n\t\t\tthis.fire('movestart');\n\t\t}\n\n\t\t// with reduced motion, only short pans are animated unless animate: true is specified\n\t\tconst tooFarForReducedMotion = this._prefersReducedMotion() && !this.getSize().divideBy(2).contains(offset);\n\t\tif (options.animate === true || (options.animate !== false && !tooFarForReducedMotion)) {\n\t\t\tthis._mapPane.classList.add('maplair-pan-anim');\n\n\t\t\tconst newPos = this._getMapPanePos().subtract(offset).round();\n\t\t\tthis._panAnim.run(this._mapPane, newPos, options.duration || 0.25, options.easeLinearity);\n\t\t} else {\n\t\t\tthis._rawPanBy(offset);\n\t\t\tthis._wrapWorldCopy();\n\t\t\tthis.fire('move')._moveEnd(false);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the view of the map (geographical center and zoom) performing a smooth\n\t * pan-zoom animation. If the user prefers reduced motion (and `animate: true` isn't\n\t * passed), it behaves like `setView` instead, only animating short pans and zooms.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} targetCenter\n\t * @param {number} [targetZoom]\n\t * @param {ZoomPanOptions} [options]\n\t * @returns {this}\n\t */\n\tflyTo(targetCenter, targetZoom, options) {\n\n\t\toptions ??= {};\n\t\tif (options.animate === false) {\n\t\t\treturn this.setView(targetCenter, targetZoom, {...options, zoom: {...options.zoom, animate: false}});\n\t\t}\n\t\tif (options.animate !== true && this._prefersReducedMotion()) {\n\t\t\treturn this.setView(targetCenter, targetZoom, options);\n\t\t}\n\n\t\ttargetZoom = targetZoom === undefined ? this._targetZoom() : this._limitZoom(targetZoom);\n\t\tconst requestedCenter = targetCenter;\n\t\ttargetCenter = this._limitCenter(new LatLng(targetCenter), targetZoom, this.options.maxBounds);\n\n\t\tthis._stop();\n\t\tthis._targetView = {center: requestedCenter, zoom: targetZoom};\n\n\t\t// layers round their positions against the pixel origin, and while zoom changes, projected coordinates move\n\t\t// fast in absolute terms even when the view barely moves on screen, so rounding the origin too would make\n\t\t// everything jitter by up to a pixel against the motion; the last frame rounds it again\n\t\tthis._subpixelOrigin = true;\n\n\t\tconst from = this.project(this.getCenter()),\n\t\tto = this.project(targetCenter),\n\t\tsize = this.getSize(),\n\t\tstartZoom = this._zoom;\n\n\t\tconst w0 = Math.max(size.x, size.y),\n\t\tw1 = w0 * this.getZoomScale(startZoom, targetZoom),\n\t\tu1 = (to.distanceTo(from)) || 1,\n\t\trho = 1.42,\n\t\trho2 = rho * rho;\n\n\t\tfunction r(i) {\n\t\t\tconst s1 = i ? -1 : 1,\n\t\t\ts2 = i ? w1 : w0,\n\t\t\tt1 = w1 * w1 - w0 * w0 + s1 * rho2 * rho2 * u1 * u1,\n\t\t\tb1 = 2 * s2 * rho2 * u1;\n\n\t\t\treturn -Math.asinh(t1 / b1);\n\t\t}\n\n\t\tconst r0 = r(0);\n\n\t\tfunction u(s) { return w0 * (Math.cosh(r0) * Math.tanh(r0 + rho * s) - Math.sinh(r0)) / rho2; }\n\n\t\tfunction easeOut(t) { return 1 - (1 - t) ** 1.5; }\n\n\t\tconst start = Date.now(),\n\t\tS = (r(1) - r0) / rho,\n\t\tduration = 1000 * (options.duration || S * 0.8);\n\n\t\tconst frame = () => {\n\t\t\tconst t = (Date.now() - start) / duration,\n\t\t\ts = easeOut(t) * S;\n\n\t\t\tif (t <= 1) {\n\t\t\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\n\t\t\t\tthis._move(\n\t\t\t\t\tthis.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom),\n\t\t\t\t\tthis.getScaleZoom(Math.cosh(r0 + rho * s) / Math.cosh(r0), startZoom),\n\t\t\t\t\t{flyTo: true});\n\n\t\t\t} else {\n\t\t\t\t// the last step shifts the pixel origin even at the same zoom, and layers like GridLayer only\n\t\t\t\t// re-anchor on 'zoom' (#9438)\n\t\t\t\tconst zoomChanged = this._zoom !== targetZoom;\n\t\t\t\tthis._subpixelOrigin = false;\n\t\t\t\tthis._move(targetCenter, targetZoom);\n\t\t\t\tif (!zoomChanged) { this.fire('zoom'); }\n\t\t\t\tthis._moveEnd(true);\n\t\t\t}\n\t\t};\n\n\t\tthis._moveStart(true, options.noMoveStart);\n\n\t\tframe(this);\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\n\t * but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {FitBoundsOptions} [options]\n\t * @returns {this}\n\t */\n\tflyToBounds(bounds, options) {\n\t\tconst target = this._getBoundsCenterZoom(bounds, options);\n\t\treturn this.flyTo(target.center, target.zoom, options);\n\t}\n\n\t/**\n\t * Changes the [Coordinate Reference System](#crs) of the map, keeping its center\n\t * and (as far as possible with the zoom levels and `zoomSnap`) its scale at the\n\t * center. All layers are redrawn in the new CRS; note that tile layers only work\n\t * with the CRS their tiles were made for.\n\t * @group Methods for modifying map state\n\t * @param {CRS} crs\n\t * @returns {this}\n\t */\n\tsetCrs(crs) {\n\t\tconst oldCrs = this.options.crs;\n\t\tif (crs === oldCrs) { return this; }\n\n\t\tif (!this._loaded) {\n\t\t\tthis.options.crs = crs;\n\t\t\tthis.fire('crschange', {oldCrs, crs});\n\t\t\treturn this;\n\t\t}\n\n\t\tthis._stop();\n\t\tconst center = this.getCenter(),\n\t\tresolution = this._getResolution(center);\n\n\t\tthis.options.crs = crs;\n\n\t\t// the zoom with the same distance per pixel at the center\n\t\tconst zoom = this._limitZoom(crs.zoom(crs.scale(this._zoom) * this._getResolution(center) / resolution));\n\n\t\tthis.fire('crschange', {oldCrs, crs});\n\n\t\tthis._resetView(center, zoom);\n\t\treturn this;\n\t}\n\n\t// The distance per pixel at `latlng` at the current zoom, in the units of the CRS.\n\t_getResolution(latlng) {\n\t\tconst crs = this.options.crs,\n\t\tpoint = crs.latLngToPoint(latlng, this._zoom);\n\t\treturn crs.distance(latlng, crs.pointToLatLng(point.add([1, 0]), this._zoom));\n\t}\n\n\t/**\n\t * Restricts the map view to the given bounds (see the [maxBounds](#map-maxbounds) option).\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {this}\n\t */\n\tsetMaxBounds(bounds) {\n\t\tbounds = new LatLngBounds(bounds);\n\n\t\tif (this.listens('moveend', this._panInsideMaxBounds)) {\n\t\t\tthis.off('moveend', this._panInsideMaxBounds);\n\t\t}\n\n\t\tif (!bounds.isValid()) {\n\t\t\tthis.options.maxBounds = null;\n\t\t\treturn this;\n\t\t}\n\n\t\tthis.options.maxBounds = bounds;\n\n\t\tif (this._loaded) {\n\t\t\tthis._panInsideMaxBounds();\n\t\t}\n\n\t\treturn this.on('moveend', this._panInsideMaxBounds);\n\t}\n\n\t/**\n\t * Sets the lower limit for the available zoom levels (see the [minZoom](#map-minzoom) option).\n\t * @group Methods for modifying map state\n\t * @param {number} zoom\n\t * @returns {this}\n\t */\n\tsetMinZoom(zoom) {\n\t\tconst oldZoom = this.options.minZoom;\n\t\tthis.options.minZoom = zoom;\n\n\t\tif (this._loaded && oldZoom !== zoom) {\n\t\t\tthis.fire('zoomlevelschange');\n\n\t\t\tif (this._targetZoom() < this.options.minZoom) {\n\t\t\t\treturn this.setZoom(zoom);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Sets the upper limit for the available zoom levels (see the [maxZoom](#map-maxzoom) option).\n\t * @group Methods for modifying map state\n\t * @param {number} zoom\n\t * @returns {this}\n\t */\n\tsetMaxZoom(zoom) {\n\t\tconst oldZoom = this.options.maxZoom;\n\t\tthis.options.maxZoom = zoom;\n\n\t\tif (this._loaded && oldZoom !== zoom) {\n\t\t\tthis.fire('zoomlevelschange');\n\n\t\t\tif (this._targetZoom() > this.options.maxZoom) {\n\t\t\t\treturn this.setZoom(zoom);\n\t\t\t}\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Pans the map to the closest view that would lie inside the given bounds (if\n\t * it's not already), controlling the animation using the options specific, if any.\n\t * @group Methods for modifying map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanInsideBounds(bounds, options) {\n\t\tthis._enforcingBounds = true;\n\t\tconst center = this.getCenter(),\n\t\tnewCenter = this._limitCenter(center, this._zoom, LatLngBounds.from(bounds));\n\n\t\tif (!center.equals(newCenter)) {\n\t\t\tthis.panTo(newCenter, options);\n\t\t}\n\n\t\tthis._enforcingBounds = false;\n\t\treturn this;\n\t}\n\n\t/**\n\t * Pans the map the minimum amount to make the `latlng` visible. Use\n\t * padding options to fit the display to more restricted bounds.\n\t * If `latlng` is already within the (optionally padded) display bounds,\n\t * the map will not be panned.\n\t * @group Methods for modifying map state\n\t * @param {LatLngExpression} latlng\n\t * @param {PaddingOptions & PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanInside(latlng, options) {\n\t\toptions ??= {};\n\n\t\tconst paddingTL = Point.from(options.paddingTopLeft || options.padding || [0, 0]),\n\t\tpaddingBR = Point.from(options.paddingBottomRight || options.padding || [0, 0]),\n\t\tpixelCenter = this.project(this.getCenter()),\n\t\tpixelPoint = this.project(latlng),\n\t\tpixelBounds = this.getPixelBounds(),\n\t\tpaddedBounds = new Bounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]),\n\t\tpaddedSize = paddedBounds.getSize();\n\n\t\tif (!paddedBounds.contains(pixelPoint)) {\n\t\t\tthis._enforcingBounds = true;\n\t\t\tconst centerOffset = pixelPoint.subtract(paddedBounds.getCenter());\n\t\t\tconst offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);\n\t\t\tpixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x;\n\t\t\tpixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y;\n\t\t\tthis.panTo(this.unproject(pixelCenter), options);\n\t\t\tthis._enforcingBounds = false;\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Checks if the map container size changed and updates the map if so —\n\t * call it after you've changed the map size dynamically, also panning to\n\t * keep the center by default. If `options.pan` is `false`, panning will not occur.\n\t * If `options.debounceMoveend` is `true`, it will delay `moveend` event so\n\t * that it doesn't happen often even if the method is called many\n\t * times in a row. Passing `true` instead of options animates the panning.\n\t * @group Methods for modifying map state\n\t * @param {InvalidateSizeOptions|boolean} [options]\n\t * @returns {this}\n\t */\n\tinvalidateSize(options) {\n\t\tif (!this._loaded) { return this; }\n\n\t\toptions = {\n\t\t\tanimate: false,\n\t\t\tpan: true,\n\t\t\t...(options === true ? {animate: true} : options)\n\t\t};\n\n\t\tconst oldSize = this.getSize();\n\t\tthis._sizeChanged = true;\n\n\t\tconst newSize = this.getSize();\n\n\t\t// keep the exact center for a no-op call (e.g. the initial resize observer callback), since recomputing\n\t\t// it from the pane snaps it to whole pixels\n\t\tif (!newSize.equals(oldSize)) { this._lastCenter = null; }\n\n\t\tconst oldCenter = oldSize.divideBy(2).round(),\n\t\tnewCenter = newSize.divideBy(2).round(),\n\t\toffset = oldCenter.subtract(newCenter);\n\n\t\tif (!offset.x && !offset.y) { return this; }\n\n\t\tif (options.animate && options.pan) {\n\t\t\tthis.panBy(offset);\n\n\t\t} else {\n\t\t\tif (options.pan) {\n\t\t\t\tthis._rawPanBy(offset);\n\t\t\t}\n\n\t\t\tthis.fire('move');\n\n\t\t\tif (options.debounceMoveend) {\n\t\t\t\tclearTimeout(this._sizeTimer);\n\t\t\t\tthis._sizeTimer = setTimeout(this.fire.bind(this, 'moveend'), 200);\n\t\t\t} else {\n\t\t\t\tthis.fire('moveend');\n\t\t\t}\n\t\t}\n\n\t\treturn this.fire('resize', {\n\t\t\toldSize,\n\t\t\tnewSize\n\t\t});\n\t}\n\n\t/**\n\t * Stops the currently running `panTo` or `flyTo` animation, if any.\n\t * @group Methods for modifying map state\n\t * @returns {this}\n\t */\n\tstop() {\n\t\tthis.setZoom(this._limitZoom(this._zoom));\n\t\tif (!this.options.zoomSnap) {\n\t\t\tthis.fire('viewreset');\n\t\t}\n\t\treturn this._stop();\n\t}\n\n\t/**\n\t * Tries to locate the user using the Geolocation API, firing a\n\t * [`locationfound`](#map-locationfound) event with location data on success or a\n\t * [`locationerror`](#map-locationerror) event on failure, and optionally sets the map\n\t * view to the user's location with respect to detection accuracy (or to the world view\n\t * if geolocation failed).\n\t * Note that, if your page doesn't use HTTPS, this method will fail in\n\t * modern browsers ([Chrome 50 and newer](https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins))\n\t * See `LocateOptions` for more details.\n\t * @group Geolocation methods\n\t * @param {LocateOptions} [options]\n\t * @returns {this}\n\t */\n\tlocate(options) {\n\n\t\toptions = this._locateOptions = {\n\t\t\ttimeout: 10000,\n\t\t\twatch: false,\n\t\t\t// setView: false\n\t\t\t// maxZoom: <Number>\n\t\t\t// maximumAge: 0\n\t\t\t// enableHighAccuracy: false\n\t\t\t...options\n\t\t};\n\n\t\tif (!('geolocation' in navigator)) {\n\t\t\tthis._handleGeolocationError({\n\t\t\t\tcode: 0,\n\t\t\t\tmessage: 'Geolocation not supported.'\n\t\t\t});\n\t\t\treturn this;\n\t\t}\n\n\t\tconst onResponse = this._handleGeolocationResponse.bind(this),\n\t\tonError = this._handleGeolocationError.bind(this);\n\n\t\tif (options.watch) {\n\t\t\tif (this._locationWatchId !== undefined) {\n\t\t\t\tnavigator.geolocation.clearWatch(this._locationWatchId);\n\t\t\t}\n\t\t\tthis._locationWatchId = navigator.geolocation.watchPosition(onResponse, onError, options);\n\t\t} else {\n\t\t\tnavigator.geolocation.getCurrentPosition(onResponse, onError, options);\n\t\t}\n\t\treturn this;\n\t}\n\n\t/**\n\t * Stops watching location previously initiated by `map.locate({watch: true})`\n\t * and aborts resetting the map view if map.locate was called with\n\t * `{setView: true}`.\n\t * @group Geolocation methods\n\t * @returns {this}\n\t */\n\tstopLocate() {\n\t\tnavigator.geolocation?.clearWatch?.(this._locationWatchId);\n\t\tif (this._locateOptions) {\n\t\t\tthis._locateOptions.setView = false;\n\t\t}\n\t\treturn this;\n\t}\n\n\t_handleGeolocationError(error) {\n\t\tif (!this._container._maplair_id) { return; }\n\n\t\tconst c = error.code,\n\t\tmessage = error.message ||\n\t\t (c === 1 ? 'permission denied' :\n\t\t (c === 2 ? 'position unavailable' : 'timeout'));\n\n\t\tif (this._locateOptions.setView && !this._loaded) {\n\t\t\tthis.fitWorld();\n\t\t}\n\n\t\tthis.fire('locationerror', {\n\t\t\tcode: c,\n\t\t\tmessage: `Geolocation error: ${message}.`\n\t\t});\n\t}\n\n\t_handleGeolocationResponse(pos) {\n\t\tif (!this._container._maplair_id) { return; }\n\n\t\tconst latlng = new LatLng(pos.coords.latitude, pos.coords.longitude),\n\t\tbounds = latlng.toBounds(pos.coords.accuracy * 2),\n\t\toptions = this._locateOptions;\n\n\t\tif (options.setView) {\n\t\t\tconst zoom = this.getBoundsZoom(bounds);\n\t\t\tthis.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\n\t\t}\n\n\t\tconst data = {\n\t\t\tlatlng,\n\t\t\tbounds,\n\t\t\ttimestamp: pos.timestamp\n\t\t};\n\n\t\tfor (const i in pos.coords) { // do not use Object.keys here to access getters of GeolocationCoordinates\n\t\t\tif (typeof pos.coords[i] === 'number') {\n\t\t\t\tdata[i] = pos.coords[i];\n\t\t\t}\n\t\t}\n\n\t\tthis.fire('locationfound', data);\n\t}\n\n\t/**\n\t * Adds a new `Handler` to the map, given its name and constructor function.\n\t * @group Other methods\n\t * @param {string} name\n\t * @param {new (map: MaplairMap) => Handler} HandlerClass\n\t * @returns {this}\n\t */\n\taddHandler(name, HandlerClass) {\n\t\tif (!HandlerClass) { return this; }\n\n\t\tconst handler = this[name] = new HandlerClass(this);\n\n\t\tthis._handlers.push(handler);\n\n\t\tif (this.options[name]) {\n\t\t\thandler.enable();\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Destroys the map and clears all related event listeners.\n\t * @group Other methods\n\t * @returns {this}\n\t */\n\tremove() {\n\n\t\tthis._initEvents(true);\n\t\tthis.off('moveend', this._panInsideMaxBounds);\n\n\t\tif (this._containerId !== this._container._maplair_id) {\n\t\t\tthrow new Error('Map container is being reused by another instance');\n\t\t}\n\n\t\tdelete this._container._maplair_id;\n\t\tdelete this._containerId;\n\n\t\tif (this._locationWatchId !== undefined) {\n\t\t\tthis.stopLocate();\n\t\t}\n\n\t\tthis._stop();\n\n\t\tPointerEvents.disablePointerDetection(this._container);\n\t\tthis._mapPane.remove();\n\t\tfor (const name of this._ariaAttributes) {\n\t\t\tthis._container.removeAttribute(name);\n\t\t}\n\n\t\tif (this._clearControlPos) {\n\t\t\tthis._clearControlPos();\n\t\t}\n\t\tcancelAnimationFrame(this._resizeRequest);\n\t\tcancelAnimationFrame(this._idleRequest);\n\t\tthis._watchPixelRatio(true);\n\n\t\tfor (const handler of this._handlers) {\n\t\t\thandler.disable();\n\t\t}\n\n\t\tclearTimeout(this._transitionEndTimer);\n\t\tclearTimeout(this._sizeTimer);\n\n\t\tif (this._loaded) {\n\t\t\tthis.fire('unload');\n\t\t}\n\n\t\tfor (const layer of Object.values(this._layers)) {\n\t\t\tlayer.remove();\n\t\t}\n\t\tfor (const pane of Object.values(this._panes)) {\n\t\t\tpane.remove();\n\t\t}\n\n\n\t\tthis._layers = {};\n\t\tthis._panes = {};\n\t\tdelete this._mapPane;\n\t\tdelete this._renderer;\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Creates a new [map pane](#map-pane) with the given name if it doesn't exist already,\n\t * then returns it. The pane is created as a child of `container`, or\n\t * as a child of the main map pane if not set.\n\t * @group Other methods\n\t * @param {string} name\n\t * @param {HTMLElement} [container]\n\t * @returns {HTMLElement}\n\t */\n\tcreatePane(name, container) {\n\t\tconst className = `maplair-pane${name ? ` maplair-${name.replace('Pane', '')}-pane` : ''}`,\n\t\tpane = DomUtil.create('div', className, container || this._mapPane);\n\n\t\tif (name) {\n\t\t\tthis._panes[name] = pane;\n\t\t}\n\t\treturn pane;\n\t}\n\n\t/**\n\t * Returns the geographical center of the map view.\n\t * @group Methods for getting map state\n\t * @returns {LatLng}\n\t */\n\tgetCenter() {\n\t\tthis._checkIfLoaded();\n\n\t\tif (this._lastCenter && this._getMapPanePos().equals(this._lastCenterPanePos)) {\n\t\t\treturn new LatLng(this._lastCenter);\n\t\t}\n\t\treturn this.layerPointToLatLng(this._getCenterLayerPoint());\n\t}\n\n\t/**\n\t * Returns the current zoom level of the map view.\n\t * @group Methods for getting map state\n\t * @returns {number}\n\t */\n\tgetZoom() {\n\t\treturn this._zoom;\n\t}\n\n\t/**\n\t * Returns the geographical bounds visible in the current map view.\n\t * @group Methods for getting map state\n\t * @returns {LatLngBounds}\n\t */\n\tgetBounds() {\n\t\tconst bounds = this.getPixelBounds(),\n\t\tsw = this.unproject(bounds.getBottomLeft()),\n\t\tne = this.unproject(bounds.getTopRight());\n\n\t\treturn new LatLngBounds(sw, ne);\n\t}\n\n\t/**\n\t * Returns the minimum zoom level of the map (if set in the `minZoom` option of the\n\t * map or of any layers), or `0` by default.\n\t * @group Methods for getting map state\n\t * @returns {number}\n\t */\n\tgetMinZoom() {\n\t\treturn this.options.minZoom ?? this._layersMinZoom ?? 0;\n\t}\n\n\t/**\n\t * Returns the maximum zoom level of the map (if set in the `maxZoom` option of the\n\t * map or of any layers).\n\t * @group Methods for getting map state\n\t * @returns {number}\n\t */\n\tgetMaxZoom() {\n\t\treturn this.options.maxZoom ?? this._layersMaxZoom ?? Infinity;\n\t}\n\n\t/**\n\t * Returns the maximum zoom level on which the given bounds fit to the map\n\t * view in its entirety. If `inside` (optional) is set to `true`, the method\n\t * instead returns the minimum zoom level on which the map view fits into\n\t * the given bounds in its entirety.\n\t * @group Methods for getting map state\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {boolean} [inside]\n\t * @param {PointExpression} [padding]\n\t * @returns {number}\n\t */\n\tgetBoundsZoom(bounds, inside, padding) {\n\t\tbounds = LatLngBounds.from(bounds);\n\t\tpadding = Point.from(padding ?? [0, 0]);\n\n\t\tlet zoom = this.getZoom() ?? 0;\n\t\tconst min = this.getMinZoom(),\n\t\tmax = this.getMaxZoom(),\n\t\tsize = this.getSize().subtract(padding),\n\t\t// any corner can be an extreme when the projection rotates the axes\n\t\tcorners = [bounds.getNorthWest(), bounds.getNorthEast(), bounds.getSouthEast(), bounds.getSouthWest()],\n\t\tboundsSize = new Bounds(corners.map(c => this.project(c, zoom))).getSize(),\n\t\tsnap = this.options.zoomSnap,\n\t\t// padding larger than the map leaves no room: zoom out, not in\n\t\tscalex = Math.max(size.x, 0) / boundsSize.x,\n\t\tscaley = Math.max(size.y, 0) / boundsSize.y,\n\t\tscale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\n\n\t\tzoom = this.getScaleZoom(scale, zoom);\n\n\t\tif (snap) {\n\t\t\tzoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\n\t\t\tzoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\n\t\t}\n\n\t\treturn Math.max(min, Math.min(max, zoom));\n\t}\n\n\t/**\n\t * Returns the current size of the map container (in pixels).\n\t * @group Methods for getting map state\n\t * @returns {Point}\n\t */\n\tgetSize() {\n\t\tif (!this._size || this._sizeChanged) {\n\t\t\tthis._size = new Point(\n\t\t\t\tthis._container.clientWidth || 0,\n\t\t\t\tthis._container.clientHeight || 0);\n\n\t\t\tthis._sizeChanged = false;\n\t\t}\n\t\treturn new Point(this._size);\n\t}\n\n\t/**\n\t * Returns the bounds of the current map view in projected pixel\n\t * coordinates (sometimes useful in layer and overlay implementations).\n\t * If `center` and `zoom` is omitted, the map's current zoom level and center is used.\n\t * @group Methods for getting map state\n\t * @param {LatLngExpression} [center]\n\t * @param {number} [zoom]\n\t * @returns {Bounds}\n\t */\n\tgetPixelBounds(center, zoom) {\n\t\tconst topLeftPoint = this._getTopLeftPoint(center, zoom);\n\t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\n\t}\n\n\t// TODO: Check semantics - isn't the pixel origin the 0,0 coord relative to\n\t// the map pane? \"left point of the map layer\" can be confusing, specially\n\t// since there can be negative offsets.\n\t/**\n\t * Returns the projected pixel coordinates of the top left point of\n\t * the map layer (useful in custom layer and overlay implementations).\n\t * @group Methods for getting map state\n\t * @returns {Point}\n\t */\n\tgetPixelOrigin() {\n\t\tthis._checkIfLoaded();\n\t\treturn this._pixelOrigin;\n\t}\n\n\t/**\n\t * Returns the world's bounds in pixel coordinates for zoom level `zoom`.\n\t * If `zoom` is omitted, the map's current zoom level is used.\n\t * @group Methods for getting map state\n\t * @param {number} [zoom]\n\t * @returns {Bounds|null} `null` for CRSs with infinite bounds.\n\t */\n\tgetPixelWorldBounds(zoom) {\n\t\treturn this.options.crs.getProjectedBounds(zoom ?? this.getZoom());\n\t}\n\n\t/**\n\t * Returns a [map pane](#map-pane), given its name or its HTML element (its identity).\n\t * @group Other methods\n\t * @param {string|HTMLElement} pane\n\t * @returns {HTMLElement}\n\t */\n\tgetPane(pane) {\n\t\treturn typeof pane === 'string' ? this._panes[pane] : pane;\n\t}\n\n\t/**\n\t * Returns a plain object containing the names of all [panes](#map-pane) as keys and\n\t * the panes as values.\n\t * @group Other methods\n\t * @returns {Record<string, HTMLElement>}\n\t */\n\tgetPanes() {\n\t\treturn this._panes;\n\t}\n\n\t/**\n\t * Returns the HTML element that contains the map.\n\t * @group Other methods\n\t * @returns {HTMLElement}\n\t */\n\tgetContainer() {\n\t\treturn this._container;\n\t}\n\n\n\t/**\n\t * Returns the scale factor to be applied to a map transition from zoom level\n\t * `fromZoom` to `toZoom`. Used internally to help with zoom animations.\n\t * @group Conversion methods\n\t * @param {number} toZoom\n\t * @param {number} [fromZoom]\n\t * @returns {number}\n\t */\n\tgetZoomScale(toZoom, fromZoom) {\n\t\t// TODO replace with universal implementation after refactoring projections\n\t\tconst crs = this.options.crs;\n\t\tfromZoom ??= this._zoom;\n\t\treturn crs.scale(toZoom) / crs.scale(fromZoom);\n\t}\n\n\t/**\n\t * Returns the zoom level that the map would end up at, if it is at `fromZoom`\n\t * level and everything is scaled by a factor of `scale`. Inverse of\n\t * [`getZoomScale`](#map-getZoomScale).\n\t * @group Conversion methods\n\t * @param {number} scale\n\t * @param {number} [fromZoom]\n\t * @returns {number}\n\t */\n\tgetScaleZoom(scale, fromZoom) {\n\t\tconst crs = this.options.crs;\n\t\tfromZoom ??= this._zoom;\n\t\tconst zoom = crs.zoom(scale * crs.scale(fromZoom));\n\t\treturn isNaN(zoom) ? Infinity : zoom;\n\t}\n\n\t/**\n\t * Projects a geographical coordinate `LatLng` according to the projection\n\t * of the map's CRS, then scales it according to `zoom` and the CRS's\n\t * `Transformation`. The result is pixel coordinate relative to\n\t * the CRS origin.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @param {number} [zoom]\n\t * @returns {Point}\n\t */\n\tproject(latlng, zoom) {\n\t\tzoom ??= this._zoom;\n\t\treturn this.options.crs.latLngToPoint(LatLng.from(latlng), zoom);\n\t}\n\n\t/**\n\t * Inverse of [`project`](#map-project).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @param {number} [zoom]\n\t * @returns {LatLng}\n\t */\n\tunproject(point, zoom) {\n\t\tzoom ??= this._zoom;\n\t\treturn this.options.crs.pointToLatLng(Point.from(point), zoom);\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\n\t * returns the corresponding geographical coordinate (for the current zoom level).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {LatLng}\n\t */\n\tlayerPointToLatLng(point) {\n\t\tconst projectedPoint = Point.from(point).add(this.getPixelOrigin());\n\t\treturn this.unproject(projectedPoint);\n\t}\n\n\t/**\n\t * Given a geographical coordinate, returns the corresponding pixel coordinate\n\t * relative to the [origin pixel](#map-getpixelorigin).\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @returns {Point}\n\t */\n\tlatLngToLayerPoint(latlng) {\n\t\treturn this.project(LatLng.from(latlng))._subtract(this.getPixelOrigin());\n\t}\n\n\t/**\n\t * Returns a `LatLng` where `lat` and `lng` has been wrapped according to the\n\t * map's CRS's `wrapLat` and `wrapLng` properties, if they are outside the\n\t * CRS's bounds.\n\t * By default this means longitude is wrapped around the dateline so its\n\t * value is between -180 and +180 degrees.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @returns {LatLng}\n\t */\n\twrapLatLng(latlng) {\n\t\treturn this.options.crs.wrapLatLng(LatLng.from(latlng));\n\t}\n\n\t/**\n\t * Returns a `LatLngBounds` with the same size as the given one, ensuring that\n\t * its center is within the CRS's bounds.\n\t * By default this means the center longitude is wrapped around the dateline so its\n\t * value is between -180 and +180 degrees, and the majority of the bounds\n\t * overlaps the CRS's bounds.\n\t * @group Conversion methods\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {LatLngBounds}\n\t */\n\twrapLatLngBounds(bounds) {\n\t\treturn this.options.crs.wrapLatLngBounds(new LatLngBounds(bounds));\n\t}\n\n\t/**\n\t * Returns the distance between two geographical coordinates according to\n\t * the map's CRS. By default this measures distance in meters.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng1\n\t * @param {LatLngExpression} latlng2\n\t * @returns {number}\n\t */\n\tdistance(latlng1, latlng2) {\n\t\treturn this.options.crs.distance(LatLng.from(latlng1), LatLng.from(latlng2));\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the map container, returns the corresponding\n\t * pixel coordinate relative to the [origin pixel](#map-getpixelorigin).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tcontainerPointToLayerPoint(point) {\n\t\treturn Point.from(point).subtract(this._getMapPanePos());\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\n\t * returns the corresponding pixel coordinate relative to the map container.\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tlayerPointToContainerPoint(point) {\n\t\treturn Point.from(point).add(this._getMapPanePos());\n\t}\n\n\t/**\n\t * Given a pixel coordinate relative to the map container, returns\n\t * the corresponding geographical coordinate (for the current zoom level).\n\t * @group Conversion methods\n\t * @param {PointExpression} point\n\t * @returns {LatLng}\n\t */\n\tcontainerPointToLatLng(point) {\n\t\tconst layerPoint = this.containerPointToLayerPoint(Point.from(point));\n\t\treturn this.layerPointToLatLng(layerPoint);\n\t}\n\n\t/**\n\t * Given a geographical coordinate, returns the corresponding pixel coordinate\n\t * relative to the map container.\n\t * @group Conversion methods\n\t * @param {LatLngExpression} latlng\n\t * @returns {Point}\n\t */\n\tlatLngToContainerPoint(latlng) {\n\t\treturn this.layerPointToContainerPoint(this.latLngToLayerPoint(LatLng.from(latlng)));\n\t}\n\n\t/**\n\t * Given a PointerEvent object, returns the pixel coordinate relative to the\n\t * map container where the event took place.\n\t * @group Conversion methods\n\t * @param {MouseEvent|PointerEvent} e\n\t * @returns {Point}\n\t */\n\tpointerEventToContainerPoint(e) {\n\t\tif (!this._animatingZoom) { return DomEvent.getPointerPosition(e, this._container); }\n\n\t\t// reading the container's layout recalcs styles, which a zoom animation keeps changing for every animated\n\t\t// element; the container doesn't move during one, so read it once per animation\n\t\tif (!this._containerRect) {\n\t\t\tconst el = this._container, {x, y, boundingClientRect: r} = DomUtil.getScale(el);\n\t\t\tthis._containerRect = {x, y, left: r.left + el.clientLeft * x, top: r.top + el.clientTop * y};\n\t\t}\n\t\tconst c = this._containerRect;\n\t\treturn new Point((e.clientX - c.left) / c.x, (e.clientY - c.top) / c.y);\n\t}\n\n\t/**\n\t * Given a PointerEvent object, returns the pixel coordinate relative to\n\t * the [origin pixel](#map-getpixelorigin) where the event took place.\n\t * @group Conversion methods\n\t * @param {MouseEvent|PointerEvent} e\n\t * @returns {Point}\n\t */\n\tpointerEventToLayerPoint(e) {\n\t\treturn this.containerPointToLayerPoint(this.pointerEventToContainerPoint(e));\n\t}\n\n\t/**\n\t * Given a PointerEvent object, returns geographical coordinate where the\n\t * event took place.\n\t * @group Conversion methods\n\t * @param {MouseEvent|PointerEvent} e\n\t * @returns {LatLng}\n\t */\n\tpointerEventToLatLng(e) {\n\t\treturn this.layerPointToLatLng(this.pointerEventToLayerPoint(e));\n\t}\n\n\n\t// map initialization methods\n\n\t_initContainer(id) {\n\t\tconst container = this._container = DomUtil.get(id);\n\n\t\tif (!container) {\n\t\t\tthrow new Error('Map container not found.');\n\t\t} else if (container._maplair_id) {\n\t\t\tthrow new Error('Map container is already initialized.');\n\t\t}\n\n\t\tPointerEvents.enablePointerDetection(container);\n\t\tDomEvent.on(container, 'scroll', this._onScroll, this);\n\t\tthis._containerId = Util.stamp(container);\n\n\t}\n\n\t_initLayout() {\n\t\tconst container = this._container;\n\n\t\tthis._fadeAnimated = this.options.fadeAnimation;\n\n\t\t// maplair-touch and maplair-retina have no rules in maplair.css, but custom stylesheets may still target them\n\t\tconst classes = ['maplair-container', 'maplair-touch'];\n\n\t\tif (window.devicePixelRatio > 1) { classes.push('maplair-retina'); }\n\t\tif (this._fadeAnimated) { classes.push('maplair-fade-anim'); }\n\n\t\tcontainer.classList.add(...classes);\n\n\t\t// an accessible name for the map, e.g. for the landmarks of screen readers\n\t\tthis._ariaAttributes = [];\n\t\tif (!container.hasAttribute('role')) {\n\t\t\tcontainer.setAttribute('role', 'region');\n\t\t\tthis._ariaAttributes.push('role');\n\t\t}\n\t\tif (!container.hasAttribute('aria-label') && !container.hasAttribute('aria-labelledby')) {\n\t\t\tcontainer.setAttribute('aria-label', this.options.ariaLabel ?? I18n.translate('Map'));\n\t\t\tthis._ariaAttributes.push('aria-label');\n\t\t}\n\n\t\tconst {position} = getComputedStyle(container);\n\n\t\tif (position !== 'absolute' && position !== 'relative' && position !== 'fixed' && position !== 'sticky') {\n\t\t\tcontainer.style.position = 'relative';\n\t\t}\n\n\t\tthis._initPanes();\n\n\t\tif (this._initControlPos) {\n\t\t\tthis._initControlPos();\n\t\t}\n\t}\n\n\t_initPanes() {\n\t\tconst panes = this._panes = {};\n\t\tthis._paneRenderers = {};\n\n\t\t// the default panes, see the class description\n\t\tthis._mapPane = this.createPane('mapPane', this._container);\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\n\n\t\tthis.createPane('tilePane');\n\t\tthis.createPane('overlayPane');\n\t\tthis.createPane('shadowPane');\n\t\tthis.createPane('markerPane');\n\t\tthis.createPane('tooltipPane');\n\t\tthis.createPane('popupPane');\n\n\t\tif (!this.options.markerZoomAnimation) {\n\t\t\tpanes.markerPane.classList.add('maplair-zoom-hide');\n\t\t\tpanes.shadowPane.classList.add('maplair-zoom-hide');\n\t\t}\n\t}\n\n\n\t// private methods that modify map state\n\n\t_resetView(center, zoom, noMoveStart) {\n\t\tconst loading = !this._loaded;\n\t\tthis._loaded = true;\n\t\tzoom = this._limitZoom(zoom);\n\n\t\t// before the pane reset, so that listeners still see the current view\n\t\tthis.fire('viewprereset', {center, zoom});\n\n\t\tDomUtil.setPosition(this._mapPane, new Point(0, 0));\n\n\t\tconst zoomChanged = this._zoom !== zoom;\n\t\tif (zoomChanged && !loading) {\n\t\t\tthis._instantZoomEnd = Date.now() + zoomAnimDuration;\n\t\t}\n\t\tthis\n\t\t\t._moveStart(zoomChanged, noMoveStart)\n\t\t\t._move(center, zoom)\n\t\t\t._moveEnd(zoomChanged);\n\n\t\tthis.fire('viewreset');\n\n\t\tif (loading) {\n\t\t\tthis.fire('load');\n\t\t}\n\t}\n\n\t/**\n\t * Fires an event of the specified type, see `Evented.fire()`. The map state change\n\t * events caused by the user get an `originalEvent` property (see the class\n\t * description).\n\t * @param {string} type\n\t * @param {object} [data]\n\t * @param {boolean} [propagate]\n\t * @returns {this}\n\t */\n\tfire(type, data, propagate) {\n\t\tif (this._userEvent && MaplairMap._viewEvents.has(type)) {\n\t\t\tdata = {originalEvent: this._userEvent, ...data};\n\t\t\tif (type === 'moveend') {\n\t\t\t\tthis._userEvent = null;\n\t\t\t} else {\n\t\t\t\tthis._userMoving = true;\n\t\t\t}\n\t\t}\n\t\treturn super.fire(type, data, propagate);\n\t}\n\n\tstatic _viewEvents = new Set(['movestart', 'move', 'moveend', 'zoomstart', 'zoom', 'zoomend', 'zoomanim']);\n\n\t_watchPixelRatio(remove) {\n\t\tthis._pixelRatioQuery?.removeEventListener('change', this._onPixelRatioChange);\n\t\tif (remove || typeof window === 'undefined' || !window.matchMedia) { return; }\n\n\t\tthis._onPixelRatioChange ??= () => {\n\t\t\tthis._watchPixelRatio();\n\t\t\tthis.fire('pixelratiochange');\n\t\t};\n\t\t// matches until the ratio changes, then a new query is needed\n\t\tthis._pixelRatioQuery = window.matchMedia(`(resolution: ${window.devicePixelRatio}dppx)`);\n\t\tthis._pixelRatioQuery.addEventListener('change', this._onPixelRatioChange);\n\t}\n\n\t_onBusy() {\n\t\tthis._viewChanging = true;\n\t\tthis._idle = false;\n\t}\n\n\t// resets the bounds of the `markerCulling` option, computed once per view by `Marker._updateCulling()`\n\t_onMove() {\n\t\tthis._cullingBounds = null;\n\t}\n\n\t_onViewChanged() {\n\t\tthis._viewChanging = false;\n\t\tthis._scheduleIdleCheck();\n\t}\n\n\t// Called by layers when they start loading, see `GridLayer`.\n\t_onLayerLoading() {\n\t\tthis._idle = false;\n\t}\n\n\t// Called by layers when they finished loading, see `GridLayer`.\n\t_scheduleIdleCheck() {\n\t\tcancelAnimationFrame(this._idleRequest);\n\t\t// After the current task, so that layers can start loading on the same `moveend`\n\t\tthis._idleRequest = requestAnimationFrame(() => this._checkIdle());\n\t}\n\n\t_checkIdle() {\n\t\tif (this._idle || !this._loaded || this._viewChanging || this._animatingZoom) { return; }\n\t\tfor (const layer of Object.values(this._layers)) {\n\t\t\tif (layer.isLoading?.()) { return; }\n\t\t}\n\t\tthis._idle = true;\n\t\tthis.fire('idle');\n\t}\n\n\t// Marks the following view change (until `moveend`) as caused by the DOM event `e`\n\t// of the user, see the map state change events. If no view change starts right\n\t// away, the mark is dropped.\n\t_setUserEvent(e) {\n\t\tthis._userEvent = e;\n\t\tthis._userMoving = false;\n\t\tqueueMicrotask(() => {\n\t\t\tif (this._userEvent === e && !this._userMoving) {\n\t\t\t\tthis._userEvent = null;\n\t\t\t}\n\t\t});\n\t}\n\n\t_moveStart(zoomChanged, noMoveStart) {\n\t\tif (zoomChanged) {\n\t\t\tthis.fire('zoomstart');\n\t\t}\n\t\tif (!noMoveStart) {\n\t\t\tthis.fire('movestart');\n\t\t}\n\t\treturn this;\n\t}\n\n\t_move(center, zoom, data, suppressEvent) {\n\t\tif (zoom === undefined) {\n\t\t\tzoom = this._zoom;\n\t\t}\n\t\tconst zoomChanged = this._zoom !== zoom;\n\n\t\tthis._zoom = zoom;\n\t\tthis._lastCenter = center;\n\t\tthis._lastCenterPanePos = this._getMapPanePos();\n\t\tthis._pixelOrigin = this._getNewPixelOrigin(center);\n\n\t\tif (!suppressEvent) {\n\t\t\t// always fire 'zoom' if pinching (#3530) or flying, where layers must follow the subpixel origin\n\t\t\tif (zoomChanged || data?.pinch || data?.flyTo) {\n\t\t\t\tthis.fire('zoom', data);\n\t\t\t}\n\n\t\t\tthis.fire('move', data);\n\t\t} else if (data?.pinch) {\t// Always fire 'zoom' if pinching because #3530\n\t\t\tthis.fire('zoom', data);\n\t\t}\n\t\treturn this;\n\t}\n\n\t_moveEnd(zoomChanged) {\n\t\t// a zoom animation ending with a queued view isn't where the map is heading yet\n\t\tif (!this._pendingView) { this._targetView = null; }\n\n\t\tif (zoomChanged) {\n\t\t\tthis.fire('zoomend');\n\t\t}\n\n\t\treturn this.fire('moveend');\n\t}\n\n\t_stop() {\n\t\tthis._pendingView = null;\n\t\tthis._targetView = null;\n\t\tcancelAnimationFrame(this._flyToFrame);\n\t\tcancelAnimationFrame(this._zoomAnimFrame);\n\t\tif (this._subpixelOrigin) {\n\t\t\t// an interrupted flight would leave layers between pixels, so snap them where it stopped\n\t\t\tthis._subpixelOrigin = false;\n\t\t\tthis._move(this._lastCenter, this._zoom, {flyTo: true});\n\t\t}\n\t\tthis._panAnim?.stop();\n\t\treturn this;\n\t}\n\n\t_rawPanBy(offset) {\n\t\tDomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(offset));\n\t}\n\n\t// Shifts a map pane position by whole world widths to bring the view center back into the original world, moving\n\t// the pane and firing `worldcopyjump` if that makes it jump from where it is now.\n\t_wrapWorldCopy(pos = this._getMapPanePos()) {\n\t\t// an infinite CRS has no world to wrap around, and no pixel world bounds either\n\t\tif (!this._loaded || !this.options.worldCopyJump || this.options.crs.infinite) { return pos; }\n\n\t\tconst width = this.getPixelWorldBounds().getSize().x,\n\t\tx = pos.x - width * Math.round((pos.x + this.latLngToLayerPoint([0, 0]).x - this.getSize().x / 2) / width),\n\t\tworlds = Math.round((x - this._getMapPanePos().x) / width);\n\n\t\tpos = new Point(x, pos.y);\n\n\t\tif (worlds) {\n\t\t\tDomUtil.setPosition(this._mapPane, pos);\n\t\t\tthis.fire('worldcopyjump', {worlds});\n\t\t}\n\t\treturn pos;\n\t}\n\n\t_getZoomSpan() {\n\t\treturn this.getMaxZoom() - this.getMinZoom();\n\t}\n\n\t_panInsideMaxBounds() {\n\t\tif (!this._enforcingBounds) {\n\t\t\tthis.panInsideBounds(this.options.maxBounds);\n\t\t}\n\t}\n\n\t_checkIfLoaded() {\n\t\tif (!this._loaded) {\n\t\t\tthrow new Error('Set map center and zoom first.');\n\t\t}\n\t}\n\n\t// DOM event handling\n\n\t_initEvents(remove) {\n\t\tthis._targets = {};\n\t\tthis._targets[Util.stamp(this._container)] = this;\n\n\t\tconst onOff = remove ? DomEvent.off : DomEvent.on;\n\n\t\tonOff(this._container, 'click dblclick pointerdown pointerup ' +\n\t\t\t'pointerover pointerout pointermove contextmenu keydown keyup', this._handleDOMEvent, this);\n\n\t\tif (this.options.trackResize) {\n\t\t\tif (!remove) {\n\t\t\t\tif (!this._resizeObserver) {\n\t\t\t\t\tthis._resizeObserver = new ResizeObserver(this._onResize.bind(this));\n\t\t\t\t}\n\t\t\t\tthis._resizeObserver.observe(this._container);\n\t\t\t} else {\n\t\t\t\tthis._resizeObserver.disconnect();\n\t\t\t}\n\t\t}\n\n\t\tif (this.options.transform3DLimit) {\n\t\t\t(remove ? this.off : this.on).call(this, 'moveend', this._onMoveEnd);\n\t\t}\n\t}\n\n\t_onResize() {\n\t\tcancelAnimationFrame(this._resizeRequest);\n\t\tthis._resizeRequest = requestAnimationFrame(() => {\n\t\t\t// a hidden map keeps the view of its last visible state\n\t\t\tif (this._container.clientWidth || this._container.clientHeight) {\n\t\t\t\tthis.invalidateSize({debounceMoveend: true});\n\t\t\t}\n\t\t});\n\t}\n\n\t_onScroll() {\n\t\tthis._container.scrollTop = 0;\n\t\tthis._container.scrollLeft = 0;\n\t}\n\n\t_onMoveEnd() {\n\t\tconst pos = this._getMapPanePos();\n\t\tif (Math.max(Math.abs(pos.x), Math.abs(pos.y)) >= this.options.transform3DLimit) {\n\t\t\t// https://bugzilla.mozilla.org/show_bug.cgi?id=1203873 but Webkit also have\n\t\t\t// a pixel offset on very high values, see: https://jsfiddle.net/dg6r5hhb/\n\t\t\tthis._resetView(this.getCenter(), this.getZoom());\n\t\t}\n\t}\n\n\t_findEventTargets(e, type) {\n\t\tlet targets = [],\n\t\ttarget,\n\t\tsrc = e.target,\n\t\tdragging = false;\n\t\tconst isHover = type === 'pointerout' || type === 'pointerover';\n\t\t// clicks with `detail` 0 come from `element.click()` or the keyboard, so they can't end a drag\n\t\tconst canEndDrag = (type === 'click' || type === 'preclick') && e.detail > 0;\n\n\t\twhile (src) {\n\t\t\ttarget = this._targets[Util.stamp(src)];\n\t\t\tif (target && canEndDrag && this._draggableMoved(target)) {\n\t\t\t\t// Prevent firing click after you just dragged an object.\n\t\t\t\tdragging = true;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (target?.listens(type, true)) {\n\t\t\t\tif (isHover && !DomEvent.isExternalTarget(src, e)) { break; }\n\t\t\t\ttargets.push(target);\n\t\t\t\tif (isHover) { break; }\n\t\t\t}\n\t\t\tif (src === this._container) { break; }\n\t\t\tsrc = src.parentNode;\n\t\t}\n\t\tif (!targets.length && !dragging && !isHover && this.listens(type, true)) {\n\t\t\ttargets = [this];\n\t\t}\n\t\treturn targets;\n\t}\n\n\t_handleDOMEvent(e) {\n\t\tconst el = e.target;\n\t\tif (e.type === 'click') { PointerEvents.simulateDblclick(e, this._container); }\n\t\tif (!this._loaded || e.type === 'click' && PointerEvents.isClickDisabled(el, this._container)) {\n\t\t\treturn;\n\t\t}\n\n\t\t// canvas elements don't receive pointer events, so hit-test canvas renderers when the event isn't on\n\t\t// an interactive DOM layer, and track hover (cursor, pointerover/out) for canvas layers here\n\t\tconst type = e.type,\n\t\tmove = type === 'pointermove',\n\t\thovered = this._hoveredCanvasLayer,\n\t\tskip = type === 'pointerover' || type === 'pointerout' || type.startsWith('key') ||\n\t\t\tthis._animatingZoom || move && this.dragging?.moving(),\n\t\tleftMap = type === 'pointerout' && !this._container.contains(e.relatedTarget);\n\t\tlet layer = skip ? undefined : this._canvasLayerAt(e, type === 'click');\n\n\t\t// a click is fired on what both the press and the release were on, but for canvas layers the browser only sees\n\t\t// the map, so a pointer click goes to a canvas layer only if the press was on that layer too\n\t\tif (type === 'pointerdown') {\n\t\t\tthis._pressedCanvasLayer = skip ? undefined : layer ?? null;\n\t\t} else if (type === 'click' && e.detail > 0 && this._pressedCanvasLayer !== undefined) {\n\t\t\tif (layer !== this._pressedCanvasLayer) { layer = undefined; }\n\t\t\tthis._pressedCanvasLayer = undefined;\n\t\t}\n\n\t\tif (layer !== hovered && (move && !skip || leftMap)) {\n\t\t\tif (hovered) { this._fireDOMEvent(e, 'pointerout', [hovered]); }\n\t\t\tthis._container.classList.toggle('maplair-interactive', !!layer); // change cursor\n\t\t\tthis._hoveredCanvasLayer = layer;\n\t\t\tif (layer) { this._fireDOMEvent(e, 'pointerover', [layer]); }\n\t\t}\n\n\t\tthis._fireDOMEvent(e, type, layer && [layer]);\n\t};\n\n\t_canvasLayerAt(e, click) {\n\t\t// skip events on interactive DOM layers and controls\n\t\tfor (let el = e.target; el !== this._container; el = el.parentNode) {\n\t\t\tif (!el || el === this._controlContainer || this._targets[Util.stamp(el)]) { return; }\n\t\t}\n\t\tfor (const renderer of this._canvases) {\n\t\t\tconst layer = renderer._layerAt(e, click);\n\t\t\tif (layer) { return layer; }\n\t\t}\n\t}\n\n\tstatic _pointerEvents = ['click', 'dblclick', 'pointerover', 'pointerout', 'contextmenu'];\n\n\t_fireDOMEvent(e, type, canvasTargets) {\n\n\t\tif (type === 'click') {\n\t\t\t// Fire a synthetic 'preclick' event which propagates up (mainly for closing popups).\n\t\t\tthis._fireDOMEvent(e, 'preclick', canvasTargets);\n\t\t}\n\n\t\t// Find the layer the event is propagating from and its parents\n\t\t// (synthetic canvas hover events don't propagate to DOM layers).\n\t\tconst canvasHover = canvasTargets && (type === 'pointerover' || type === 'pointerout');\n\t\tlet targets = canvasHover ? [] : this._findEventTargets(e, type);\n\n\t\tif (canvasTargets) {\n\t\t\t// pick only targets with listeners\n\t\t\tconst filtered = canvasTargets.filter(t => t.listens(type, true));\n\t\t\ttargets = [...filtered, ...targets];\n\t\t}\n\n\t\tif (!targets.length) { return; }\n\n\t\tif (type === 'contextmenu') {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tconst target = targets[0];\n\t\tconst data = {\n\t\t\toriginalEvent: e\n\t\t};\n\n\t\tif (e.type !== 'keydown' && e.type !== 'keyup') {\n\t\t\tconst latlng = (!target._pxRadius || target._pxRadius <= 10) && target.getLatLng?.();\n\t\t\tdata.containerPoint = latlng ?\n\t\t\t\tthis.latLngToContainerPoint(latlng) : this.pointerEventToContainerPoint(e);\n\t\t\tdata.layerPoint = this.containerPointToLayerPoint(data.containerPoint);\n\t\t\tdata.latlng = latlng || this.layerPointToLatLng(data.layerPoint);\n\t\t}\n\n\t\tfor (const t of targets) {\n\t\t\tt.fire(type, data, true);\n\t\t\t// bubblingMouseEvents is the Leaflet 1 name of the option\n\t\t\tconst bubbling = t.options.bubblingMouseEvents ?? t.options.bubblingPointerEvents;\n\t\t\tif (data.originalEvent._stopped ||\n\t\t\t\t(bubbling === false && MaplairMap._pointerEvents.includes(type))) { return; }\n\t\t}\n\t}\n\n\t_draggableMoved(obj) {\n\t\tobj = obj.dragging?.enabled() ? obj : this;\n\t\treturn obj.dragging?.moved() || this.boxZoom?.moved();\n\t}\n\n\n\t/**\n\t * Runs the given function `callback` when the map gets initialized with\n\t * a view (center and zoom) and at least one layer, or immediately\n\t * if it's already initialized, optionally passing a function context.\n\t * @group Other methods\n\t * @param {(event: {target: MaplairMap}) => void} callback\n\t * @param {object} [context]\n\t * @returns {this}\n\t */\n\twhenReady(callback, context) {\n\t\tif (this._loaded) {\n\t\t\tcallback.call(context || this, {target: this});\n\t\t} else {\n\t\t\tthis.on('load', callback, context);\n\t\t}\n\t\treturn this;\n\t}\n\n\n\t// private methods for getting map state\n\n\t_getMapPanePos() {\n\t\treturn DomUtil.getPosition(this._mapPane);\n\t}\n\n\t_getTopLeftPoint(center, zoom) {\n\t\tconst pixelOrigin = center && zoom !== undefined ?\n\t\t\tthis._getNewPixelOrigin(center, zoom) :\n\t\t\tthis.getPixelOrigin();\n\t\treturn pixelOrigin.subtract(this._getMapPanePos());\n\t}\n\n\t_getNewPixelOrigin(center, zoom) {\n\t\tconst viewHalf = this.getSize()._divideBy(2);\n\t\tconst origin = this.project(center, zoom)._subtract(viewHalf)._add(this._getMapPanePos());\n\t\treturn this._subpixelOrigin ? origin : origin._round();\n\t}\n\n\t// Snaps a layer point to whole pixels for crisp rendering, except during flyTo frames, where snapped layers\n\t// would step against the smoothly moving tiles. Modifies the point in place.\n\t_snapLayerPoint(point) {\n\t\treturn this._subpixelOrigin ? point : point._round();\n\t}\n\n\t_latLngToNewLayerPoint(latlng, zoom, center) {\n\t\tconst topLeft = this._getNewPixelOrigin(center, zoom);\n\t\treturn this.project(latlng, zoom)._subtract(topLeft);\n\t}\n\n\t// layer point of the current center\n\t_getCenterLayerPoint() {\n\t\treturn this.containerPointToLayerPoint(this.getSize()._divideBy(2));\n\t}\n\n\t// offset of the specified place to the current center in pixels\n\t_getCenterOffset(latlng) {\n\t\treturn this.latLngToLayerPoint(latlng)._round()._subtract(this._getCenterLayerPoint());\n\t}\n\n\t// adjust center for view to get inside bounds\n\t_limitCenter(center, zoom, bounds) {\n\n\t\tif (!bounds) { return center; }\n\n\t\tconst centerPoint = this.project(center, zoom),\n\t\tviewHalf = this.getSize().divideBy(2),\n\t\tviewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\n\t\toffset = this._getBoundsOffset(viewBounds, bounds, zoom);\n\n\t\t// If offset is less than a pixel, ignore.\n\t\t// This prevents unstable projections from getting into\n\t\t// an infinite loop of tiny offsets.\n\t\tif (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) {\n\t\t\treturn center;\n\t\t}\n\n\t\treturn this.unproject(centerPoint.add(offset), zoom);\n\t}\n\n\t// not cached, so that a preference changed mid-session applies right away\n\t_prefersReducedMotion() {\n\t\treturn window.matchMedia('(prefers-reduced-motion: reduce)').matches;\n\t}\n\n\t// adjust offset for view to get inside bounds\n\t_limitOffset(offset, bounds) {\n\t\tif (!bounds) { return offset; }\n\n\t\tconst viewBounds = this.getPixelBounds(),\n\t\tnewBounds = new Bounds(viewBounds.min.add(offset), viewBounds.max.add(offset));\n\n\t\treturn offset.add(this._getBoundsOffset(newBounds, bounds));\n\t}\n\n\t// returns offset needed for pxBounds to get inside maxBounds at a specified zoom\n\t_getBoundsOffset(pxBounds, maxBounds, zoom) {\n\t\t// any corner can be an extreme when the projection rotates the axes\n\t\tconst corners = [maxBounds.getNorthWest(), maxBounds.getNorthEast(), maxBounds.getSouthEast(), maxBounds.getSouthWest()],\n\t\tprojectedMaxBounds = new Bounds(corners.map(c => this.project(c, zoom))),\n\t\tminOffset = projectedMaxBounds.min.subtract(pxBounds.min),\n\t\tmaxOffset = projectedMaxBounds.max.subtract(pxBounds.max),\n\n\t\tdx = this._rebound(minOffset.x, -maxOffset.x),\n\t\tdy = this._rebound(minOffset.y, -maxOffset.y);\n\n\t\treturn new Point(dx, dy);\n\t}\n\n\t_rebound(left, right) {\n\t\treturn left + right > 0 ?\n\t\t\tMath.round(left - right) / 2 :\n\t\t\tMath.max(0, Math.ceil(left)) - Math.max(0, Math.floor(right));\n\t}\n\n\t_limitZoom(zoom) {\n\t\tconst min = this.getMinZoom(),\n\t\tmax = this.getMaxZoom(),\n\t\tsnap = this.options.zoomSnap;\n\t\tif (snap) {\n\t\t\tzoom = Math.round(zoom / snap) * snap;\n\t\t}\n\t\treturn Math.max(min, Math.min(max, zoom));\n\t}\n\n\t_onPanTransitionStep() {\n\t\tthis.fire('move');\n\t}\n\n\t_onPanTransitionEnd() {\n\t\tthis._mapPane.classList.remove('maplair-pan-anim');\n\t\tthis._wrapWorldCopy();\n\t\tthis._moveEnd(false);\n\t}\n\n\t_tryAnimatedPan(center, options) {\n\t\t// difference between the new and current centers in pixels\n\t\t// rounding the difference keeps a pan exact on maps whose center is between pixels\n\t\tconst offset = this.latLngToLayerPoint(center)._subtract(this._getCenterLayerPoint())._round();\n\n\t\t// don't animate too far unless animate: true specified in options\n\t\tif (options?.animate !== true && !this.getSize().contains(offset)) { return false; }\n\n\t\tthis._panBy(offset, options);\n\n\t\treturn true;\n\t}\n\n\t_createAnimProxy() {\n\t\tthis._proxy = DomUtil.create('div', 'maplair-proxy maplair-zoom-animated');\n\t\tthis._panes.mapPane.append(this._proxy);\n\n\t\tthis.on('zoomanim', this._animateProxyZoom, this);\n\t\tthis.on('load moveend', this._animMoveEnd, this);\n\n\t\tDomEvent.on(this._proxy, 'transitionend', this._catchTransitionEnd, this);\n\t}\n\n\t_animateProxyZoom(e) {\n\t\tconst transform = this._proxy.style.transform;\n\n\t\tDomUtil.setTransform(\n\t\t\tthis._proxy,\n\t\t\tthis.project(e.center, e.zoom),\n\t\t\tthis.getZoomScale(e.zoom, 1),\n\t\t);\n\n\t\t// workaround for case when transform is the same and so transitionend event is not fired\n\t\tif (transform === this._proxy.style.transform && this._animatingZoom) {\n\t\t\tthis._onZoomTransitionEnd();\n\t\t}\n\t}\n\n\t_animMoveEnd() {\n\t\tconst c = this.getCenter();\n\t\tconst z = this.getZoom();\n\n\n\n\t\tDomUtil.setTransform(\n\t\t\tthis._proxy,\n\t\t\tthis.project(c, z),\n\t\t\tthis.getZoomScale(z, 1),\n\t\t);\n\t}\n\n\t_catchTransitionEnd(e) {\n\t\tif (this._animatingZoom && e.propertyName.includes('transform')) {\n\t\t\tthis._onZoomTransitionEnd();\n\t\t}\n\t}\n\n\t_nothingToAnimate() {\n\t\treturn !this._container.getElementsByClassName('maplair-zoom-animated').length;\n\t}\n\n\t// Zooms to `center` and `zoom` frame by frame around the zoom origin at `offset`\n\t// from the center (as the CSS zoom animation does), see the `continuousZoom` option.\n\t_continuousZoom(center, zoom, offset, options) {\n\t\tconst startZoom = this._zoom,\n\t\toriginOffset = offset.multiplyBy(-1),\n\t\torigin = this.containerPointToLatLng(this.getSize()._divideBy(2).add(offset)),\n\t\tstart = performance.now(),\n\t\tduration = 250;\n\n\t\tthis._moveStart(true, options.noMoveStart ?? false);\n\n\t\tconst frame = () => {\n\t\t\tconst t = Math.min(1, (performance.now() - start) / duration);\n\t\t\tif (t < 1) {\n\t\t\t\t// ease out, like the CSS zoom transition\n\t\t\t\tconst z = startZoom + (zoom - startZoom) * (1 - (1 - t) ** 2);\n\t\t\t\tthis._move(this.unproject(this.project(origin, z).add(originOffset), z), z, {continuous: true});\n\t\t\t\t// cancelled by `_stop()`\n\t\t\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\t\t} else {\n\t\t\t\tthis._move(center, zoom)._moveEnd(true);\n\t\t\t}\n\t\t};\n\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t}\n\n\t_targetZoom() {\n\t\treturn this._targetView?.zoom ?? this._zoom;\n\t}\n\n\t// an animated zoom drops zooms from input until it ends, so hold them as long after an instant zoom too,\n\t// or a trackpad swipe or a held key zooms several times as far\n\t_zoomInputBlocked() {\n\t\treturn this._animatingZoom || Date.now() < this._instantZoomEnd;\n\t}\n\n\t_tryAnimatedZoom(center, zoom, options) {\n\n\t\tif (this._animatingZoom) { return true; }\n\n\t\toptions ??= {};\n\n\t\t// don't animate if disabled, not supported or zoom difference is too large (over 1 with reduced motion,\n\t\t// unless animate: true is specified)\n\t\tconst threshold = this.options.zoomAnimationThreshold,\n\t\tmaxZoomDiff = this._prefersReducedMotion() && options.animate !== true ? Math.min(threshold, 1) : threshold;\n\t\tif (!this._zoomAnimated || options.animate === false ||\n\t\t (this._nothingToAnimate() && !this.options.continuousZoom) ||\n\t\t Math.abs(zoom - this._zoom) > maxZoomDiff) { return false; }\n\n\t\t// offset is the pixel coords of the zoom origin relative to the current center\n\t\tconst scale = this.getZoomScale(zoom),\n\t\toffset = this._getCenterOffset(center)._divideBy(1 - 1 / scale);\n\n\t\t// don't animate if the zoom origin isn't within one screen from the current center, unless forced\n\t\tif (options.animate !== true && !this.getSize().contains(offset)) { return false; }\n\n\t\tif (this.options.continuousZoom) {\n\t\t\tthis._continuousZoom(center, zoom, offset, options);\n\t\t\treturn true;\n\t\t}\n\n\t\tconst userEvent = this._userEvent;\n\t\tthis._zoomAnimFrame = requestAnimationFrame(() => {\n\t\t\tthis._zoomAnimFrame = null;\n\t\t\tif (userEvent) {\n\t\t\t\tthis._setUserEvent(userEvent);\n\t\t\t}\n\t\t\tthis\n\t\t\t\t._moveStart(true, options.noMoveStart ?? false)\n\t\t\t\t._animateZoom(center, zoom);\n\t\t});\n\n\t\treturn true;\n\t}\n\n\t_animateZoom(center, zoom, noUpdate) {\n\t\tif (!this._mapPane) { return; }\n\n\t\tthis._animatingZoom = true;\n\n\t\t// remember what center/zoom to set after animation\n\t\tthis._animateToCenter = center;\n\t\tthis._animateToZoom = zoom;\n\n\t\tthis._mapPane.classList.add('maplair-zoom-anim');\n\n\t\tthis.fire('zoomanim', {\n\t\t\tcenter,\n\t\t\tzoom,\n\t\t\tnoUpdate\n\t\t});\n\n\t\tif (!this._tempFireZoomEvent) {\n\t\t\tthis._tempFireZoomEvent = this._zoom !== this._animateToZoom;\n\t\t}\n\n\t\tthis._move(this._animateToCenter, this._animateToZoom, undefined, true);\n\n\t\t// in case 'transitionend' never comes (Leaflet #3689, #2693); the transition only starts once the browser\n\t\t// renders the next frame, which takes ~200 ms with 5k markers, so a timer of the transition's length cuts it short\n\t\tclearTimeout(this._transitionEndTimer);\n\t\tthis._transitionEndTimer = setTimeout(this._onZoomTransitionEnd.bind(this), 1000);\n\t}\n\n\t_onZoomTransitionEnd() {\n\t\tif (!this._animatingZoom) { return; }\n\n\t\tclearTimeout(this._transitionEndTimer);\n\t\tthis._containerRect = null;\n\t\tthis._mapPane?.classList.remove('maplair-zoom-anim');\n\n\t\tthis._animatingZoom = false;\n\n\t\t// a drag during the animation moves the map pane, so the center is read from the pane rather than restored\n\t\tthis._move(this.getCenter(), this._animateToZoom, undefined, true);\n\n\t\tif (this._tempFireZoomEvent) {\n\t\t\tthis.fire('zoom');\n\t\t}\n\t\tdelete this._tempFireZoomEvent;\n\n\t\tthis.fire('move');\n\n\t\tthis._moveEnd(true);\n\n\t\t// read after moveend, since its listeners may have queued a newer view or stopped the map\n\t\tconst view = this._pendingView;\n\t\tif (view) {\n\t\t\tthis._pendingView = null;\n\t\t\tthis.setView(view.center, view.zoom, view.options);\n\t\t}\n\t}\n}\n\n// The default features (layers, popups, tooltips, vector renderers, controls\n// and interaction handlers) come with every map: they are registered here\n// rather than by the entry module, so that they are included whenever\n// `MaplairMap` is, while bundlers can still drop other features (e.g. GeoJSON,\n// the layers and scale controls) when an application doesn't use them.\n//\n// Possible tree-shaking optimization: popups, tooltips and the vector renderers\n// (DivOverlay, Popup, Tooltip, RendererSupport; about 25 kB of a minimal map's\n// 100 kB minified) could become optional by registering themselves when their\n// module is imported (without importing this module, to avoid circular imports)\n// instead of here. But then `layer.bindPopup()`/`bindTooltip()` and the map's\n// popup/tooltip methods would only exist in production bundles of apps that\n// actually use the `Popup`/`Tooltip` classes (bundlers drop an unused\n// `import {Tooltip}`), while they would always work in development builds.\nfor (const feature of [\n\tAttributionControl,\n\tControl,\n\tDivOverlay,\n\tLayer,\n\tBoxZoomHandler,\n\tDoubleClickZoomHandler,\n\tDragHandler,\n\tKeyboardHandler,\n\tPinchZoomHandler,\n\tScrollWheelZoomHandler,\n\tTapHoldHandler,\n\tTapDragZoomHandler,\n\tPopup,\n\tTooltip,\n\tRendererSupport,\n\tZoomControl,\n\tFullscreenControl\n]) {\n\tfeature.register(MaplairMap);\n}\n\nexport {MaplairMap as Map};\nexport {MaplairMap as LeafletMap};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4PzB,IAAa,aAAb,MAAa,mBAAmB,QAAQ;CAEvC,OAAO,i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B;EAE5B,aAAa,KAAK,mBAAmB;EACrC,KAAK,iBAAiB;EACtB,KAAK,UAAU,UAAU,OAAO,mBAAmB;EAEnD,KAAK,iBAAiB;EAGtB,KAAK,MAAM,KAAK,UAAU,GAAG,KAAK,gBAAgB,KAAA,GAAW,IAAI;EAEjE,IAAI,KAAK,oBACR,KAAK,KAAK,MAAM;EAEjB,OAAO,KAAK;EAEZ,KAAK,KAAK,MAAM;EAEhB,KAAK,SAAS,IAAI;EAGlB,MAAM,OAAO,KAAK;EAClB,IAAI,MAAM;GACT,KAAK,eAAe;GACpB,KAAK,QAAQ,KAAK,QAAQ,KAAK,MAAM,KAAK,OAAO;EAClD;CACD;AACD;AAgBA,KAAK,MAAM,WAAW;CACrB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACAU;CACA;CACA;AACD,GACC,QAAQ,SAAS,UAAU"}
@@ -115,7 +115,7 @@ var MapSync = class {
115
115
  if (this._leader !== map) return;
116
116
  for (const other of this._followers(map)) if (other._zoomAnimated) {
117
117
  this._animating.add(other);
118
- other._animateZoom(e.center, this._zoomFor(other, map, e.zoom), true, e.noUpdate);
118
+ other._animateZoom(e.center, this._zoomFor(other, map, e.zoom), e.noUpdate);
119
119
  }
120
120
  }
121
121
  _onMoveEnd(map) {
@@ -145,10 +145,7 @@ var MapSync = class {
145
145
  other._rawPanBy(offset);
146
146
  other.fire("move");
147
147
  }
148
- } else other._move(center, zoom, during ? {
149
- pinch: true,
150
- round: false
151
- } : void 0);
148
+ } else other._move(center, zoom, during ? { pinch: true } : void 0);
152
149
  }
153
150
  _syncAll(map) {
154
151
  for (const other of this._maps.filter((m) => m !== map)) {