maplair 4.0.0 → 4.2.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 (305) hide show
  1. package/CHANGELOG.md +178 -0
  2. package/dist/esm/Maplair.js +18 -17
  3. package/dist/esm/Maplair.js.map +1 -1
  4. package/dist/esm/_virtual/_rolldown/runtime.js +1 -2
  5. package/dist/esm/control/AttributionControl.js +25 -16
  6. package/dist/esm/control/AttributionControl.js.map +1 -1
  7. package/dist/esm/control/ButtonControl.js +10 -13
  8. package/dist/esm/control/ButtonControl.js.map +1 -1
  9. package/dist/esm/control/ContextMenu.js +2 -5
  10. package/dist/esm/control/ContextMenu.js.map +1 -1
  11. package/dist/esm/control/Control.js +10 -18
  12. package/dist/esm/control/Control.js.map +1 -1
  13. package/dist/esm/control/FullscreenControl.js +6 -9
  14. package/dist/esm/control/FullscreenControl.js.map +1 -1
  15. package/dist/esm/control/LayersControl.js +170 -65
  16. package/dist/esm/control/LayersControl.js.map +1 -1
  17. package/dist/esm/control/LegendControl.js +8 -11
  18. package/dist/esm/control/LegendControl.js.map +1 -1
  19. package/dist/esm/control/MiniMapControl.js +15 -18
  20. package/dist/esm/control/MiniMapControl.js.map +1 -1
  21. package/dist/esm/control/RotateControl.js +2 -5
  22. package/dist/esm/control/RotateControl.js.map +1 -1
  23. package/dist/esm/control/ScaleControl.js +8 -11
  24. package/dist/esm/control/ScaleControl.js.map +1 -1
  25. package/dist/esm/control/SearchControl.js +100 -19
  26. package/dist/esm/control/SearchControl.js.map +1 -1
  27. package/dist/esm/control/SideBySideControl.js +2 -5
  28. package/dist/esm/control/SideBySideControl.js.map +1 -1
  29. package/dist/esm/control/TextControl.js +6 -9
  30. package/dist/esm/control/TextControl.js.map +1 -1
  31. package/dist/esm/control/TimeControl.js +407 -0
  32. package/dist/esm/control/TimeControl.js.map +1 -0
  33. package/dist/esm/control/ZoomControl.js +23 -36
  34. package/dist/esm/control/ZoomControl.js.map +1 -1
  35. package/dist/esm/core/Class.js +28 -44
  36. package/dist/esm/core/Class.js.map +1 -1
  37. package/dist/esm/core/Events.js +22 -10
  38. package/dist/esm/core/Events.js.map +1 -1
  39. package/dist/esm/core/Handler.js +23 -14
  40. package/dist/esm/core/Handler.js.map +1 -1
  41. package/dist/esm/core/I18n.js +1 -2
  42. package/dist/esm/core/Util.js +15 -4
  43. package/dist/esm/core/Util.js.map +1 -1
  44. package/dist/esm/dom/DomEvent.DoubleTap.js +26 -24
  45. package/dist/esm/dom/DomEvent.DoubleTap.js.map +1 -1
  46. package/dist/esm/dom/DomEvent.PointerEvents.js +3 -18
  47. package/dist/esm/dom/DomEvent.PointerEvents.js.map +1 -1
  48. package/dist/esm/dom/DomEvent.js +18 -60
  49. package/dist/esm/dom/DomEvent.js.map +1 -1
  50. package/dist/esm/dom/DomUtil.js +15 -70
  51. package/dist/esm/dom/DomUtil.js.map +1 -1
  52. package/dist/esm/dom/Draggable.js +21 -21
  53. package/dist/esm/dom/Draggable.js.map +1 -1
  54. package/dist/esm/dom/PosAnimation.js +4 -27
  55. package/dist/esm/dom/PosAnimation.js.map +1 -1
  56. package/dist/esm/geo/LatLng.js +16 -7
  57. package/dist/esm/geo/LatLng.js.map +1 -1
  58. package/dist/esm/geo/LatLngBounds.js +9 -15
  59. package/dist/esm/geo/LatLngBounds.js.map +1 -1
  60. package/dist/esm/geo/crs/CRS.js +1 -2
  61. package/dist/esm/geo/crs/EPSG3395.js +5 -6
  62. package/dist/esm/geo/crs/EPSG3395.js.map +1 -1
  63. package/dist/esm/geo/crs/EPSG3857.js +5 -6
  64. package/dist/esm/geo/crs/EPSG3857.js.map +1 -1
  65. package/dist/esm/geo/crs/EPSG4326.js +4 -5
  66. package/dist/esm/geo/crs/EPSG4326.js.map +1 -1
  67. package/dist/esm/geo/crs/EarthCRS.js +3 -4
  68. package/dist/esm/geo/crs/EarthCRS.js.map +1 -1
  69. package/dist/esm/geo/crs/SimpleCRS.js +4 -5
  70. package/dist/esm/geo/crs/SimpleCRS.js.map +1 -1
  71. package/dist/esm/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +5 -6
  72. package/dist/esm/geo/projection/LonLatProjection.js.map +1 -0
  73. package/dist/esm/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +4 -5
  74. package/dist/esm/geo/projection/MercatorProjection.js.map +1 -0
  75. package/dist/esm/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +5 -6
  76. package/dist/esm/geo/projection/SphericalMercatorProjection.js.map +1 -0
  77. package/dist/esm/geometry/Bounds.js +10 -14
  78. package/dist/esm/geometry/Bounds.js.map +1 -1
  79. package/dist/esm/geometry/LineUtil.js +37 -32
  80. package/dist/esm/geometry/LineUtil.js.map +1 -1
  81. package/dist/esm/geometry/Point.js +1 -2
  82. package/dist/esm/geometry/PolyUtil.js +24 -51
  83. package/dist/esm/geometry/PolyUtil.js.map +1 -1
  84. package/dist/esm/geometry/Transformation.js +1 -2
  85. package/dist/esm/layer/BlanketOverlay.js +7 -10
  86. package/dist/esm/layer/BlanketOverlay.js.map +1 -1
  87. package/dist/esm/layer/Classification.js +1 -2
  88. package/dist/esm/layer/DivOverlay.js +16 -22
  89. package/dist/esm/layer/DivOverlay.js.map +1 -1
  90. package/dist/esm/layer/FeatureGroup.js +5 -4
  91. package/dist/esm/layer/FeatureGroup.js.map +1 -1
  92. package/dist/esm/layer/GeoJSON.Load.js +1 -2
  93. package/dist/esm/layer/GeoJSON.js +17 -155
  94. package/dist/esm/layer/GeoJSON.js.map +1 -1
  95. package/dist/esm/layer/GeoJSONUtil.js +74 -0
  96. package/dist/esm/layer/GeoJSONUtil.js.map +1 -0
  97. package/dist/esm/layer/HeatLayer.js +17 -20
  98. package/dist/esm/layer/HeatLayer.js.map +1 -1
  99. package/dist/esm/layer/ImageOverlay.js +22 -29
  100. package/dist/esm/layer/ImageOverlay.js.map +1 -1
  101. package/dist/esm/layer/Layer.js +9 -12
  102. package/dist/esm/layer/Layer.js.map +1 -1
  103. package/dist/esm/layer/LayerGroup.js +53 -3
  104. package/dist/esm/layer/LayerGroup.js.map +1 -1
  105. package/dist/esm/layer/Popup.js +35 -58
  106. package/dist/esm/layer/Popup.js.map +1 -1
  107. package/dist/esm/layer/SVGOverlay.js +3 -7
  108. package/dist/esm/layer/SVGOverlay.js.map +1 -1
  109. package/dist/esm/layer/Tooltip.js +31 -34
  110. package/dist/esm/layer/Tooltip.js.map +1 -1
  111. package/dist/esm/layer/VideoOverlay.js +13 -17
  112. package/dist/esm/layer/VideoOverlay.js.map +1 -1
  113. package/dist/esm/layer/marker/DefaultIcon.js +38 -49
  114. package/dist/esm/layer/marker/DefaultIcon.js.map +1 -1
  115. package/dist/esm/layer/marker/DivIcon.js +8 -11
  116. package/dist/esm/layer/marker/DivIcon.js.map +1 -1
  117. package/dist/esm/layer/marker/Icon.js +9 -12
  118. package/dist/esm/layer/marker/Icon.js.map +1 -1
  119. package/dist/esm/layer/marker/Marker.Drag.js +44 -5
  120. package/dist/esm/layer/marker/Marker.Drag.js.map +1 -1
  121. package/dist/esm/layer/marker/Marker.Move.js +5 -8
  122. package/dist/esm/layer/marker/Marker.Move.js.map +1 -1
  123. package/dist/esm/layer/marker/Marker.js +115 -47
  124. package/dist/esm/layer/marker/Marker.js.map +1 -1
  125. package/dist/esm/layer/marker/MarkerClusterGroup.js +301 -0
  126. package/dist/esm/layer/marker/MarkerClusterGroup.js.map +1 -0
  127. package/dist/esm/layer/marker/SvgIcon.js +7 -10
  128. package/dist/esm/layer/marker/SvgIcon.js.map +1 -1
  129. package/dist/esm/layer/tile/GridLayer.js +89 -101
  130. package/dist/esm/layer/tile/GridLayer.js.map +1 -1
  131. package/dist/esm/layer/tile/TileLayer.js +36 -44
  132. package/dist/esm/layer/tile/TileLayer.js.map +1 -1
  133. package/dist/esm/layer/tile/WMSTileLayer.js +33 -27
  134. package/dist/esm/layer/tile/WMSTileLayer.js.map +1 -1
  135. package/dist/esm/layer/vector/Canvas.js +8 -17
  136. package/dist/esm/layer/vector/Canvas.js.map +1 -1
  137. package/dist/esm/layer/vector/Circle.js +6 -5
  138. package/dist/esm/layer/vector/Circle.js.map +1 -1
  139. package/dist/esm/layer/vector/CircleMarker.js +19 -10
  140. package/dist/esm/layer/vector/CircleMarker.js.map +1 -1
  141. package/dist/esm/layer/vector/Path.DashAnimation.js +3 -5
  142. package/dist/esm/layer/vector/Path.DashAnimation.js.map +1 -1
  143. package/dist/esm/layer/vector/Path.ZoomStyles.js +1 -2
  144. package/dist/esm/layer/vector/Path.js +28 -22
  145. package/dist/esm/layer/vector/Path.js.map +1 -1
  146. package/dist/esm/layer/vector/Polygon.js +22 -7
  147. package/dist/esm/layer/vector/Polygon.js.map +1 -1
  148. package/dist/esm/layer/vector/Polyline.Decorations.js +3 -4
  149. package/dist/esm/layer/vector/Polyline.js +25 -10
  150. package/dist/esm/layer/vector/Polyline.js.map +1 -1
  151. package/dist/esm/layer/vector/Rectangle.js +1 -2
  152. package/dist/esm/layer/vector/Renderer.getRenderer.js +17 -17
  153. package/dist/esm/layer/vector/Renderer.getRenderer.js.map +1 -1
  154. package/dist/esm/layer/vector/Renderer.js +1 -2
  155. package/dist/esm/layer/vector/SVG.js +12 -9
  156. package/dist/esm/layer/vector/SVG.js.map +1 -1
  157. package/dist/esm/map/Hash.js +1 -2
  158. package/dist/esm/map/Map.Rotation.js +41 -22
  159. package/dist/esm/map/Map.Rotation.js.map +1 -1
  160. package/dist/esm/map/Map.js +125 -126
  161. package/dist/esm/map/Map.js.map +1 -1
  162. package/dist/esm/map/MapSync.js +1 -2
  163. package/dist/esm/map/handler/BoxZoomHandler.js +25 -47
  164. package/dist/esm/map/handler/BoxZoomHandler.js.map +1 -1
  165. package/dist/esm/map/handler/DisplaceHandler.js +7 -10
  166. package/dist/esm/map/handler/DisplaceHandler.js.map +1 -1
  167. package/dist/esm/map/handler/DoubleClickZoomHandler.js +1 -2
  168. package/dist/esm/map/handler/DragHandler.js +20 -21
  169. package/dist/esm/map/handler/DragHandler.js.map +1 -1
  170. package/dist/esm/map/handler/KeyboardHandler.js +48 -68
  171. package/dist/esm/map/handler/KeyboardHandler.js.map +1 -1
  172. package/dist/esm/map/handler/PinchZoomHandler.js +13 -5
  173. package/dist/esm/map/handler/PinchZoomHandler.js.map +1 -1
  174. package/dist/esm/map/handler/ScrollWheelZoomHandler.js +4 -6
  175. package/dist/esm/map/handler/ScrollWheelZoomHandler.js.map +1 -1
  176. package/dist/esm/map/handler/TapDragZoomHandler.js +1 -2
  177. package/dist/esm/map/handler/TapHoldHandler.js +13 -7
  178. package/dist/esm/map/handler/TapHoldHandler.js.map +1 -1
  179. package/dist/esm/package.js +2 -3
  180. package/dist/maplair-global-src.js +6495 -5981
  181. package/dist/maplair-global-src.js.map +1 -1
  182. package/dist/maplair-global.js +2 -2
  183. package/dist/maplair-global.js.map +1 -1
  184. package/dist/maplair-src.js +6206 -5673
  185. package/dist/maplair-src.js.map +1 -1
  186. package/dist/maplair.css +1 -1213
  187. package/dist/maplair.js +2 -2
  188. package/dist/maplair.js.map +1 -1
  189. package/i18n/cs.json +6 -0
  190. package/i18n/de.json +6 -0
  191. package/i18n/en.json +6 -0
  192. package/i18n/es.json +6 -0
  193. package/i18n/fr.json +6 -0
  194. package/i18n/hu.json +6 -0
  195. package/i18n/it.json +6 -0
  196. package/i18n/rm.json +6 -0
  197. package/i18n/sk.json +6 -0
  198. package/i18n/sl.json +6 -0
  199. package/package.json +11 -18
  200. package/src/Maplair.all.js +0 -1
  201. package/src/control/AttributionControl.js +25 -18
  202. package/src/control/ButtonControl.js +9 -11
  203. package/src/control/ContextMenu.js +3 -5
  204. package/src/control/Control.js +9 -19
  205. package/src/control/FullscreenControl.js +5 -7
  206. package/src/control/LayersControl.js +196 -86
  207. package/src/control/LegendControl.js +7 -9
  208. package/src/control/MiniMapControl.js +9 -11
  209. package/src/control/RotateControl.js +3 -5
  210. package/src/control/ScaleControl.js +7 -9
  211. package/src/control/SearchControl.js +102 -19
  212. package/src/control/SideBySideControl.js +3 -5
  213. package/src/control/TextControl.js +5 -7
  214. package/src/control/TimeControl.js +471 -0
  215. package/src/control/ZoomControl.js +22 -38
  216. package/src/control/index.js +1 -0
  217. package/src/core/Class.js +37 -45
  218. package/src/core/Events.js +22 -3
  219. package/src/core/Handler.js +25 -13
  220. package/src/core/Util.js +20 -2
  221. package/src/core/index.js +0 -1
  222. package/src/dom/DomEvent.DoubleTap.js +18 -10
  223. package/src/dom/DomEvent.PointerEvents.js +3 -26
  224. package/src/dom/DomEvent.js +17 -85
  225. package/src/dom/DomUtil.js +22 -78
  226. package/src/dom/Draggable.js +32 -23
  227. package/src/dom/PosAnimation.js +3 -25
  228. package/src/dom/index.js +0 -1
  229. package/src/geo/LatLng.js +20 -3
  230. package/src/geo/LatLngBounds.js +8 -15
  231. package/src/geo/crs/EPSG3395.js +4 -4
  232. package/src/geo/crs/EPSG3857.js +4 -4
  233. package/src/geo/crs/EPSG4326.js +3 -3
  234. package/src/geo/crs/EarthCRS.js +2 -8
  235. package/src/geo/crs/SimpleCRS.js +3 -3
  236. package/src/geo/index.js +1 -2
  237. package/src/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +2 -2
  238. package/src/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +2 -2
  239. package/src/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +2 -2
  240. package/src/geo/projection/index.js +5 -5
  241. package/src/geometry/Bounds.js +12 -17
  242. package/src/geometry/LineUtil.js +48 -49
  243. package/src/geometry/PolyUtil.js +39 -76
  244. package/src/layer/BlanketOverlay.js +6 -10
  245. package/src/layer/DivOverlay.js +16 -27
  246. package/src/layer/FeatureGroup.js +8 -2
  247. package/src/layer/GeoJSON.js +17 -218
  248. package/src/layer/GeoJSONUtil.js +85 -0
  249. package/src/layer/HeatLayer.js +10 -12
  250. package/src/layer/ImageOverlay.js +21 -32
  251. package/src/layer/Layer.js +8 -10
  252. package/src/layer/LayerGroup.js +72 -1
  253. package/src/layer/Popup.js +37 -62
  254. package/src/layer/SVGOverlay.js +1 -5
  255. package/src/layer/Tooltip.js +34 -36
  256. package/src/layer/VideoOverlay.js +12 -15
  257. package/src/layer/marker/DefaultIcon.js +40 -58
  258. package/src/layer/marker/DivIcon.js +9 -11
  259. package/src/layer/marker/Icon.js +9 -10
  260. package/src/layer/marker/Marker.Drag.js +54 -6
  261. package/src/layer/marker/Marker.Move.js +4 -6
  262. package/src/layer/marker/Marker.js +145 -52
  263. package/src/layer/marker/MarkerClusterGroup.js +370 -0
  264. package/src/layer/marker/SvgIcon.js +7 -9
  265. package/src/layer/marker/index.js +1 -0
  266. package/src/layer/tile/GridLayer.js +108 -135
  267. package/src/layer/tile/TileLayer.js +44 -49
  268. package/src/layer/tile/WMSTileLayer.js +31 -26
  269. package/src/layer/vector/Canvas.js +13 -19
  270. package/src/layer/vector/Circle.js +9 -3
  271. package/src/layer/vector/CircleMarker.js +19 -7
  272. package/src/layer/vector/Path.DashAnimation.js +1 -2
  273. package/src/layer/vector/Path.js +30 -21
  274. package/src/layer/vector/Polygon.js +29 -6
  275. package/src/layer/vector/Polyline.js +26 -7
  276. package/src/layer/vector/Renderer.getRenderer.js +20 -19
  277. package/src/layer/vector/SVG.js +17 -7
  278. package/src/map/Map.Rotation.js +40 -8
  279. package/src/map/Map.js +158 -153
  280. package/src/map/handler/BoxZoomHandler.js +30 -50
  281. package/src/map/handler/DisplaceHandler.js +6 -8
  282. package/src/map/handler/DragHandler.js +25 -28
  283. package/src/map/handler/KeyboardHandler.js +65 -90
  284. package/src/map/handler/PinchZoomHandler.js +16 -5
  285. package/src/map/handler/ScrollWheelZoomHandler.js +6 -4
  286. package/src/map/handler/TapHoldHandler.js +15 -4
  287. package/src/map/index.js +1 -1
  288. package/src/maplair.css +153 -98
  289. package/dist/esm/core/Browser.js +0 -100
  290. package/dist/esm/core/Browser.js.map +0 -1
  291. package/dist/esm/geo/projection/Projection.LonLat.js.map +0 -1
  292. package/dist/esm/geo/projection/Projection.Mercator.js.map +0 -1
  293. package/dist/esm/geo/projection/Projection.SphericalMercator.js.map +0 -1
  294. package/dist/esm/geo/projection/index.js +0 -14
  295. package/dist/esm/geo/projection/index.js.map +0 -1
  296. package/dist/esm/layer/marker/Marker.Rotation.js +0 -70
  297. package/dist/esm/layer/marker/Marker.Rotation.js.map +0 -1
  298. package/dist/images/layers.svg +0 -1
  299. package/dist/images/marker-icon.svg +0 -1
  300. package/dist/images/marker-shadow.svg +0 -1
  301. package/src/core/Browser.js +0 -110
  302. package/src/images/layers.svg +0 -1
  303. package/src/images/marker-icon.svg +0 -1
  304. package/src/images/marker-shadow.svg +0 -1
  305. package/src/layer/marker/Marker.Rotation.js +0 -103
@@ -1 +1 @@
1
- {"version":3,"file":"Map.Rotation.js","names":["Browser","DomUtil.create","DomUtil.getPosition","DomUtil.getScale","PointerEvents.getPointers"],"sources":["../../../src/map/Map.Rotation.js"],"sourcesContent":["import {MaplairMap} from './Map.js';\nimport Browser from '../core/Browser.js';\nimport * as DomUtil from '../dom/DomUtil.js';\nimport * as DomEvent from '../dom/DomEvent.js';\nimport * as PointerEvents from '../dom/DomEvent.PointerEvents.js';\nimport {Draggable} from '../dom/Draggable.js';\nimport {Point} from '../geometry/Point.js';\nimport {Bounds} from '../geometry/Bounds.js';\nimport {BlanketOverlay} from '../layer/BlanketOverlay.js';\nimport {GridLayer} from '../layer/tile/GridLayer.js';\nimport {DivOverlay} from '../layer/DivOverlay.js';\nimport {Popup} from '../layer/Popup.js';\nimport {Tooltip} from '../layer/Tooltip.js';\nimport {Marker} from '../layer/marker/Marker.js';\nimport {MarkerDrag} from '../layer/marker/Marker.Drag.js';\nimport '../layer/marker/Marker.Rotation.js';\nimport {DragHandler} from './handler/DragHandler.js';\nimport {PinchZoomHandler} from './handler/PinchZoomHandler.js';\nimport {ScrollWheelZoomHandler} from './handler/ScrollWheelZoomHandler.js';\nimport {TapDragZoomHandler} from './handler/TapDragZoomHandler.js';\nimport {RotateControl} from '../control/RotateControl.js';\n/** @import {MaplairEvent} from '../core/Events.js' */\n/** @import {LatLng} from '../geo/LatLng.js' */\n/** @import {PointExpression} from '../geometry/Point.js' */\n/** @import {PanOptions, InvalidateSizeOptions} from './Map.js' */\n\nexport {RotateControl};\n\n// The bearing in degrees in the range [0, 360)\nfunction normalizeBearing(bearing) {\n\treturn ((Number(bearing) % 360) + 360) % 360;\n}\n\n// Rotates `point` clockwise (on the screen) by `degrees` around the origin\nfunction rotatePoint(point, degrees) {\n\tconst angle = degrees * Math.PI / 180,\n\tcos = Math.cos(angle),\n\tsin = Math.sin(angle);\n\treturn new Point(point.x * cos - point.y * sin, point.x * sin + point.y * cos);\n}\n\n// The maps of the rotated panes, see `Draggable`\nconst rotatedMaps = new WeakMap();\n\n// Possible size savings: about 60% of the code of this module (about 7–8 kB of\n// its 13 kB minified) are copies of core methods, which are overridden because\n// the rotation changes a computation in their middle:\n// * Popup#_adjustPan, MarkerDrag#_adjustPan, DragHandler#_onDragEnd: the offsets\n// for panBy() in container pixels (about 1.1–1.3 kB each)\n// * PinchZoomHandler#_onPointerMove (1.6 kB) and ScrollWheelZoomHandler#_panBy:\n// the rotation by two fingers, the pinch and pan offsets in the rotated frame\n// * MaplairMap#invalidateSize, #_tryAnimatedPan, #_continuousZoom, #getPixelBounds,\n// GridLayer#_getTiledPixelBounds, BlanketOverlay#_updateTransform, #_onMoveEnd,\n// #_resizeContainer, DivOverlay#_updatePosition, #_setContainerPosition,\n// Popup#_animateZoom: the bounding box of the rotated view, the upright overlays\n// Most of these copies could be replaced by small extension points in the core\n// classes, which this module overrides instead: e.g. MaplairMap#_rotateToPane(offset),\n// #_rotateToContainer(offset) and #_getViewSize() returning the offset or size\n// unchanged, used where the copied methods differ (well below 1 kB in core, for\n// all maps); or by splitting the core methods, so that the computations in\n// question become methods of their own (e.g. the pinch center from the offset of\n// the fingers, the inertia offset, the box of a popup in container pixels).\n// Both would change the pre-existing classes, which this module leaves untouched.\n\n// The methods extended below\nconst {panBy} = MaplairMap.prototype,\n{getEvents: getDivOverlayEvents} = DivOverlay.prototype,\n{_setPosition: setTooltipPosition} = Tooltip.prototype,\n{getEvents: getMarkerEvents} = Marker.prototype,\n{_onDown: onDraggableDown, _updatePosition: updateDraggablePosition} = Draggable.prototype,\n{_onPointerStart: onPinchStart} = PinchZoomHandler.prototype,\n{_onDown: onTapDragDown} = TapDragZoomHandler.prototype,\n{_pinchTo: pinchTo} = ScrollWheelZoomHandler.prototype;\n\n/**\n * Map options of the map rotation (`maplair/map-rotation`).\n * @typedef {object} RotationMapOptions\n * @lends MaplairMapOptions\n * @property {number} [bearing=0] Initial rotation of the map in degrees: the compass\n * direction pointing up, clockwise from north (e.g. `90` for east up), see\n * `setBearing()`.\n * @property {boolean} [pinchRotate=false] Whether the map can be rotated by turning two\n * fingers, see `setBearing()`.\n */\n\nMaplairMap.mergeOptions({\n\tbearing: 0,\n\tpinchRotate: false\n});\n\nMaplairMap.addInitHook(function () {\n\tif (this.options.bearing || this.options.pinchRotate || this.options.rotateControl) {\n\t\tthis._rotate(this.options.bearing);\n\t\tif (this._loaded) {\n\t\t\tthis.fire('moveend');\n\t\t}\n\t}\n});\n\nRotateControl.register(MaplairMap);\n\n/**\n * Methods of `MaplairMap` for the map rotation. The rotation of the map is an optional\n * feature: import this module (`maplair/map-rotation`) to add the `bearing`,\n * `pinchRotate` and `rotateControl` options, `setBearing()`, `getBearing()` and the\n * `rotate` event to `MaplairMap`, and the `RotateControl`. Maps not using it don't\n * contain its code.\n *\n * The map pane is wrapped in a pane rotated around the center of the container.\n * Container/layer point conversions, `getPixelBounds()` and `getBounds()` account\n * for the rotation; grid layers and vector renderers cover the bounding box of\n * the rotated view; markers, popups and tooltips stay upright (see the Marker\n * option `rotateWithView`); dragging, `panBy()`, the keyboard, pinch, tap-drag,\n * touchpad and continuous zoom work in container pixels.\n *\n * @example\n * ```js\n * import {MaplairMap} from 'maplair';\n * import {RotateControl} from 'maplair/map-rotation';\n *\n * const map = new MaplairMap('map', {bearing: 30, pinchRotate: true, rotateControl: true});\n * ```\n *\n * @lends MaplairMap.prototype\n * @fires MaplairMap#rotate {MaplairEvent} Fired when the bearing of the map changes,\n * see `setBearing()`.\n */\nconst mapRotationMethods = {\n\t/**\n\t * Rotates the map around the center of the view, so that the compass direction\n\t * `bearing` (in degrees, clockwise from north) points up. Markers, popups and\n\t * tooltips stay upright. With `{animate: true}`, the map rotates smoothly (the\n\t * shorter way round).\n\t * @group Map rotation\n\t * @param {number} bearing\n\t * @param {{animate?: boolean}} [options]\n\t * @returns {this}\n\t */\n\tsetBearing(bearing, options) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tconst from = this.getBearing();\n\t\tif (!this._rotatePane && !bearing) { return this; }\n\t\tif (bearing === from) { return this; }\n\n\t\tthis._stop();\n\t\tif (!options?.animate || !this._loaded || Browser.reducedMotion) {\n\t\t\tthis._rotate(bearing);\n\t\t\treturn this._loaded ? this.fire('movestart').fire('move').fire('moveend') : this;\n\t\t}\n\n\t\t// the shorter way round\n\t\tconst delta = ((bearing - from + 540) % 360) - 180,\n\t\tstart = performance.now(),\n\t\tduration = 250;\n\t\tthis.fire('movestart');\n\t\tconst frame = () => {\n\t\t\tconst t = Math.min(1, (performance.now() - start) / duration);\n\t\t\tthis._rotate(from + delta * (1 - (1 - t) ** 2));\n\t\t\tthis.fire('move');\n\t\t\tif (t < 1) {\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.fire('moveend');\n\t\t\t}\n\t\t};\n\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\treturn this;\n\t},\n\n\t// Applies the bearing without the events of a view change (e.g. while pinching)\n\t_rotate(bearing) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tif (!this._rotatePane) {\n\t\t\t// the map pane is wrapped in a pane rotated around the center of the container\n\t\t\tconst rotatePane = this._rotatePane = DomUtil.create('div', 'maplair-rotate-pane');\n\t\t\trotatedMaps.set(rotatePane, this);\n\t\t\tthis._container.insertBefore(rotatePane, this._mapPane);\n\t\t\trotatePane.appendChild(this._mapPane);\n\t\t}\n\t\tif (bearing === this.getBearing()) { return; }\n\n\t\tthis._bearing = bearing;\n\t\tthis._rotatePane.style.transform = bearing ? `rotate(${-bearing}deg)` : '';\n\n\t\tif (this._loaded) {\n\t\t\tthis.fire('rotate');\n\t\t}\n\t},\n\n\t/**\n\t * Returns the rotation of the map, see `setBearing()`.\n\t * @group Map rotation\n\t * @returns {number}\n\t */\n\tgetBearing() {\n\t\treturn this._bearing ?? 0;\n\t},\n\n\t// Rotates an offset in container (screen) pixels to the frame of the rotated map pane\n\t_rotateToPane(point) {\n\t\treturn this._bearing ? rotatePoint(point, this._bearing) : point;\n\t},\n\n\t// Rotates an offset in the frame of the rotated map pane to container (screen) pixels\n\t_rotateToContainer(point) {\n\t\treturn this._bearing ? rotatePoint(point, -this._bearing) : point;\n\t},\n\n\t// The size of the bounding box of the rotated view, in pixels of the map pane\n\t_getViewSize() {\n\t\tconst size = this.getSize();\n\t\tif (!this._bearing) { return size; }\n\t\tconst angle = this._bearing * Math.PI / 180,\n\t\tcos = Math.abs(Math.cos(angle)),\n\t\tsin = Math.abs(Math.sin(angle));\n\t\treturn new Point(size.x * cos + size.y * sin, size.x * sin + size.y * cos);\n\t},\n\n\t// Counter-rotates `el` (positioned with `DomUtil.setPosition()`) around its CSS\n\t// `transformOrigin`, so that it stays upright on a rotated map.\n\t_rotateUpright(el, transformOrigin) {\n\t\tif (this._bearing) {\n\t\t\tel.style.transform += ` rotate(${this._bearing}deg)`;\n\t\t\tel.style.transformOrigin = transformOrigin;\n\t\t} else if (el.style.transformOrigin) {\n\t\t\tel.style.transformOrigin = '';\n\t\t}\n\t},\n\n\t/**\n\t * Overrides `containerPointToLayerPoint()` of `MaplairMap` (documented there) to\n\t * account for the rotation.\n\t * @internal\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tcontainerPointToLayerPoint(point) { // (Point)\n\t\tpoint = Point.from(point);\n\t\tif (this._bearing) {\n\t\t\t// the map pane is rotated around the center of the container\n\t\t\tconst center = this.getSize()._divideBy(2);\n\t\t\tpoint = this._rotateToPane(point.subtract(center))._add(center);\n\t\t}\n\t\treturn point.subtract(this._getMapPanePos());\n\t},\n\n\t/**\n\t * Overrides `layerPointToContainerPoint()` of `MaplairMap` (documented there) to\n\t * account for the rotation.\n\t * @internal\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tlayerPointToContainerPoint(point) { // (Point)\n\t\tpoint = Point.from(point).add(this._getMapPanePos());\n\t\tif (this._bearing) {\n\t\t\tconst center = this.getSize()._divideBy(2);\n\t\t\tpoint = this._rotateToContainer(point.subtract(center))._add(center);\n\t\t}\n\t\treturn point;\n\t},\n\n\t/**\n\t * Overrides `getPixelBounds()` of `MaplairMap` (documented there): the bounding box\n\t * of the rotated view.\n\t * @internal\n\t * @param {LatLng} [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\tif (!this._bearing) {\n\t\t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\n\t\t}\n\t\t// the bounding box of the rotated view\n\t\tconst pixelCenter = topLeftPoint.add(this.getSize()._divideBy(2)),\n\t\thalf = this._getViewSize()._divideBy(2);\n\t\treturn new Bounds(pixelCenter.subtract(half), pixelCenter.add(half));\n\t},\n\n\t/**\n\t * Overrides `panBy()` of `MaplairMap` (documented there): `panBy()` takes offsets in\n\t * container pixels, the map pane moves in its rotated frame.\n\t * @internal\n\t * @param {PointExpression} offset\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanBy(offset, options) {\n\t\treturn panBy.call(this, this._rotateToPane(Point.from(offset)), options);\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._rotateToContainer(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/**\n\t * Overrides `invalidateSize()` of `MaplairMap` (documented there) to pan in container\n\t * pixels.\n\t * @internal\n\t * @param {boolean|InvalidateSizeOptions} [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(this._rotateToContainer(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// 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.layerPointToLatLng(this._getCenterLayerPoint().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/** @typedef {typeof mapRotationMethods} MapRotationMethods */\n\nMaplairMap.include(mapRotationMethods);\n\n/**\n * Methods of `GridLayer` for the map rotation: the tiles cover the bounding box of the\n * rotated view.\n * @lends GridLayer.prototype\n */\nconst gridLayerRotationMethods = {\n\t_getTiledPixelBounds(center) {\n\t\tconst map = this._map,\n\t\tmapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(),\n\t\tscale = map.getZoomScale(mapZoom, this._tileZoom),\n\t\tpixelCenter = map.project(center, this._tileZoom).floor(),\n\t\thalfSize = map._getViewSize().divideBy(scale * 2);\n\n\t\treturn new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));\n\t}\n};\n/** @typedef {typeof gridLayerRotationMethods} GridLayerMapRotationMethods */\n\nGridLayer.include(gridLayerRotationMethods);\n\n/**\n * Methods of `BlanketOverlay` for the map rotation: the overlay covers the bounding\n * box of the rotated view.\n * @lends BlanketOverlay.prototype\n */\nconst blanketOverlayRotationMethods = {\n\t_updateTransform(center, zoom) {\n\t\tconst scale = this._map.getZoomScale(zoom, this._zoom),\n\t\tviewHalf = this._map._getViewSize().multiplyBy(0.5 + this.options.padding),\n\t\tcurrentCenterPoint = this._map.project(this._center, zoom),\n\t\ttopLeftOffset = viewHalf.multiplyBy(-scale)._add(currentCenterPoint)\n\t\t\t._subtract(this._map._getNewPixelOrigin(center, zoom))\n\t\t\t._round();\n\n\t\tDomUtil.setTransform(this._container, topLeftOffset, scale);\n\t},\n\n\t_onMoveEnd(ev) {\n\t\t// Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n\t\t// the bounding box of the (possibly rotated) view, extended by the padding\n\t\tconst p = this.options.padding,\n\t\tsize = this._map._getViewSize();\n\t\tif (!size.multiplyBy(1 + p * 2).round().equals(this._containerSize)) {\n\t\t\t// e.g. after rotating the map\n\t\t\tthis._resizeContainer();\n\t\t}\n\t\tconst min = this._map._getCenterLayerPoint().subtract(size.multiplyBy(0.5 + p)).round();\n\n\t\tthis._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());\n\n\t\tthis._center = this._map.getCenter();\n\t\tthis._zoom = this._map.getZoom();\n\t\tthis._updateTransform(this._center, this._zoom);\n\n\t\tthis._onSettled(ev);\n\t},\n\n\t_resizeContainer() {\n\t\tconst p = this.options.padding,\n\t\tsize = this._containerSize = this._map._getViewSize().multiplyBy(1 + p * 2).round();\n\t\tthis._container.style.width = `${size.x}px`;\n\t\tthis._container.style.height = `${size.y}px`;\n\t\treturn size;\n\t}\n};\n/** @typedef {typeof blanketOverlayRotationMethods} BlanketOverlayMapRotationMethods */\n\nBlanketOverlay.include(blanketOverlayRotationMethods);\n\n/**\n * Methods of `DivOverlay` for the map rotation: the overlays stay upright.\n * @lends DivOverlay.prototype\n */\nconst divOverlayRotationMethods = {\n\t/**\n\t * Overrides `getEvents()` of `DivOverlay` to update the position on rotation.\n\t * @internal\n\t * @returns {Record<string, Function>}\n\t */\n\tgetEvents() {\n\t\treturn {...getDivOverlayEvents.call(this), rotate: this._updatePosition};\n\t},\n\n\t_updatePosition() {\n\t\tif (!this._map) { return; }\n\n\t\tconst map = this._map,\n\t\tpos = map.latLngToLayerPoint(this._latlng),\n\t\t// on a rotated map, the anchor is relative to the upright overlay\n\t\tanchor = map._rotateToPane(new Point(this._getAnchor()));\n\t\tlet offset = Point.from(this.options.offset);\n\n\t\tconst transformed = this._zoomAnimated || this.options.overflow || map._bearing;\n\t\tif (!transformed) {\n\t\t\toffset = offset.add(pos).add(anchor);\n\t\t}\n\n\t\tconst bottom = this._containerBottom = -offset.y,\n\t\tleft = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;\n\n\t\t// bottom position the overlay in case the height of the overlay changes (images loading etc)\n\t\tif (this.options.overflow) {\n\t\t\t// relative to the top of the viewport instead of the pane origin\n\t\t\tthis._container.style.top = 'auto';\n\t\t\tthis._container.style.bottom = `calc(100% + ${bottom}px)`;\n\t\t} else {\n\t\t\tthis._container.style.bottom = `${bottom}px`;\n\t\t}\n\t\tthis._container.style.left = `${left}px`;\n\n\t\tif (transformed) {\n\t\t\t// upright around the anchored point (below the bottom margin, see `Popup`)\n\t\t\tthis._setContainerPosition(pos.add(anchor), `${-left}px calc(100% + ${bottom + (this._containerMarginBottom ?? 0)}px)`);\n\t\t}\n\t},\n\n\t// Positions the container at the given layer point. An overflowing overlay\n\t// lives in the top layer of the page, so it is positioned in viewport coordinates.\n\t// `transformOrigin` is the point around which the container is kept upright on a rotated map.\n\t_setContainerPosition(pos, transformOrigin) {\n\t\tthis._containerPos = pos;\n\t\tif (this.options.overflow) {\n\t\t\tconst mapContainer = this._map._container,\n\t\t\trect = mapContainer.getBoundingClientRect();\n\t\t\tpos = this._map.layerPointToContainerPoint(pos)\n\t\t\t\t._add(new Point(rect.left + mapContainer.clientLeft, rect.top + mapContainer.clientTop));\n\t\t}\n\t\tDomUtil.setPosition(this._container, pos);\n\t\tif (!this.options.overflow) {\n\t\t\tthis._map._rotateUpright(this._container, transformOrigin);\n\t\t}\n\t}\n};\n/** @typedef {typeof divOverlayRotationMethods} DivOverlayMapRotationMethods */\n\nDivOverlay.include(divOverlayRotationMethods);\n\n/**\n * Methods of `Popup` for the map rotation: the popup stays upright, autopanning in\n * container pixels.\n * @lends Popup.prototype\n */\nconst popupRotationMethods = {\n\t_animateZoom(e) {\n\t\tconst pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),\n\t\tanchor = this._map._rotateToPane(new Point(this._getAnchor()));\n\t\tthis._setContainerPosition(pos.add(anchor), this._container.style.transformOrigin);\n\t},\n\n\t_adjustPan() {\n\t\tif (!this.options.autoPan) { return; }\n\t\tthis._map._panAnim?.stop();\n\n\t\t// We can endlessly recurse if keepInView is set and the view resets.\n\t\t// Let's guard against that by exiting early if we're responding to our own autopan.\n\t\tif (this._autopanning) {\n\t\t\tthis._autopanning = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst map = this._map,\n\t\tmarginBottom = this._containerMarginBottom ?? (parseInt(getComputedStyle(this._container).marginBottom, 10) || 0),\n\t\tcontainerHeight = this._containerHeight + marginBottom,\n\t\tcontainerWidth = this._containerWidth,\n\t\t// the top left corner, relative to the (upright) anchored point\n\t\ttopLeft = new Point(this._containerLeft, -containerHeight - this._containerBottom);\n\n\t\tconst containerPos = map.layerPointToContainerPoint(this._getContainerPosition())._add(topLeft),\n\t\tpadding = Point.from(this.options.autoPanPadding),\n\t\tpaddingTL = Point.from(this.options.autoPanPaddingTopLeft ?? padding),\n\t\tpaddingBR = Point.from(this.options.autoPanPaddingBottomRight ?? padding),\n\t\tsize = map.getSize();\n\t\tlet dx = 0,\n\t\tdy = 0;\n\n\t\tif (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\n\t\t\tdx = containerPos.x + containerWidth - size.x + paddingBR.x;\n\t\t}\n\t\tif (containerPos.x - dx - paddingTL.x < 0) { // left\n\t\t\tdx = containerPos.x - paddingTL.x;\n\t\t}\n\t\tif (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\n\t\t\tdy = containerPos.y + containerHeight - size.y + paddingBR.y;\n\t\t}\n\t\tif (containerPos.y - dy - paddingTL.y < 0) { // top\n\t\t\tdy = containerPos.y - paddingTL.y;\n\t\t}\n\n\t\t// see the `autopanstart` event of `Popup`\n\t\tif (dx || dy) {\n\t\t\t// Track that we're autopanning, as this function will be re-ran on moveend\n\t\t\tif (this.options.keepInView) {\n\t\t\t\tthis._autopanning = true;\n\t\t\t}\n\n\t\t\tmap\n\t\t\t\t.fire('autopanstart')\n\t\t\t\t.panBy([dx, dy]);\n\t\t}\n\t}\n};\n/** @typedef {typeof popupRotationMethods} PopupMapRotationMethods */\n\nPopup.include(popupRotationMethods);\n\n// The margins of the directions, see `.maplair-tooltip-top` etc. in maplair.css\nconst tooltipMargins = {\n\ttop: [0, -6],\n\tbottom: [0, 6],\n\tleft: [-6, 0],\n\tright: [6, 0]\n};\n\n/**\n * Methods of `Tooltip` for the map rotation: the tooltip stays upright.\n * @lends Tooltip.prototype\n */\nconst tooltipRotationMethods = {\n\t// On a rotated map, the tooltip is positioned at its source and kept upright\n\t// around it (taking the margin of the direction into account)\n\t_setPosition(pos) {\n\t\tsetTooltipPosition.call(this, pos);\n\t\tconst container = this._container;\n\t\tif (this.options.overflow) { return; }\n\t\tif (!this._map._bearing) {\n\t\t\tcontainer.style.left = container.style.top = '';\n\t\t\treturn;\n\t\t}\n\t\tconst delta = this._containerPos.subtract(pos),\n\t\tdirection = Object.keys(tooltipMargins).find(d => container.classList.contains(`maplair-tooltip-${d}`)),\n\t\tmargin = tooltipMargins[direction] ?? [0, 0];\n\t\tcontainer.style.left = `${delta.x}px`;\n\t\tcontainer.style.top = `${delta.y}px`;\n\t\tthis._setContainerPosition(pos, `${-delta.x - margin[0]}px ${-delta.y - margin[1]}px`);\n\t}\n};\n/** @typedef {typeof tooltipRotationMethods} TooltipMapRotationMethods */\n\nTooltip.include(tooltipRotationMethods);\n\n/**\n * Methods of `Marker` for the map rotation: the marker is updated on rotation.\n * @lends Marker.prototype\n */\nconst markerRotationMethods = {\n\t/**\n\t * Overrides `getEvents()` of `Marker` to update the marker on rotation.\n\t * @internal\n\t * @returns {Record<string, Function>}\n\t */\n\tgetEvents() {\n\t\treturn {...getMarkerEvents.call(this), rotate: this.update};\n\t}\n};\n/** @typedef {typeof markerRotationMethods} MarkerMapRotationMethods */\n\nMarker.include(markerRotationMethods);\n\n/**\n * Methods of `MarkerDrag` for the map rotation: autopanning in container pixels.\n * @lends MarkerDrag.prototype\n */\nconst markerDragRotationMethods = {\n\t_adjustPan(e) {\n\t\tconst marker = this._marker,\n\t\tmap = marker._map,\n\t\tspeed = this._marker.options.autoPanSpeed,\n\t\tpadding = this._marker.options.autoPanPadding,\n\t\ticonPos = DomUtil.getPosition(marker._icon),\n\t\tbounds = map.getPixelBounds(),\n\t\torigin = map.getPixelOrigin();\n\n\t\tconst panBounds = new Bounds(\n\t\t\tbounds.min._subtract(origin).add(padding),\n\t\t\tbounds.max._subtract(origin).subtract(padding)\n\t\t);\n\n\t\tif (!panBounds.contains(iconPos)) {\n\t\t\t// Compute incremental movement\n\t\t\tconst movement = new Point(\n\t\t\t\t(Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -\n\t\t\t\t\t(Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),\n\n\t\t\t\t(Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -\n\t\t\t\t\t(Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)\n\t\t\t).multiplyBy(speed);\n\n\t\t\tmap.panBy(map._rotateToContainer(movement), {animate: false});\n\n\t\t\tthis._draggable._newPos._add(movement);\n\t\t\tthis._draggable._startPos._add(movement);\n\n\t\t\tDomUtil.setPosition(marker._icon, this._draggable._newPos);\n\t\t\tthis._onDrag(e);\n\n\t\t\tthis._panRequest = requestAnimationFrame(this._adjustPan.bind(this, e));\n\t\t}\n\t}\n};\n/** @typedef {typeof markerDragRotationMethods} MarkerDragMapRotationMethods */\n\nMarkerDrag.include(markerDragRotationMethods);\n\n/**\n * Methods of `Draggable` for the map rotation: dragging in the rotated frame of the\n * map pane.\n * @lends Draggable.prototype\n */\nconst draggableRotationMethods = {\n\t_onDown(e) {\n\t\tonDraggableDown.call(this, e);\n\t\t// on a rotated map, the element moves in the rotated frame of the map pane,\n\t\t// and the rotated pane is scaled by its bounding box (see `DomUtil.getScale()`)\n\t\tconst rotatePane = this._element.closest?.('.maplair-rotate-pane');\n\t\tthis._rotatedMap = rotatePane && rotatedMaps.get(rotatePane);\n\t\tif (this._rotatedMap && this._parentScale) {\n\t\t\tthis._parentScale = DomUtil.getScale(rotatePane.parentNode);\n\t\t}\n\t},\n\n\t_updatePosition() {\n\t\tconst map = this._rotatedMap;\n\t\tif (map?._bearing) {\n\t\t\tthis._newPos = this._startPos.add(map._rotateToPane(this._newPos.subtract(this._startPos)));\n\t\t}\n\t\tupdateDraggablePosition.call(this);\n\t}\n};\n/** @typedef {typeof draggableRotationMethods} DraggableMapRotationMethods */\n\nDraggable.include(draggableRotationMethods);\n\n/**\n * Methods of `DragHandler` for the map rotation: the inertia in container pixels.\n * @lends DragHandler.prototype\n */\nconst dragHandlerRotationMethods = {\n\t_onDragEnd(e) {\n\t\tconst map = this._map,\n\t\toptions = map.options,\n\n\t\tnoInertia = !options.inertia || e.noInertia || this._times.length < 2;\n\n\t\tmap.fire('dragend', e);\n\n\t\tif (noInertia) {\n\t\t\tmap.fire('moveend');\n\n\t\t} else {\n\t\t\tthis._prunePositions(Date.now());\n\n\t\t\tconst direction = this._lastPos.subtract(this._positions[0]),\n\t\t\tduration = (this._lastTime - this._times[0]) / 1000,\n\t\t\tease = options.easeLinearity,\n\n\t\t\tspeedVector = direction.multiplyBy(ease / duration),\n\t\t\tspeed = speedVector.distanceTo([0, 0]),\n\n\t\t\tlimitedSpeed = Math.min(options.inertiaMaxSpeed, speed),\n\t\t\tlimitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed),\n\n\t\t\tdecelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease);\n\t\t\tlet offset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();\n\n\t\t\tif (!offset.x && !offset.y) {\n\t\t\t\tmap.fire('moveend');\n\n\t\t\t} else {\n\t\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t// the offset of the map pane, `panBy()` takes container pixels\n\t\t\t\t\tmap.panBy(map._rotateToContainer(offset), {\n\t\t\t\t\t\tduration: decelerationDuration,\n\t\t\t\t\t\teaseLinearity: ease,\n\t\t\t\t\t\tnoMoveStart: true,\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n};\n/** @typedef {typeof dragHandlerRotationMethods} DragHandlerMapRotationMethods */\n\nDragHandler.include(dragHandlerRotationMethods);\n\n// The time (ms) without further wheel events after which a touchpad pan ends, see `ScrollWheelZoomHandler`\nconst gestureEndDelay = 150;\n\n// The angle (degrees) the fingers have to turn before the map starts rotating\nconst rotateThreshold = 15;\n\nfunction angleOf(p1, p2) {\n\treturn Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI;\n}\n\n/**\n * Methods of `PinchZoomHandler` for the map rotation: rotating by turning two fingers\n * (see the map option `pinchRotate`), pinching in the rotated frame.\n * @lends PinchZoomHandler.prototype\n */\nconst pinchZoomHandlerRotationMethods = {\n\t_onPointerStart(e) {\n\t\tonPinchStart.call(this, e);\n\t\tconst pointers = PointerEvents.getPointers();\n\t\tif (this._zooming && pointers.length === 2) {\n\t\t\tthis._startAngle = angleOf(...pointers.map(p => this._map.pointerEventToContainerPoint(p)));\n\t\t\tthis._startBearing = this._map.getBearing();\n\t\t\tthis._rotating = false;\n\t\t}\n\t},\n\n\t_onPointerMove(e) {\n\t\tconst pointers = PointerEvents.getPointers();\n\t\tif (pointers.length !== 2 || !this._zooming) { return; }\n\n\t\tconst map = this._map,\n\t\tp1 = map.pointerEventToContainerPoint(pointers[0]),\n\t\tp2 = map.pointerEventToContainerPoint(pointers[1]),\n\t\tscale = p1.distanceTo(p2) / this._startDist;\n\n\t\tthis._zoom = map.getScaleZoom(scale, this._startZoom);\n\n\t\tif (map.options.pinchRotate) {\n\t\t\tconst angle = angleOf(p1, p2);\n\t\t\tlet delta = ((angle - this._startAngle + 540) % 360) - 180;\n\t\t\tif (!this._rotating && Math.abs(delta) > rotateThreshold) {\n\t\t\t\t// start rotating from the threshold on, without a jump\n\t\t\t\tthis._rotating = true;\n\t\t\t\tthis._startAngle += Math.sign(delta) * rotateThreshold;\n\t\t\t\tdelta -= Math.sign(delta) * rotateThreshold;\n\t\t\t}\n\t\t\tif (this._rotating) {\n\t\t\t\t// turning the fingers clockwise turns the map clockwise\n\t\t\t\tmap._rotate(this._startBearing - delta);\n\t\t\t}\n\t\t}\n\n\t\tif (!map.options.bounceAtZoomLimits && (\n\t\t\t(this._zoom < map.getMinZoom() && scale < 1) ||\n\t\t\t\t(this._zoom > map.getMaxZoom() && scale > 1))) {\n\t\t\tthis._zoom = map._limitZoom(this._zoom);\n\t\t}\n\n\t\tif (map.options.pinchZoom === 'center') {\n\t\t\tthis._center = this._startLatLng;\n\t\t\tif (scale === 1 && !this._rotating) { return; }\n\t\t} else {\n\t\t\t// Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng\n\t\t\tconst delta = map._rotateToPane(p1._add(p2)._divideBy(2)._subtract(this._centerPoint));\n\t\t\tif (scale === 1 && delta.x === 0 && delta.y === 0 && !this._rotating) { return; }\n\t\t\tthis._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom);\n\t\t}\n\n\t\tif (!this._moved) {\n\t\t\tmap._setUserEvent(e);\n\t\t\tmap._moveStart(true, false);\n\t\t\tthis._moved = true;\n\t\t}\n\n\t\tcancelAnimationFrame(this._animRequest);\n\n\t\tconst moveFn = map._move.bind(map, this._center, this._zoom, {pinch: true, round: false}, undefined);\n\t\tthis._animRequest = requestAnimationFrame(moveFn.bind(this));\n\n\t\te.preventDefault();\n\t}\n};\n/** @typedef {typeof pinchZoomHandlerRotationMethods} PinchZoomHandlerMapRotationMethods */\n\nPinchZoomHandler.include(pinchZoomHandlerRotationMethods);\n\n/**\n * Methods of `TapDragZoomHandler` for the map rotation: the zoom origin in the rotated\n * frame.\n * @lends TapDragZoomHandler.prototype\n */\nconst tapDragZoomHandlerRotationMethods = {\n\t_onDown(e) {\n\t\tonTapDragDown.call(this, e);\n\t\t// the offset of the zoom origin in the rotated frame of the map pane\n\t\tif (this._zooming && this._aroundOffset) {\n\t\t\tthis._aroundOffset = this._map._rotateToPane(this._aroundOffset);\n\t\t}\n\t}\n};\n/** @typedef {typeof tapDragZoomHandlerRotationMethods} TapDragZoomHandlerMapRotationMethods */\n\nTapDragZoomHandler.include(tapDragZoomHandlerRotationMethods);\n\n/**\n * Methods of `ScrollWheelZoomHandler` for the map rotation: zooming and panning in the\n * rotated frame.\n * @lends ScrollWheelZoomHandler.prototype\n */\nconst scrollWheelZoomHandlerRotationMethods = {\n\t_pinchTo(e, zoom, eased) {\n\t\tpinchTo.call(this, e, zoom, eased);\n\t\t// the offset of the zoom origin in the rotated frame of the map pane\n\t\tif (this._pinch && !this._pinch.rotated) {\n\t\t\tthis._pinch.offset = this._map._rotateToPane(this._pinch.offset);\n\t\t\tthis._pinch.rotated = true;\n\t\t}\n\t},\n\n\t// Pans the map by the wheel deltas, as by scrolling with two fingers on a touchpad.\n\t_panBy(e) {\n\t\tDomEvent.stop(e);\n\t\tconst map = this._map;\n\t\tif (map._animatingZoom) { return; }\n\n\t\tconst factor = e.deltaMode === 1 ? 20 : e.deltaMode === 2 ? 60 : 1;\n\t\tlet offset = new Point(e.deltaX * factor, e.deltaY * factor);\n\t\tif (e.shiftKey && !e.deltaX) {\n\t\t\t// Shift with a mouse wheel scrolls horizontally\n\t\t\toffset = new Point(offset.y, 0);\n\t\t}\n\t\t// in the rotated frame of the map pane\n\t\toffset = map._rotateToPane(offset);\n\t\tif (map.options.maxBounds) {\n\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\t\t}\n\n\t\tif (!this._panning) {\n\t\t\tmap._stop();\n\t\t\tthis._panning = true;\n\t\t\tmap._setUserEvent(e);\n\t\t\tmap.fire('movestart');\n\t\t}\n\t\tmap._rawPanBy(offset.round());\n\t\tmap.fire('move');\n\n\t\tclearTimeout(this._panTimer);\n\t\tthis._panTimer = setTimeout(this._endPan.bind(this), gestureEndDelay);\n\t}\n};\n/** @typedef {typeof scrollWheelZoomHandlerRotationMethods} ScrollWheelZoomHandlerMapRotationMethods */\n\nScrollWheelZoomHandler.include(scrollWheelZoomHandlerRotationMethods);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA6BA,SAAS,iBAAiB,SAAS;CAClC,QAAS,OAAO,OAAO,IAAI,MAAO,OAAO;AAC1C;AAGA,SAAS,YAAY,OAAO,SAAS;CACpC,MAAM,QAAQ,UAAU,KAAK,KAAK,KAClC,MAAM,KAAK,IAAI,KAAK,GACpB,MAAM,KAAK,IAAI,KAAK;CACpB,OAAO,IAAI,MAAM,MAAM,IAAI,MAAM,MAAM,IAAI,KAAK,MAAM,IAAI,MAAM,MAAM,IAAI,GAAG;AAC9E;AAGA,MAAM,8BAAc,IAAI,QAAQ;AAuBhC,MAAM,EAAC,UAAS,WAAW,WAC3B,EAAC,WAAW,wBAAuB,WAAW,WAC9C,EAAC,cAAc,uBAAsB,QAAQ,WAC7C,EAAC,WAAW,oBAAmB,OAAO,WACtC,EAAC,SAAS,iBAAiB,iBAAiB,4BAA2B,UAAU,WACjF,EAAC,iBAAiB,iBAAgB,iBAAiB,WACnD,EAAC,SAAS,kBAAiB,mBAAmB,WAC9C,EAAC,UAAU,YAAW,uBAAuB;;;;;;;;;;;AAa7C,WAAW,aAAa;CACvB,SAAS;CACT,aAAa;AACd,CAAC;AAED,WAAW,YAAY,WAAY;CAClC,IAAI,KAAK,QAAQ,WAAW,KAAK,QAAQ,eAAe,KAAK,QAAQ,eAAe;EACnF,KAAK,QAAQ,KAAK,QAAQ,OAAO;EACjC,IAAI,KAAK,SACR,KAAK,KAAK,S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jE,EAI0D,CAAC;;AAkD5D,uBAAuB,QAAQ;CA1C9B,SAAS,GAAG,MAAM,OAAO;EACxB,QAAQ,KAAK,MAAM,GAAG,MAAM,KAAK;EAEjC,IAAI,KAAK,UAAU,CAAC,KAAK,OAAO,SAAS;GACxC,KAAK,OAAO,SAAS,KAAK,KAAK,cAAc,KAAK,OAAO,MAAM;GAC/D,KAAK,OAAO,UAAU;EACvB;CACD;CAGA,OAAO,GAAG;EACT,KAAc,CAAC;EACf,MAAM,MAAM,KAAK;EACjB,IAAI,IAAI,gBAAkB;EAE1B,MAAM,SAAS,EAAE,cAAc,IAAI,KAAK,EAAE,cAAc,IAAI,KAAK;EACjE,IAAI,SAAS,IAAI,MAAM,EAAE,SAAS,QAAQ,EAAE,SAAS,MAAM;EAC3D,IAAI,EAAE,YAAY,CAAC,EAAE,QAEpB,SAAS,IAAI,MAAM,OAAO,GAAG,CAAC;EAG/B,SAAS,IAAI,cAAc,MAAM;EACjC,IAAI,IAAI,QAAQ,WACf,SAAS,IAAI,aAAa,QAAQ,IAAI,QAAQ,SAAS;EAGxD,IAAI,CAAC,KAAK,UAAU;GACnB,IAAI,MAAM;GACV,KAAK,WAAW;GAChB,IAAI,cAAc,CAAC;GACnB,IAAI,KAAK,WAAW;EACrB;EACA,IAAI,UAAU,OAAO,MAAM,CAAC;EAC5B,IAAI,KAAK,MAAM;EAEf,aAAa,KAAK,SAAS;EAC3B,KAAK,YAAY,WAAW,KAAK,QAAQ,KAAK,IAAI,GAAG,eAAe;CACrE;AAIkE,CAAC"}
1
+ {"version":3,"file":"Map.Rotation.js","names":["DomUtil.create","DomUtil.getPosition","DomUtil.getScale","PointerEvents.getPointers"],"sources":["../../../src/map/Map.Rotation.js"],"sourcesContent":["import {MaplairMap} from './Map.js';\nimport * as DomUtil from '../dom/DomUtil.js';\nimport * as DomEvent from '../dom/DomEvent.js';\nimport * as PointerEvents from '../dom/DomEvent.PointerEvents.js';\nimport {Draggable} from '../dom/Draggable.js';\nimport {Point} from '../geometry/Point.js';\nimport {Bounds} from '../geometry/Bounds.js';\nimport {BlanketOverlay} from '../layer/BlanketOverlay.js';\nimport {GridLayer} from '../layer/tile/GridLayer.js';\nimport {DivOverlay} from '../layer/DivOverlay.js';\nimport {Popup} from '../layer/Popup.js';\nimport {Tooltip} from '../layer/Tooltip.js';\nimport {Marker} from '../layer/marker/Marker.js';\nimport {MarkerDrag} from '../layer/marker/Marker.Drag.js';\nimport {DragHandler} from './handler/DragHandler.js';\nimport {PinchZoomHandler} from './handler/PinchZoomHandler.js';\nimport {ScrollWheelZoomHandler} from './handler/ScrollWheelZoomHandler.js';\nimport {TapDragZoomHandler} from './handler/TapDragZoomHandler.js';\nimport {RotateControl} from '../control/RotateControl.js';\n/** @import {MaplairEvent} from '../core/Events.js' */\n/** @import {LatLng} from '../geo/LatLng.js' */\n/** @import {PointExpression} from '../geometry/Point.js' */\n/** @import {PanOptions, InvalidateSizeOptions} from './Map.js' */\n\nexport {RotateControl};\n\n// The bearing in degrees in the range [0, 360)\nfunction normalizeBearing(bearing) {\n\treturn ((Number(bearing) % 360) + 360) % 360;\n}\n\n// Rotates `point` clockwise (on the screen) by `degrees` around the origin\nfunction rotatePoint(point, degrees) {\n\tconst angle = degrees * Math.PI / 180,\n\tcos = Math.cos(angle),\n\tsin = Math.sin(angle);\n\treturn new Point(point.x * cos - point.y * sin, point.x * sin + point.y * cos);\n}\n\n// The maps of the rotated panes, see `Draggable`\nconst rotatedMaps = new WeakMap();\n\n// Possible size savings: about 60% of the code of this module (about 7–8 kB of\n// its 13 kB minified) are copies of core methods, which are overridden because\n// the rotation changes a computation in their middle:\n// * Popup#_adjustPan, MarkerDrag#_adjustPan, DragHandler#_onDragEnd: the offsets\n// for panBy() in container pixels (about 1.1–1.3 kB each)\n// * PinchZoomHandler#_onPointerMove (1.6 kB) and ScrollWheelZoomHandler#_panBy:\n// the rotation by two fingers, the pinch and pan offsets in the rotated frame\n// * MaplairMap#invalidateSize, #_tryAnimatedPan, #_continuousZoom, #getPixelBounds,\n// GridLayer#_getTiledPixelBounds, BlanketOverlay#_updateTransform, #_onMoveEnd,\n// #_resizeContainer, DivOverlay#_updatePosition, #_setContainerPosition,\n// Popup#_animateZoom: the bounding box of the rotated view, the upright overlays\n// Most of these copies could be replaced by small extension points in the core\n// classes, which this module overrides instead: e.g. MaplairMap#_rotateToPane(offset),\n// #_rotateToContainer(offset) and #_getViewSize() returning the offset or size\n// unchanged, used where the copied methods differ (well below 1 kB in core, for\n// all maps); or by splitting the core methods, so that the computations in\n// question become methods of their own (e.g. the pinch center from the offset of\n// the fingers, the inertia offset, the box of a popup in container pixels).\n// Both would change the pre-existing classes, which this module leaves untouched.\n\n// The methods extended below\nconst {panBy} = MaplairMap.prototype,\n{getEvents: getDivOverlayEvents} = DivOverlay.prototype,\n{_setPosition: setTooltipPosition} = Tooltip.prototype,\n{getEvents: getMarkerEvents, _positionElements: positionMarkerElements} = Marker.prototype,\n{_onDown: onDraggableDown, _updatePosition: updateDraggablePosition} = Draggable.prototype,\n{_onPointerStart: onPinchStart} = PinchZoomHandler.prototype,\n{_onDown: onTapDragDown} = TapDragZoomHandler.prototype,\n{_pinchTo: pinchTo} = ScrollWheelZoomHandler.prototype;\n\n/**\n * Map options of the map rotation (`maplair/map-rotation`).\n * @typedef {object} RotationMapOptions\n * @lends MaplairMapOptions\n * @property {number} [bearing=0] Initial rotation of the map in degrees: the compass\n * direction pointing up, clockwise from north (e.g. `90` for east up), see\n * `setBearing()`.\n * @property {boolean} [pinchRotate=false] Whether the map can be rotated by turning two\n * fingers, see `setBearing()`.\n */\n\nMaplairMap.mergeOptions({\n\tbearing: 0,\n\tpinchRotate: false\n});\n\nMaplairMap.addInitHook(function () {\n\tif (this.options.bearing || this.options.pinchRotate || this.options.rotateControl) {\n\t\tthis._rotate(this.options.bearing);\n\t\tif (this._loaded) {\n\t\t\tthis.fire('moveend');\n\t\t}\n\t}\n});\n\nRotateControl.register(MaplairMap);\n\n/**\n * Methods of `MaplairMap` for the map rotation. The rotation of the map is an optional\n * feature: import this module (`maplair/map-rotation`) to add the `bearing`,\n * `pinchRotate` and `rotateControl` options, `setBearing()`, `getBearing()` and the\n * `rotate` event to `MaplairMap`, and the `RotateControl`. Maps not using it don't\n * contain its code.\n *\n * The map pane is wrapped in a pane rotated around the center of the container.\n * Container/layer point conversions, `getPixelBounds()` and `getBounds()` account\n * for the rotation; grid layers and vector renderers cover the bounding box of\n * the rotated view; markers, popups and tooltips stay upright (see the Marker\n * option `rotateWithView`); dragging, `panBy()`, the keyboard, pinch, tap-drag,\n * touchpad and continuous zoom work in container pixels.\n *\n * @example\n * ```js\n * import {MaplairMap} from 'maplair';\n * import {RotateControl} from 'maplair/map-rotation';\n *\n * const map = new MaplairMap('map', {bearing: 30, pinchRotate: true, rotateControl: true});\n * ```\n *\n * @lends MaplairMap.prototype\n * @fires MaplairMap#rotate {MaplairEvent} Fired when the bearing of the map changes,\n * see `setBearing()`.\n */\nconst mapRotationMethods = {\n\t/**\n\t * Rotates the map around the center of the view, so that the compass direction\n\t * `bearing` (in degrees, clockwise from north) points up. Markers, popups and\n\t * tooltips stay upright. With `{animate: true}`, the map rotates smoothly (the\n\t * shorter way round).\n\t * @group Map rotation\n\t * @param {number} bearing\n\t * @param {{animate?: boolean}} [options]\n\t * @returns {this}\n\t */\n\tsetBearing(bearing, options) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tconst from = this.getBearing();\n\t\tif (!this._rotatePane && !bearing) { return this; }\n\t\tif (bearing === from) { return this; }\n\n\t\tthis._stop();\n\t\tif (!options?.animate || !this._loaded || this._prefersReducedMotion()) {\n\t\t\tthis._rotate(bearing);\n\t\t\treturn this._loaded ? this.fire('movestart').fire('move').fire('moveend') : this;\n\t\t}\n\n\t\t// the shorter way round\n\t\tconst delta = ((bearing - from + 540) % 360) - 180,\n\t\tstart = performance.now(),\n\t\tduration = 250;\n\t\tthis.fire('movestart');\n\t\tconst frame = () => {\n\t\t\tconst t = Math.min(1, (performance.now() - start) / duration);\n\t\t\tthis._rotate(from + delta * (1 - (1 - t) ** 2));\n\t\t\tthis.fire('move');\n\t\t\tif (t < 1) {\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.fire('moveend');\n\t\t\t}\n\t\t};\n\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\treturn this;\n\t},\n\n\t// Applies the bearing without the events of a view change (e.g. while pinching)\n\t_rotate(bearing) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tif (!this._rotatePane) {\n\t\t\t// the map pane is wrapped in a pane rotated around the center of the container\n\t\t\tconst rotatePane = this._rotatePane = DomUtil.create('div', 'maplair-rotate-pane');\n\t\t\trotatedMaps.set(rotatePane, this);\n\t\t\tthis._container.insertBefore(rotatePane, this._mapPane);\n\t\t\trotatePane.appendChild(this._mapPane);\n\t\t}\n\t\tif (bearing === this.getBearing()) { return; }\n\n\t\tthis._bearing = bearing;\n\t\tthis._rotatePane.style.transform = bearing ? `rotate(${-bearing}deg)` : '';\n\n\t\tif (this._loaded) {\n\t\t\tthis.fire('rotate');\n\t\t}\n\t},\n\n\t/**\n\t * Returns the rotation of the map, see `setBearing()`.\n\t * @group Map rotation\n\t * @returns {number}\n\t */\n\tgetBearing() {\n\t\treturn this._bearing ?? 0;\n\t},\n\n\t// Rotates an offset in container (screen) pixels to the frame of the rotated map pane\n\t_rotateToPane(point) {\n\t\treturn this._bearing ? rotatePoint(point, this._bearing) : point;\n\t},\n\n\t// Rotates an offset in the frame of the rotated map pane to container (screen) pixels\n\t_rotateToContainer(point) {\n\t\treturn this._bearing ? rotatePoint(point, -this._bearing) : point;\n\t},\n\n\t// The size of the bounding box of the rotated view, in pixels of the map pane\n\t_getViewSize() {\n\t\tconst size = this.getSize();\n\t\tif (!this._bearing) { return size; }\n\t\tconst angle = this._bearing * Math.PI / 180,\n\t\tcos = Math.abs(Math.cos(angle)),\n\t\tsin = Math.abs(Math.sin(angle));\n\t\treturn new Point(size.x * cos + size.y * sin, size.x * sin + size.y * cos);\n\t},\n\n\t// Counter-rotates `el` (positioned with `DomUtil.setPosition()`) around its CSS\n\t// `transformOrigin`, so that it stays upright on a rotated map.\n\t_rotateUpright(el, transformOrigin) {\n\t\tif (this._bearing) {\n\t\t\tel.style.transform += ` rotate(${this._bearing}deg)`;\n\t\t\tel.style.transformOrigin = transformOrigin;\n\t\t} else if (el.style.transformOrigin) {\n\t\t\tel.style.transformOrigin = '';\n\t\t}\n\t},\n\n\t/**\n\t * Overrides `containerPointToLayerPoint()` of `MaplairMap` (documented there) to\n\t * account for the rotation.\n\t * @internal\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tcontainerPointToLayerPoint(point) { // (Point)\n\t\tpoint = Point.from(point);\n\t\tif (this._bearing) {\n\t\t\t// the map pane is rotated around the center of the container\n\t\t\tconst center = this.getSize()._divideBy(2);\n\t\t\tpoint = this._rotateToPane(point.subtract(center))._add(center);\n\t\t}\n\t\treturn point.subtract(this._getMapPanePos());\n\t},\n\n\t/**\n\t * Overrides `layerPointToContainerPoint()` of `MaplairMap` (documented there) to\n\t * account for the rotation.\n\t * @internal\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tlayerPointToContainerPoint(point) { // (Point)\n\t\tpoint = Point.from(point).add(this._getMapPanePos());\n\t\tif (this._bearing) {\n\t\t\tconst center = this.getSize()._divideBy(2);\n\t\t\tpoint = this._rotateToContainer(point.subtract(center))._add(center);\n\t\t}\n\t\treturn point;\n\t},\n\n\t/**\n\t * Overrides `getPixelBounds()` of `MaplairMap` (documented there): the bounding box\n\t * of the rotated view.\n\t * @internal\n\t * @param {LatLng} [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\tif (!this._bearing) {\n\t\t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\n\t\t}\n\t\t// the bounding box of the rotated view\n\t\tconst pixelCenter = topLeftPoint.add(this.getSize()._divideBy(2)),\n\t\thalf = this._getViewSize()._divideBy(2);\n\t\treturn new Bounds(pixelCenter.subtract(half), pixelCenter.add(half));\n\t},\n\n\t/**\n\t * Overrides `panBy()` of `MaplairMap` (documented there): `panBy()` takes offsets in\n\t * container pixels, the map pane moves in its rotated frame.\n\t * @internal\n\t * @param {PointExpression} offset\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanBy(offset, options) {\n\t\treturn panBy.call(this, this._rotateToPane(Point.from(offset)), options);\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._rotateToContainer(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/**\n\t * Overrides `invalidateSize()` of `MaplairMap` (documented there) to pan in container\n\t * pixels.\n\t * @internal\n\t * @param {boolean|InvalidateSizeOptions} [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(this._rotateToContainer(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// 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.layerPointToLatLng(this._getCenterLayerPoint().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/** @typedef {typeof mapRotationMethods} MapRotationMethods */\n\nMaplairMap.include(mapRotationMethods);\n\n/**\n * Methods of `GridLayer` for the map rotation: the tiles cover the bounding box of the\n * rotated view.\n * @lends GridLayer.prototype\n */\nconst gridLayerRotationMethods = {\n\t_getTiledPixelBounds(center) {\n\t\tconst map = this._map,\n\t\tmapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(),\n\t\tscale = map.getZoomScale(mapZoom, this._tileZoom),\n\t\tpixelCenter = map.project(center, this._tileZoom).floor(),\n\t\thalfSize = map._getViewSize().divideBy(scale * 2);\n\n\t\treturn new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));\n\t}\n};\n/** @typedef {typeof gridLayerRotationMethods} GridLayerMapRotationMethods */\n\nGridLayer.include(gridLayerRotationMethods);\n\n/**\n * Methods of `BlanketOverlay` for the map rotation: the overlay covers the bounding\n * box of the rotated view.\n * @lends BlanketOverlay.prototype\n */\nconst blanketOverlayRotationMethods = {\n\t_updateTransform(center, zoom) {\n\t\tconst scale = this._map.getZoomScale(zoom, this._zoom),\n\t\tviewHalf = this._map._getViewSize().multiplyBy(0.5 + this.options.padding),\n\t\tcurrentCenterPoint = this._map.project(this._center, zoom),\n\t\ttopLeftOffset = viewHalf.multiplyBy(-scale)._add(currentCenterPoint)\n\t\t\t._subtract(this._map._getNewPixelOrigin(center, zoom))\n\t\t\t._round();\n\n\t\tDomUtil.setTransform(this._container, topLeftOffset, scale);\n\t},\n\n\t_onMoveEnd(ev) {\n\t\t// Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n\t\t// the bounding box of the (possibly rotated) view, extended by the padding\n\t\tconst p = this.options.padding,\n\t\tsize = this._map._getViewSize();\n\t\tif (!size.multiplyBy(1 + p * 2).round().equals(this._containerSize)) {\n\t\t\t// e.g. after rotating the map\n\t\t\tthis._resizeContainer();\n\t\t}\n\t\tconst min = this._map._getCenterLayerPoint().subtract(size.multiplyBy(0.5 + p)).round();\n\n\t\tthis._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());\n\n\t\tthis._center = this._map.getCenter();\n\t\tthis._zoom = this._map.getZoom();\n\t\tthis._updateTransform(this._center, this._zoom);\n\n\t\tthis._onSettled(ev);\n\t},\n\n\t_resizeContainer() {\n\t\tconst p = this.options.padding,\n\t\tsize = this._containerSize = this._map._getViewSize().multiplyBy(1 + p * 2).round();\n\t\tthis._container.style.width = `${size.x}px`;\n\t\tthis._container.style.height = `${size.y}px`;\n\t\treturn size;\n\t}\n};\n/** @typedef {typeof blanketOverlayRotationMethods} BlanketOverlayMapRotationMethods */\n\nBlanketOverlay.include(blanketOverlayRotationMethods);\n\n/**\n * Methods of `DivOverlay` for the map rotation: the overlays stay upright.\n * @lends DivOverlay.prototype\n */\nconst divOverlayRotationMethods = {\n\t/**\n\t * Overrides `getEvents()` of `DivOverlay` to update the position on rotation.\n\t * @internal\n\t * @returns {Record<string, Function>}\n\t */\n\tgetEvents() {\n\t\treturn {...getDivOverlayEvents.call(this), rotate: this._updatePosition};\n\t},\n\n\t_updatePosition() {\n\t\tif (!this._map) { return; }\n\n\t\tconst map = this._map,\n\t\tpos = map.latLngToLayerPoint(this._latlng)._round(),\n\t\t// on a rotated map, the anchor is relative to the upright overlay\n\t\tanchor = map._rotateToPane(new Point(this._getAnchor()));\n\t\tlet offset = Point.from(this.options.offset);\n\n\t\tconst transformed = this._zoomAnimated || this.options.overflow || map._bearing;\n\t\tif (!transformed) {\n\t\t\toffset = offset.add(pos).add(anchor);\n\t\t}\n\n\t\tconst bottom = this._containerBottom = -offset.y,\n\t\tleft = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;\n\n\t\t// bottom position the overlay in case the height of the overlay changes (images loading etc)\n\t\tif (this.options.overflow) {\n\t\t\t// relative to the top of the viewport instead of the pane origin\n\t\t\tthis._container.style.top = 'auto';\n\t\t\tthis._container.style.bottom = `calc(100% + ${bottom}px)`;\n\t\t} else {\n\t\t\tthis._container.style.bottom = `${bottom}px`;\n\t\t}\n\t\tthis._container.style.left = `${left}px`;\n\n\t\tif (transformed) {\n\t\t\t// upright around the anchored point (below the bottom margin, see `Popup`)\n\t\t\tthis._setContainerPosition(pos.add(anchor), `${-left}px calc(100% + ${bottom + (this._containerMarginBottom ?? 0)}px)`);\n\t\t}\n\t},\n\n\t// Positions the container at the given layer point. An overflowing overlay\n\t// lives in the top layer of the page, so it is positioned in viewport coordinates.\n\t// `transformOrigin` is the point around which the container is kept upright on a rotated map.\n\t_setContainerPosition(pos, transformOrigin) {\n\t\tthis._containerPos = pos;\n\t\tif (this.options.overflow) {\n\t\t\tconst mapContainer = this._map._container,\n\t\t\trect = mapContainer.getBoundingClientRect();\n\t\t\tpos = this._map.layerPointToContainerPoint(pos)\n\t\t\t\t._add(new Point(rect.left + mapContainer.clientLeft, rect.top + mapContainer.clientTop));\n\t\t}\n\t\tDomUtil.setPosition(this._container, pos);\n\t\tif (!this.options.overflow) {\n\t\t\tthis._map._rotateUpright(this._container, transformOrigin);\n\t\t}\n\t}\n};\n/** @typedef {typeof divOverlayRotationMethods} DivOverlayMapRotationMethods */\n\nDivOverlay.include(divOverlayRotationMethods);\n\n/**\n * Methods of `Popup` for the map rotation: the popup stays upright, autopanning in\n * container pixels.\n * @lends Popup.prototype\n */\nconst popupRotationMethods = {\n\t_animateZoom(e) {\n\t\tconst pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),\n\t\tanchor = this._map._rotateToPane(new Point(this._getAnchor()));\n\t\tthis._setContainerPosition(pos.add(anchor), this._container.style.transformOrigin);\n\t},\n\n\t_adjustPan() {\n\t\tif (!this.options.autoPan) { return; }\n\t\tthis._map._panAnim?.stop();\n\n\t\t// We can endlessly recurse if keepInView is set and the view resets.\n\t\t// Let's guard against that by exiting early if we're responding to our own autopan.\n\t\tif (this._autopanning) {\n\t\t\tthis._autopanning = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst map = this._map,\n\t\tmarginBottom = this._containerMarginBottom ?? (parseInt(getComputedStyle(this._container).marginBottom, 10) || 0),\n\t\tcontainerHeight = this._containerHeight + marginBottom,\n\t\tcontainerWidth = this._containerWidth,\n\t\t// the top left corner, relative to the (upright) anchored point\n\t\ttopLeft = new Point(this._containerLeft, -containerHeight - this._containerBottom);\n\n\t\tconst containerPos = map.layerPointToContainerPoint(this._getContainerPosition())._add(topLeft),\n\t\tpadding = Point.from(this.options.autoPanPadding),\n\t\tpaddingTL = Point.from(this.options.autoPanPaddingTopLeft ?? padding),\n\t\tpaddingBR = Point.from(this.options.autoPanPaddingBottomRight ?? padding),\n\t\tsize = map.getSize();\n\t\tlet dx = 0,\n\t\tdy = 0;\n\n\t\tif (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\n\t\t\tdx = containerPos.x + containerWidth - size.x + paddingBR.x;\n\t\t}\n\t\tif (containerPos.x - dx - paddingTL.x < 0) { // left\n\t\t\tdx = containerPos.x - paddingTL.x;\n\t\t}\n\t\tif (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\n\t\t\tdy = containerPos.y + containerHeight - size.y + paddingBR.y;\n\t\t}\n\t\tif (containerPos.y - dy - paddingTL.y < 0) { // top\n\t\t\tdy = containerPos.y - paddingTL.y;\n\t\t}\n\n\t\t// see the `autopanstart` event of `Popup`\n\t\tif (dx || dy) {\n\t\t\t// Track that we're autopanning, as this function will be re-ran on moveend\n\t\t\tif (this.options.keepInView) {\n\t\t\t\tthis._autopanning = true;\n\t\t\t}\n\n\t\t\tmap\n\t\t\t\t.fire('autopanstart')\n\t\t\t\t.panBy([dx, dy]);\n\t\t}\n\t}\n};\n/** @typedef {typeof popupRotationMethods} PopupMapRotationMethods */\n\nPopup.include(popupRotationMethods);\n\n// The margins of the directions, see `.maplair-tooltip-top` etc. in maplair.css\nconst tooltipMargins = {\n\ttop: [0, -6],\n\tbottom: [0, 6],\n\tleft: [-6, 0],\n\tright: [6, 0]\n};\n\n/**\n * Methods of `Tooltip` for the map rotation: the tooltip stays upright.\n * @lends Tooltip.prototype\n */\nconst tooltipRotationMethods = {\n\t// On a rotated map, the tooltip is positioned at its source and kept upright\n\t// around it (taking the margin of the direction into account)\n\t_setPosition(pos) {\n\t\tsetTooltipPosition.call(this, pos);\n\t\tconst container = this._container;\n\t\tif (this.options.overflow) { return; }\n\t\tif (!this._map._bearing) {\n\t\t\tcontainer.style.left = container.style.top = '';\n\t\t\treturn;\n\t\t}\n\t\tconst delta = this._containerPos.subtract(pos),\n\t\tdirection = Object.keys(tooltipMargins).find(d => container.classList.contains(`maplair-tooltip-${d}`)),\n\t\tmargin = tooltipMargins[direction] ?? [0, 0];\n\t\tcontainer.style.left = `${delta.x}px`;\n\t\tcontainer.style.top = `${delta.y}px`;\n\t\tthis._setContainerPosition(pos, `${-delta.x - margin[0]}px ${-delta.y - margin[1]}px`);\n\t}\n};\n/** @typedef {typeof tooltipRotationMethods} TooltipMapRotationMethods */\n\nTooltip.include(tooltipRotationMethods);\n\n/**\n * Options of `Marker` for the map rotation.\n * @typedef {object} MarkerMapRotationOptions\n * @lends MarkerOptions\n * @property {boolean} [rotateWithView=false] On a rotated map (see\n * `MaplairMap.setBearing()`), whether the icon rotates with the map (e.g. for arrows\n * pointing in a geographic direction) instead of staying upright. The `rotation` of\n * the marker is relative to the screen, or to north with `rotateWithView`.\n */\nMarker.include({\n\toptions: {\n\t\trotateWithView: false\n\t}\n});\n\n/**\n * Methods of `Marker` for the map rotation: the marker is updated on rotation, and\n * its icon and shadow stay upright.\n * @lends Marker.prototype\n */\nconst markerRotationMethods = {\n\t/**\n\t * Overrides `getEvents()` of `Marker` to update the marker on rotation.\n\t * @internal\n\t * @returns {Record<string, Function>}\n\t */\n\tgetEvents() {\n\t\treturn {...getMarkerEvents.call(this), rotate: this.update};\n\t},\n\n\t_positionElements(pos) {\n\t\tpositionMarkerElements.call(this, pos);\n\t\tconst bearing = this.options.rotateWithView ? 0 : (this._map?.getBearing() ?? 0);\n\t\tif (!bearing) { return; }\n\t\tfor (const el of [this._icon, this._shadow]) {\n\t\t\tif (el) { el.style.transform += ` rotate(${bearing}deg)`; }\n\t\t}\n\t}\n};\n/** @typedef {typeof markerRotationMethods} MarkerMapRotationMethods */\n\nMarker.include(markerRotationMethods);\n\n/**\n * Methods of `MarkerDrag` for the map rotation: autopanning in container pixels.\n * @lends MarkerDrag.prototype\n */\nconst markerDragRotationMethods = {\n\t_adjustPan(e) {\n\t\tconst marker = this._marker,\n\t\tmap = marker._map,\n\t\tspeed = this._marker.options.autoPanSpeed,\n\t\tpadding = this._marker.options.autoPanPadding,\n\t\ticonPos = DomUtil.getPosition(marker._icon),\n\t\tbounds = map.getPixelBounds(),\n\t\torigin = map.getPixelOrigin();\n\n\t\tconst panBounds = new Bounds(\n\t\t\tbounds.min._subtract(origin).add(padding),\n\t\t\tbounds.max._subtract(origin).subtract(padding)\n\t\t);\n\n\t\tif (!panBounds.contains(iconPos)) {\n\t\t\t// Compute incremental movement\n\t\t\tconst movement = new Point(\n\t\t\t\t(Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -\n\t\t\t\t\t(Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),\n\n\t\t\t\t(Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -\n\t\t\t\t\t(Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)\n\t\t\t).multiplyBy(speed);\n\n\t\t\tmap.panBy(map._rotateToContainer(movement), {animate: false});\n\n\t\t\tthis._draggable._newPos._add(movement);\n\t\t\tthis._draggable._startPos._add(movement);\n\n\t\t\tDomUtil.setPosition(marker._icon, this._draggable._newPos);\n\t\t\tthis._onDrag(e);\n\n\t\t\tthis._panRequest = requestAnimationFrame(this._adjustPan.bind(this, e));\n\t\t}\n\t}\n};\n/** @typedef {typeof markerDragRotationMethods} MarkerDragMapRotationMethods */\n\nMarkerDrag.include(markerDragRotationMethods);\n\n/**\n * Methods of `Draggable` for the map rotation: dragging in the rotated frame of the\n * map pane.\n * @lends Draggable.prototype\n */\nconst draggableRotationMethods = {\n\t_onDown(e) {\n\t\tonDraggableDown.call(this, e);\n\t\t// on a rotated map, the element moves in the rotated frame of the map pane,\n\t\t// and the rotated pane is scaled by its bounding box (see `DomUtil.getScale()`)\n\t\tconst rotatePane = this._element.closest?.('.maplair-rotate-pane');\n\t\tthis._rotatedMap = rotatePane && rotatedMaps.get(rotatePane);\n\t\tif (this._rotatedMap && this._parentScale) {\n\t\t\tthis._parentScale = DomUtil.getScale(rotatePane.parentNode);\n\t\t}\n\t},\n\n\t_updatePosition() {\n\t\tconst map = this._rotatedMap;\n\t\tif (map?._bearing) {\n\t\t\tthis._newPos = this._startPos.add(map._rotateToPane(this._newPos.subtract(this._startPos)));\n\t\t}\n\t\tupdateDraggablePosition.call(this);\n\t}\n};\n/** @typedef {typeof draggableRotationMethods} DraggableMapRotationMethods */\n\nDraggable.include(draggableRotationMethods);\n\n/**\n * Methods of `DragHandler` for the map rotation: the inertia in container pixels.\n * @lends DragHandler.prototype\n */\nconst dragHandlerRotationMethods = {\n\t_onDragEnd(e) {\n\t\tconst map = this._map,\n\t\toptions = map.options,\n\n\t\tnoInertia = !options.inertia || e.noInertia || this._times.length < 2;\n\n\t\tmap.fire('dragend', e);\n\n\t\tif (noInertia) {\n\t\t\tmap.fire('moveend');\n\n\t\t} else {\n\t\t\tthis._prunePositions(Date.now());\n\n\t\t\tconst direction = this._lastPos.subtract(this._positions[0]),\n\t\t\tduration = (this._lastTime - this._times[0]) / 1000,\n\t\t\tease = options.easeLinearity,\n\n\t\t\tspeedVector = direction.multiplyBy(ease / duration),\n\t\t\tspeed = speedVector.distanceTo([0, 0]),\n\n\t\t\tlimitedSpeed = Math.min(options.inertiaMaxSpeed, speed),\n\t\t\tlimitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed),\n\n\t\t\tmaxOffset = map.getSize().divideBy(2);\n\n\t\t\tlet decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease),\n\t\t\toffset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();\n\n\t\t\t// with reduced motion, shorten the coast to fit within half the map size, see DragHandler\n\t\t\tif (map._prefersReducedMotion() && !maxOffset.contains(offset)) {\n\t\t\t\tconst k = Math.min(maxOffset.x / Math.abs(offset.x), maxOffset.y / Math.abs(offset.y));\n\t\t\t\toffset = offset.multiplyBy(k).round();\n\t\t\t\tdecelerationDuration *= Math.sqrt(k);\n\t\t\t}\n\n\t\t\tif (!offset.x && !offset.y) {\n\t\t\t\tmap.fire('moveend');\n\n\t\t\t} else {\n\t\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t// the offset of the map pane, `panBy()` takes container pixels\n\t\t\t\t\tmap.panBy(map._rotateToContainer(offset), {\n\t\t\t\t\t\tduration: decelerationDuration,\n\t\t\t\t\t\teaseLinearity: ease,\n\t\t\t\t\t\tnoMoveStart: true,\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n};\n/** @typedef {typeof dragHandlerRotationMethods} DragHandlerMapRotationMethods */\n\nDragHandler.include(dragHandlerRotationMethods);\n\n// The time (ms) without further wheel events after which a touchpad pan ends, see `ScrollWheelZoomHandler`\nconst gestureEndDelay = 150;\n\n// The angle (degrees) the fingers have to turn before the map starts rotating\nconst rotateThreshold = 15;\n\nfunction angleOf(p1, p2) {\n\treturn Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI;\n}\n\n/**\n * Methods of `PinchZoomHandler` for the map rotation: rotating by turning two fingers\n * (see the map option `pinchRotate`), pinching in the rotated frame.\n * @lends PinchZoomHandler.prototype\n */\nconst pinchZoomHandlerRotationMethods = {\n\t_onPointerStart(e) {\n\t\tonPinchStart.call(this, e);\n\t\tconst pointers = PointerEvents.getPointers();\n\t\tif (this._zooming && pointers.length === 2) {\n\t\t\tthis._startAngle = angleOf(...pointers.map(p => this._map.pointerEventToContainerPoint(p)));\n\t\t\tthis._startBearing = this._map.getBearing();\n\t\t\tthis._rotating = false;\n\t\t}\n\t},\n\n\t_onPointerMove(e) {\n\t\tconst pointers = PointerEvents.getPointers();\n\t\tif (pointers.length !== 2 || !this._zooming) { return; }\n\n\t\tconst map = this._map,\n\t\tp1 = map.pointerEventToContainerPoint(pointers[0]),\n\t\tp2 = map.pointerEventToContainerPoint(pointers[1]),\n\t\tscale = p1.distanceTo(p2) / this._startDist;\n\n\t\tthis._zoom = map.getScaleZoom(scale, this._startZoom);\n\n\t\tif (map.options.pinchRotate) {\n\t\t\tconst angle = angleOf(p1, p2);\n\t\t\tlet delta = ((angle - this._startAngle + 540) % 360) - 180;\n\t\t\tif (!this._rotating && Math.abs(delta) > rotateThreshold) {\n\t\t\t\t// start rotating from the threshold on, without a jump\n\t\t\t\tthis._rotating = true;\n\t\t\t\tthis._startAngle += Math.sign(delta) * rotateThreshold;\n\t\t\t\tdelta -= Math.sign(delta) * rotateThreshold;\n\t\t\t}\n\t\t\tif (this._rotating) {\n\t\t\t\t// turning the fingers clockwise turns the map clockwise\n\t\t\t\tmap._rotate(this._startBearing - delta);\n\t\t\t}\n\t\t}\n\n\t\tif (!map.options.bounceAtZoomLimits && (\n\t\t\t(this._zoom < map.getMinZoom() && scale < 1) ||\n\t\t\t\t(this._zoom > map.getMaxZoom() && scale > 1))) {\n\t\t\tthis._zoom = map._limitZoom(this._zoom);\n\t\t}\n\n\t\tif (map.options.pinchZoom === 'center') {\n\t\t\tthis._center = this._startLatLng;\n\t\t\tif (scale === 1 && !this._rotating) { return; }\n\t\t} else {\n\t\t\t// Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng\n\t\t\tconst delta = map._rotateToPane(p1._add(p2)._divideBy(2)._subtract(this._centerPoint));\n\t\t\tif (scale === 1 && delta.x === 0 && delta.y === 0 && !this._rotating) { return; }\n\t\t\tthis._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom);\n\t\t}\n\n\t\tif (!this._moved) {\n\t\t\tmap._setUserEvent(e);\n\t\t\tmap._moveStart(true, false);\n\t\t\tthis._moved = true;\n\t\t}\n\n\t\tcancelAnimationFrame(this._animRequest);\n\n\t\tconst moveFn = map._move.bind(map, this._center, this._zoom, {pinch: true, round: false}, undefined);\n\t\tthis._animRequest = requestAnimationFrame(moveFn.bind(this));\n\n\t\te.preventDefault();\n\t}\n};\n/** @typedef {typeof pinchZoomHandlerRotationMethods} PinchZoomHandlerMapRotationMethods */\n\nPinchZoomHandler.include(pinchZoomHandlerRotationMethods);\n\n/**\n * Methods of `TapDragZoomHandler` for the map rotation: the zoom origin in the rotated\n * frame.\n * @lends TapDragZoomHandler.prototype\n */\nconst tapDragZoomHandlerRotationMethods = {\n\t_onDown(e) {\n\t\tonTapDragDown.call(this, e);\n\t\t// the offset of the zoom origin in the rotated frame of the map pane\n\t\tif (this._zooming && this._aroundOffset) {\n\t\t\tthis._aroundOffset = this._map._rotateToPane(this._aroundOffset);\n\t\t}\n\t}\n};\n/** @typedef {typeof tapDragZoomHandlerRotationMethods} TapDragZoomHandlerMapRotationMethods */\n\nTapDragZoomHandler.include(tapDragZoomHandlerRotationMethods);\n\n/**\n * Methods of `ScrollWheelZoomHandler` for the map rotation: zooming and panning in the\n * rotated frame.\n * @lends ScrollWheelZoomHandler.prototype\n */\nconst scrollWheelZoomHandlerRotationMethods = {\n\t_pinchTo(e, zoom, eased) {\n\t\tpinchTo.call(this, e, zoom, eased);\n\t\t// the offset of the zoom origin in the rotated frame of the map pane\n\t\tif (this._pinch && !this._pinch.rotated) {\n\t\t\tthis._pinch.offset = this._map._rotateToPane(this._pinch.offset);\n\t\t\tthis._pinch.rotated = true;\n\t\t}\n\t},\n\n\t// Pans the map by the wheel deltas, as by scrolling with two fingers on a touchpad.\n\t_panBy(e) {\n\t\tDomEvent.stop(e);\n\t\tconst map = this._map;\n\t\tif (map._animatingZoom) { return; }\n\n\t\tconst factor = e.deltaMode === 1 ? 20 : e.deltaMode === 2 ? 60 : 1;\n\t\tlet offset = new Point(e.deltaX * factor, e.deltaY * factor);\n\t\tif (e.shiftKey && !e.deltaX) {\n\t\t\t// Shift with a mouse wheel scrolls horizontally\n\t\t\toffset = new Point(offset.y, 0);\n\t\t}\n\t\t// in the rotated frame of the map pane\n\t\toffset = map._rotateToPane(offset);\n\t\tif (map.options.maxBounds) {\n\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\t\t}\n\n\t\tif (!this._panning) {\n\t\t\tmap._stop();\n\t\t\tthis._panning = true;\n\t\t\tmap._setUserEvent(e);\n\t\t\tmap.fire('movestart');\n\t\t}\n\t\tmap._rawPanBy(offset.round());\n\t\tmap.fire('move');\n\n\t\tclearTimeout(this._panTimer);\n\t\tthis._panTimer = setTimeout(this._endPan.bind(this), gestureEndDelay);\n\t}\n};\n/** @typedef {typeof scrollWheelZoomHandlerRotationMethods} ScrollWheelZoomHandlerMapRotationMethods */\n\nScrollWheelZoomHandler.include(scrollWheelZoomHandlerRotationMethods);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,iBAAiB,SAAS;CAClC,QAAS,OAAO,OAAO,IAAI,MAAO,OAAO;AAC1C;AAGA,SAAS,YAAY,OAAO,SAAS;CACpC,MAAM,QAAQ,UAAU,KAAK,KAAK,KAClC,MAAM,KAAK,IAAI,KAAK,GACpB,MAAM,KAAK,IAAI,KAAK;CACpB,OAAO,IAAI,MAAM,MAAM,IAAI,MAAM,MAAM,IAAI,KAAK,MAAM,IAAI,MAAM,MAAM,IAAI,GAAG;AAC9E;AAGA,MAAM,8BAAc,IAAI,QAAQ;AAuBhC,MAAM,EAAC,UAAS,WAAW,WAC3B,EAAC,WAAW,wBAAuB,WAAW,WAC9C,EAAC,cAAc,uBAAsB,QAAQ,WAC7C,EAAC,WAAW,iBAAiB,mBAAmB,2BAA0B,OAAO,WACjF,EAAC,SAAS,iBAAiB,iBAAiB,4BAA2B,UAAU,WACjF,EAAC,iBAAiB,iBAAgB,iBAAiB,WACnD,EAAC,SAAS,kBAAiB,mBAAmB,WAC9C,EAAC,UAAU,YAAW,uBAAuB;;;;;;;;;;;AAa7C,WAAW,aAAa;CACvB,SAAS;CACT,aAAa;AACd,CAAC;AAED,WAAW,YAAY,WAAY;CAClC,IAAI,KAAK,QAAQ,WAAW,KAAK,QAAQ,eAAe,KAAK,QAAQ,eAAe;EACnF,KAAK,QAAQ,KA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