maplair 4.1.0 → 4.3.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 (213) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/esm/Maplair.js +5 -4
  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 +1 -2
  6. package/dist/esm/control/ButtonControl.js +1 -2
  7. package/dist/esm/control/ContextMenu.js +1 -2
  8. package/dist/esm/control/Control.js +1 -2
  9. package/dist/esm/control/FullscreenControl.js +1 -2
  10. package/dist/esm/control/LayersControl.js +27 -31
  11. package/dist/esm/control/LayersControl.js.map +1 -1
  12. package/dist/esm/control/LegendControl.js +1 -2
  13. package/dist/esm/control/MiniMapControl.js +1 -2
  14. package/dist/esm/control/RotateControl.js +1 -2
  15. package/dist/esm/control/ScaleControl.js +1 -2
  16. package/dist/esm/control/SearchControl.js +1 -2
  17. package/dist/esm/control/SideBySideControl.js +1 -2
  18. package/dist/esm/control/TextControl.js +1 -2
  19. package/dist/esm/control/TimeControl.js +1 -2
  20. package/dist/esm/control/ZoomControl.js +18 -29
  21. package/dist/esm/control/ZoomControl.js.map +1 -1
  22. package/dist/esm/core/Class.js +2 -9
  23. package/dist/esm/core/Class.js.map +1 -1
  24. package/dist/esm/core/Events.js +2 -2
  25. package/dist/esm/core/Events.js.map +1 -1
  26. package/dist/esm/core/Handler.js +10 -3
  27. package/dist/esm/core/Handler.js.map +1 -1
  28. package/dist/esm/core/I18n.js +1 -2
  29. package/dist/esm/core/Util.js +2 -3
  30. package/dist/esm/core/Util.js.map +1 -1
  31. package/dist/esm/dom/DomEvent.DoubleTap.js +1 -2
  32. package/dist/esm/dom/DomEvent.PointerEvents.js +1 -2
  33. package/dist/esm/dom/DomEvent.js +10 -18
  34. package/dist/esm/dom/DomEvent.js.map +1 -1
  35. package/dist/esm/dom/DomUtil.js +1 -2
  36. package/dist/esm/dom/Draggable.js +4 -3
  37. package/dist/esm/dom/Draggable.js.map +1 -1
  38. package/dist/esm/dom/PosAnimation.js +1 -2
  39. package/dist/esm/geo/LatLng.js +1 -2
  40. package/dist/esm/geo/LatLngBounds.js +9 -15
  41. package/dist/esm/geo/LatLngBounds.js.map +1 -1
  42. package/dist/esm/geo/crs/CRS.js +1 -2
  43. package/dist/esm/geo/crs/EPSG3395.js +4 -5
  44. package/dist/esm/geo/crs/EPSG3395.js.map +1 -1
  45. package/dist/esm/geo/crs/EPSG3857.js +4 -5
  46. package/dist/esm/geo/crs/EPSG3857.js.map +1 -1
  47. package/dist/esm/geo/crs/EPSG4326.js +3 -4
  48. package/dist/esm/geo/crs/EPSG4326.js.map +1 -1
  49. package/dist/esm/geo/crs/EarthCRS.js +1 -2
  50. package/dist/esm/geo/crs/SimpleCRS.js +3 -4
  51. package/dist/esm/geo/crs/SimpleCRS.js.map +1 -1
  52. package/dist/esm/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +4 -5
  53. package/dist/esm/geo/projection/LonLatProjection.js.map +1 -0
  54. package/dist/esm/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +3 -4
  55. package/dist/esm/geo/projection/MercatorProjection.js.map +1 -0
  56. package/dist/esm/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +4 -5
  57. package/dist/esm/geo/projection/SphericalMercatorProjection.js.map +1 -0
  58. package/dist/esm/geometry/Bounds.js +10 -14
  59. package/dist/esm/geometry/Bounds.js.map +1 -1
  60. package/dist/esm/geometry/LineUtil.js +2 -3
  61. package/dist/esm/geometry/LineUtil.js.map +1 -1
  62. package/dist/esm/geometry/Point.js +1 -2
  63. package/dist/esm/geometry/PolyUtil.js +17 -25
  64. package/dist/esm/geometry/PolyUtil.js.map +1 -1
  65. package/dist/esm/geometry/Transformation.js +1 -2
  66. package/dist/esm/layer/BlanketOverlay.js +1 -2
  67. package/dist/esm/layer/Classification.js +1 -2
  68. package/dist/esm/layer/DivOverlay.js +2 -3
  69. package/dist/esm/layer/DivOverlay.js.map +1 -1
  70. package/dist/esm/layer/FeatureGroup.js +5 -4
  71. package/dist/esm/layer/FeatureGroup.js.map +1 -1
  72. package/dist/esm/layer/GeoJSON.Load.js +1 -2
  73. package/dist/esm/layer/GeoJSON.js +8 -10
  74. package/dist/esm/layer/GeoJSON.js.map +1 -1
  75. package/dist/esm/layer/GeoJSONUtil.js +1 -2
  76. package/dist/esm/layer/HeatLayer.js +2 -3
  77. package/dist/esm/layer/HeatLayer.js.map +1 -1
  78. package/dist/esm/layer/ImageOverlay.js +2 -3
  79. package/dist/esm/layer/ImageOverlay.js.map +1 -1
  80. package/dist/esm/layer/Layer.js +1 -2
  81. package/dist/esm/layer/LayerGroup.js +2 -3
  82. package/dist/esm/layer/LayerGroup.js.map +1 -1
  83. package/dist/esm/layer/Popup.js +9 -16
  84. package/dist/esm/layer/Popup.js.map +1 -1
  85. package/dist/esm/layer/SVGOverlay.js +1 -2
  86. package/dist/esm/layer/Tooltip.js +16 -17
  87. package/dist/esm/layer/Tooltip.js.map +1 -1
  88. package/dist/esm/layer/VideoOverlay.js +1 -2
  89. package/dist/esm/layer/marker/DefaultIcon.js +29 -7
  90. package/dist/esm/layer/marker/DefaultIcon.js.map +1 -1
  91. package/dist/esm/layer/marker/DivIcon.js +1 -2
  92. package/dist/esm/layer/marker/Icon.js +2 -2
  93. package/dist/esm/layer/marker/Icon.js.map +1 -1
  94. package/dist/esm/layer/marker/Marker.Drag.js +43 -4
  95. package/dist/esm/layer/marker/Marker.Drag.js.map +1 -1
  96. package/dist/esm/layer/marker/Marker.Move.js +4 -6
  97. package/dist/esm/layer/marker/Marker.Move.js.map +1 -1
  98. package/dist/esm/layer/marker/Marker.js +54 -14
  99. package/dist/esm/layer/marker/Marker.js.map +1 -1
  100. package/dist/esm/layer/marker/MarkerClusterGroup.js +1 -2
  101. package/dist/esm/layer/marker/SvgIcon.js +1 -2
  102. package/dist/esm/layer/tile/GridLayer.js +4 -4
  103. package/dist/esm/layer/tile/GridLayer.js.map +1 -1
  104. package/dist/esm/layer/tile/TileLayer.js +8 -8
  105. package/dist/esm/layer/tile/TileLayer.js.map +1 -1
  106. package/dist/esm/layer/tile/WMSTileLayer.js +5 -4
  107. package/dist/esm/layer/tile/WMSTileLayer.js.map +1 -1
  108. package/dist/esm/layer/vector/Canvas.js +7 -14
  109. package/dist/esm/layer/vector/Canvas.js.map +1 -1
  110. package/dist/esm/layer/vector/Circle.js +5 -3
  111. package/dist/esm/layer/vector/Circle.js.map +1 -1
  112. package/dist/esm/layer/vector/CircleMarker.js +2 -3
  113. package/dist/esm/layer/vector/CircleMarker.js.map +1 -1
  114. package/dist/esm/layer/vector/Path.DashAnimation.js +1 -2
  115. package/dist/esm/layer/vector/Path.ZoomStyles.js +1 -2
  116. package/dist/esm/layer/vector/Path.js +1 -2
  117. package/dist/esm/layer/vector/Polygon.js +2 -3
  118. package/dist/esm/layer/vector/Polygon.js.map +1 -1
  119. package/dist/esm/layer/vector/Polyline.Decorations.js +1 -2
  120. package/dist/esm/layer/vector/Polyline.js +2 -3
  121. package/dist/esm/layer/vector/Polyline.js.map +1 -1
  122. package/dist/esm/layer/vector/Rectangle.js +1 -2
  123. package/dist/esm/layer/vector/Renderer.getRenderer.js +4 -5
  124. package/dist/esm/layer/vector/Renderer.getRenderer.js.map +1 -1
  125. package/dist/esm/layer/vector/Renderer.js +1 -2
  126. package/dist/esm/layer/vector/SVG.js +7 -4
  127. package/dist/esm/layer/vector/SVG.js.map +1 -1
  128. package/dist/esm/map/Hash.js +1 -2
  129. package/dist/esm/map/Map.Rotation.js +31 -16
  130. package/dist/esm/map/Map.Rotation.js.map +1 -1
  131. package/dist/esm/map/Map.js +10 -17
  132. package/dist/esm/map/Map.js.map +1 -1
  133. package/dist/esm/map/MapSync.js +1 -2
  134. package/dist/esm/map/handler/BoxZoomHandler.js +20 -40
  135. package/dist/esm/map/handler/BoxZoomHandler.js.map +1 -1
  136. package/dist/esm/map/handler/DisplaceHandler.js +1 -2
  137. package/dist/esm/map/handler/DoubleClickZoomHandler.js +1 -2
  138. package/dist/esm/map/handler/DragHandler.js +1 -2
  139. package/dist/esm/map/handler/KeyboardHandler.js +23 -43
  140. package/dist/esm/map/handler/KeyboardHandler.js.map +1 -1
  141. package/dist/esm/map/handler/PinchZoomHandler.js +1 -2
  142. package/dist/esm/map/handler/ScrollWheelZoomHandler.js +1 -2
  143. package/dist/esm/map/handler/TapDragZoomHandler.js +1 -2
  144. package/dist/esm/map/handler/TapHoldHandler.js +1 -2
  145. package/dist/esm/package.js +2 -3
  146. package/dist/maplair-global-src.js +489 -613
  147. package/dist/maplair-global-src.js.map +1 -1
  148. package/dist/maplair-global.js +2 -2
  149. package/dist/maplair-global.js.map +1 -1
  150. package/dist/maplair-src.js +485 -609
  151. package/dist/maplair-src.js.map +1 -1
  152. package/dist/maplair.css +1 -1263
  153. package/dist/maplair.js +2 -2
  154. package/dist/maplair.js.map +1 -1
  155. package/package.json +4 -8
  156. package/src/Maplair.all.js +0 -1
  157. package/src/control/LayersControl.js +39 -52
  158. package/src/control/ZoomControl.js +17 -31
  159. package/src/core/Class.js +5 -14
  160. package/src/core/Events.js +2 -0
  161. package/src/core/Handler.js +11 -1
  162. package/src/core/Util.js +1 -1
  163. package/src/dom/DomEvent.js +9 -19
  164. package/src/dom/Draggable.js +5 -1
  165. package/src/geo/LatLngBounds.js +8 -15
  166. package/src/geo/crs/EPSG3395.js +3 -3
  167. package/src/geo/crs/EPSG3857.js +3 -3
  168. package/src/geo/crs/EPSG4326.js +2 -2
  169. package/src/geo/crs/SimpleCRS.js +2 -2
  170. package/src/geo/index.js +1 -2
  171. package/src/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +1 -1
  172. package/src/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +1 -1
  173. package/src/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +1 -1
  174. package/src/geo/projection/index.js +5 -5
  175. package/src/geometry/Bounds.js +12 -17
  176. package/src/geometry/LineUtil.js +1 -1
  177. package/src/geometry/PolyUtil.js +23 -31
  178. package/src/layer/DivOverlay.js +1 -1
  179. package/src/layer/FeatureGroup.js +8 -2
  180. package/src/layer/GeoJSON.js +10 -13
  181. package/src/layer/HeatLayer.js +1 -1
  182. package/src/layer/ImageOverlay.js +2 -2
  183. package/src/layer/LayerGroup.js +1 -1
  184. package/src/layer/Popup.js +9 -19
  185. package/src/layer/Tooltip.js +19 -17
  186. package/src/layer/marker/DefaultIcon.js +33 -5
  187. package/src/layer/marker/Icon.js +2 -0
  188. package/src/layer/marker/Marker.Drag.js +53 -5
  189. package/src/layer/marker/Marker.Move.js +3 -4
  190. package/src/layer/marker/Marker.js +64 -13
  191. package/src/layer/tile/GridLayer.js +5 -2
  192. package/src/layer/tile/TileLayer.js +9 -6
  193. package/src/layer/tile/WMSTileLayer.js +5 -2
  194. package/src/layer/vector/Canvas.js +10 -14
  195. package/src/layer/vector/Circle.js +7 -1
  196. package/src/layer/vector/CircleMarker.js +2 -1
  197. package/src/layer/vector/Polygon.js +1 -1
  198. package/src/layer/vector/Polyline.js +1 -1
  199. package/src/layer/vector/Renderer.getRenderer.js +4 -3
  200. package/src/layer/vector/SVG.js +12 -2
  201. package/src/map/Map.Rotation.js +28 -4
  202. package/src/map/Map.js +17 -21
  203. package/src/map/handler/BoxZoomHandler.js +21 -42
  204. package/src/map/handler/KeyboardHandler.js +34 -53
  205. package/src/maplair.css +5 -0
  206. package/dist/esm/geo/projection/Projection.LonLat.js.map +0 -1
  207. package/dist/esm/geo/projection/Projection.Mercator.js.map +0 -1
  208. package/dist/esm/geo/projection/Projection.SphericalMercator.js.map +0 -1
  209. package/dist/esm/geo/projection/index.js +0 -14
  210. package/dist/esm/geo/projection/index.js.map +0 -1
  211. package/dist/esm/layer/marker/Marker.Rotation.js +0 -70
  212. package/dist/esm/layer/marker/Marker.Rotation.js.map +0 -1
  213. package/src/layer/marker/Marker.Rotation.js +0 -103
@@ -1 +1 @@
1
- {"version":3,"file":"SVG.js","names":[],"sources":["../../../../src/layer/vector/SVG.js"],"sourcesContent":["import {Renderer} from './Renderer.js';\nimport * as DomUtil from '../../dom/DomUtil.js';\nimport {splitWords, stamp} from '../../core/Util.js';\n/** @import {Point} from '../../geometry/Point.js' */\n/** @import {RendererOptions} from './Renderer.js' */\n\n/**\n * Allows vector layers to be displayed with [SVG](https://developer.mozilla.org/docs/Web/SVG).\n * Inherits `Renderer`.\n *\n * @example\n * Use SVG by default for all paths in the map:\n *\n * ```js\n * const map = new MaplairMap('map', {\n * \trenderer: new SVG()\n * });\n * ```\n *\n * Use a SVG renderer with extra padding for specific vector geometries:\n *\n * ```js\n * const map = new MaplairMap('map');\n * const myRenderer = new SVG({ padding: 0.5 });\n * const line = new Polyline( coordinates, { renderer: myRenderer } );\n * const circle = new Circle( center, { renderer: myRenderer, radius: 100 } );\n * ```\n */\nexport class SVG extends Renderer {\n\t/**\n\t * Creates a SVG renderer with the given options.\n\t * @overload\n\t * @param {RendererOptions} [options]\n\t */\n\t/**\n\t * @param {...any} args\n\t */\n\tconstructor(...args) {\n\t\tsuper(...args);\n\t\tthis.callInitHooks(SVG);\n\t}\n\n\n\t_initContainer() {\n\t\tthis._container = SVG.create('svg');\n\n\t\t// makes it possible to click through svg root; we'll reset it back in individual paths\n\t\tthis._container.setAttribute('pointer-events', 'none');\n\n\t\tthis._rootGroup = SVG.create('g');\n\t\tthis._container.appendChild(this._rootGroup);\n\t}\n\n\t_destroyContainer() {\n\t\tsuper._destroyContainer();\n\t\tdelete this._rootGroup;\n\t\tdelete this._svgSize;\n\t}\n\n\t_resizeContainer() {\n\t\tconst size = super._resizeContainer();\n\n\t\t// set size of svg-container if changed\n\t\tif (!this._svgSize || !this._svgSize.equals(size)) {\n\t\t\tthis._svgSize = size;\n\t\t\tthis._container.setAttribute('width', `${size.x}`);\n\t\t\tthis._container.setAttribute('height', `${size.y}`);\n\t\t}\n\n\t\t// Reset the <SVG>'s viewBox as per _update, but skip redrawing paths.\n\t\t// This keeps paths visually aligned when resizing.\n\t\tconst b = this._bounds;\n\t\tif (b) {\n\t\t\tthis._container.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));\n\t\t}\n\t}\n\n\t_update() {\n\t\tif (this._map._animatingZoom && this._bounds) { return; }\n\n\t\tconst b = this._bounds,\n\t\tsize = b.getSize();\n\n\t\t// movement: update container viewBox so that we don't have to change coordinates of individual layers\n\t\tthis._container.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));\n\n\t\tthis.fire('update');\n\t}\n\n\t// methods below are called by vector layers implementations\n\n\t_initPath(layer) {\n\t\tconst path = layer._path = SVG.create('path');\n\n\t\tif (layer.options.className) {\n\t\t\tpath.classList.add(...splitWords(layer.options.className));\n\t\t}\n\n\t\tif (layer.options.interactive) {\n\t\t\tpath.classList.add('maplair-interactive');\n\t\t}\n\n\t\tthis._updateStyle(layer);\n\t\tthis._layers[stamp(layer)] = layer;\n\t}\n\n\t_updateInteractive(layer) {\n\t\tlayer._path.classList.toggle('maplair-interactive', !!layer.options.interactive);\n\t}\n\n\t_addPath(layer) {\n\t\tif (!this._rootGroup) { this._initContainer(); }\n\t\tthis._rootGroup.appendChild(layer._path);\n\t\tlayer.addInteractiveTarget(layer._path);\n\t}\n\n\t_removePath(layer) {\n\t\tlayer._path.remove();\n\t\tlayer.removeInteractiveTarget(layer._path);\n\t\tdelete this._layers[stamp(layer)];\n\t}\n\n\t_updatePath(layer) {\n\t\tlayer._project();\n\t\tlayer._update();\n\t}\n\n\t_updateStyle(layer) {\n\t\tconst path = layer._path,\n\t\toptions = layer.options;\n\n\t\tif (!path) { return; }\n\n\t\tif (options.stroke) {\n\t\t\tpath.setAttribute('stroke', options.color);\n\t\t\tpath.setAttribute('stroke-opacity', `${options.opacity}`);\n\t\t\tpath.setAttribute('stroke-width', `${options.weight}`);\n\t\t\tpath.setAttribute('stroke-linecap', options.lineCap);\n\t\t\tpath.setAttribute('stroke-linejoin', options.lineJoin);\n\n\t\t\tif (options.dashArray) {\n\t\t\t\tpath.setAttribute('stroke-dasharray', options.dashArray);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dasharray');\n\t\t\t}\n\n\t\t\tif (options.dashOffset) {\n\t\t\t\tpath.setAttribute('stroke-dashoffset', options.dashOffset);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dashoffset');\n\t\t\t}\n\t\t} else {\n\t\t\tpath.setAttribute('stroke', 'none');\n\t\t}\n\n\t\tif (options.fill) {\n\t\t\tpath.setAttribute('fill', options.fillColor || options.color);\n\t\t\tpath.setAttribute('fill-opacity', `${options.fillOpacity}`);\n\t\t\tpath.setAttribute('fill-rule', options.fillRule || 'evenodd');\n\t\t} else {\n\t\t\tpath.setAttribute('fill', 'none');\n\t\t}\n\t}\n\n\t_updatePoly(layer, closed) {\n\t\tthis._setPath(layer, SVG.pointsToPath(layer._parts, closed));\n\t}\n\n\t_updateCircle(layer) {\n\t\tconst p = layer._point,\n\t\tr = Math.max(Math.round(layer._pxRadius), 1),\n\t\tr2 = Math.max(Math.round(layer._pxRadiusY), 1) || r,\n\t\tarc = `a${r},${r2} 0 1,0 `;\n\n\t\t// drawing a circle with two half-arcs\n\t\tconst d = layer._empty() ? 'M0 0' :\n\t\t\t`M${p.x - r},${p.y\n\t\t\t}${arc}${r * 2},0 ${\n\t\t\t\tarc}${-r * 2},0 `;\n\n\t\tthis._setPath(layer, d);\n\t}\n\n\t_setPath(layer, path) {\n\t\tlayer._path.setAttribute('d', path);\n\t}\n\n\t// SVG does not have the concept of zIndex so we resort to changing the DOM order of elements\n\t_bringToFront(layer) {\n\t\tDomUtil.toFront(layer._path);\n\t}\n\n\t_bringToBack(layer) {\n\t\tDomUtil.toBack(layer._path);\n\t}\n\n\t/**\n\t * Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n\t * corresponding to the class name passed. For example, using 'line' will return\n\t * an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\n\t * @param {string} name\n\t * @returns {SVGElement}\n\t */\n\tstatic create(name) {\n\t\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n\t}\n\n\t/**\n\t * Generates a SVG path string for multiple rings, with each ring turning\n\t * into \"M..L..L..\" instructions.\n\t * @param {Point[][]} rings\n\t * @param {boolean} [closed]\n\t * @returns {string}\n\t */\n\tstatic pointsToPath(rings, closed) {\n\t\tconst str = rings.flatMap(points => [\n\t\t\t...points.map((p, j) => `${(j ? 'L' : 'M') + p.x} ${p.y}`),\n\t\t\t// closes the ring for polygons\n\t\t\tclosed ? 'z' : ''\n\t\t]).join('');\n\n\t\t// SVG complains about empty path strings\n\t\treturn str || 'M0 0';\n\t}\n\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,MAAb,MAAa,YAAY,SAAS;;;;;;;;;CASjC,YAAY,GAAG,MAAM;EACpB,MAAM,GAAG,IAAI;EACb,KAAK,cAAc,GAAG;CACvB;CAGA,iBAAiB;EAChB,KAAK,aAAa,IAAI,OAAO,KAAK;EAGlC,KAAK,WAAW,aAAa,kBAAkB,MAAM;EAErD,KAAK,aAAa,IAAI,OAAO,GAAG;EAChC,KAAK,WAAW,YAAY,KAAK,UAAU;CAC5C;CAEA,oBAAoB;EACnB,MAAM,kBAAkB;EACxB,OAAO,KAAK;EACZ,OAAO,KAAK;CACb;CAEA,mBAAmB;EAClB,MAAM,OAAO,MAAM,iBAAiB;EAGpC,IAAI,CAAC,KAAK,YAAY,CAAC,KAAK,SAAS,OAAO,IAAI,GAAG;GAClD,KAAK,WAAW;GAChB,KAAK,WAAW,aAAa,SAAS,GAAG,KAAK,GAAG;GACjD,KAAK,WAAW,aAAa,UAAU,GAAG,KAAK,GAAG;EACnD;EAIA,MAAM,IAAI,KAAK;EACf,IAAI,GACH,KAAK,WAAW,aAAa,WAAW;GAAC,EAAE,IAAI;GAAG,EAAE,IAAI;GAAG,KAAK;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;;;;;CASA,OAAO,aAAa,OAAO,QAAQ;EAQlC,OAPY,MAAM,SAAQ,WAAU,CACnC,GAAG,OAAO,KAAK,GAAG,MAAM,IAAI,IAAI,MAAM,OAAO,EAAE,EAAE,GAAG,EAAE,GAAG,GAEzD,SAAS,MAAM,EAChB,CAAC,CAAC,CAAC,KAAK,EAGC,KAAK;CACf;AAED"}
1
+ {"version":3,"file":"SVG.js","names":[],"sources":["../../../../src/layer/vector/SVG.js"],"sourcesContent":["import {Renderer} from './Renderer.js';\nimport * as DomUtil from '../../dom/DomUtil.js';\nimport {splitWords, stamp} from '../../core/Util.js';\n/** @import {Point} from '../../geometry/Point.js' */\n/** @import {RendererOptions} from './Renderer.js' */\n\n/**\n * Allows vector layers to be displayed with [SVG](https://developer.mozilla.org/docs/Web/SVG).\n * Inherits `Renderer`.\n *\n * @example\n * Use SVG by default for all paths in the map:\n *\n * ```js\n * const map = new MaplairMap('map', {\n * \trenderer: new SVG()\n * });\n * ```\n *\n * Use a SVG renderer with extra padding for specific vector geometries:\n *\n * ```js\n * const map = new MaplairMap('map');\n * const myRenderer = new SVG({ padding: 0.5 });\n * const line = new Polyline( coordinates, { renderer: myRenderer } );\n * const circle = new Circle( center, { renderer: myRenderer, radius: 100 } );\n * ```\n */\nexport class SVG extends Renderer {\n\t/**\n\t * Creates a SVG renderer with the given options.\n\t * @overload\n\t * @param {RendererOptions} [options]\n\t */\n\t/**\n\t * @param {...any} args\n\t */\n\tconstructor(...args) {\n\t\tsuper(...args);\n\t\tthis.callInitHooks(SVG);\n\t}\n\n\n\t_initContainer() {\n\t\tthis._container = SVG.create('svg');\n\n\t\t// makes it possible to click through svg root; we'll reset it back in individual paths\n\t\tthis._container.setAttribute('pointer-events', 'none');\n\n\t\tthis._rootGroup = SVG.create('g');\n\t\tthis._container.appendChild(this._rootGroup);\n\t}\n\n\t_destroyContainer() {\n\t\tsuper._destroyContainer();\n\t\tdelete this._rootGroup;\n\t\tdelete this._svgSize;\n\t}\n\n\t_resizeContainer() {\n\t\tconst size = super._resizeContainer();\n\n\t\t// set size of svg-container if changed\n\t\tif (!this._svgSize || !this._svgSize.equals(size)) {\n\t\t\tthis._svgSize = size;\n\t\t\tthis._container.setAttribute('width', `${size.x}`);\n\t\t\tthis._container.setAttribute('height', `${size.y}`);\n\t\t}\n\n\t\t// Reset the <SVG>'s viewBox as per _update, but skip redrawing paths.\n\t\t// This keeps paths visually aligned when resizing.\n\t\tconst b = this._bounds;\n\t\tif (b) {\n\t\t\tthis._container.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));\n\t\t}\n\t}\n\n\t_update() {\n\t\tif (this._map._animatingZoom && this._bounds) { return; }\n\n\t\tconst b = this._bounds,\n\t\tsize = b.getSize();\n\n\t\t// movement: update container viewBox so that we don't have to change coordinates of individual layers\n\t\tthis._container.setAttribute('viewBox', [b.min.x, b.min.y, size.x, size.y].join(' '));\n\n\t\tthis.fire('update');\n\t}\n\n\t// methods below are called by vector layers implementations\n\n\t_initPath(layer) {\n\t\tconst path = layer._path = SVG.create('path');\n\n\t\tif (layer.options.className) {\n\t\t\tpath.classList.add(...splitWords(layer.options.className));\n\t\t}\n\n\t\tif (layer.options.interactive) {\n\t\t\tpath.classList.add('maplair-interactive');\n\t\t}\n\n\t\tthis._updateStyle(layer);\n\t\tthis._layers[stamp(layer)] = layer;\n\t}\n\n\t_updateInteractive(layer) {\n\t\tlayer._path.classList.toggle('maplair-interactive', !!layer.options.interactive);\n\t}\n\n\t_addPath(layer) {\n\t\tif (!this._rootGroup) { this._initContainer(); }\n\t\tthis._rootGroup.appendChild(layer._path);\n\t\tlayer.addInteractiveTarget(layer._path);\n\t}\n\n\t_removePath(layer) {\n\t\tlayer._path.remove();\n\t\tlayer.removeInteractiveTarget(layer._path);\n\t\tdelete this._layers[stamp(layer)];\n\t}\n\n\t_updatePath(layer) {\n\t\tlayer._project();\n\t\tlayer._update();\n\t}\n\n\t_updateStyle(layer) {\n\t\tconst path = layer._path,\n\t\toptions = layer.options;\n\n\t\tif (!path) { return; }\n\n\t\tif (options.stroke) {\n\t\t\tpath.setAttribute('stroke', options.color);\n\t\t\tpath.setAttribute('stroke-opacity', `${options.opacity}`);\n\t\t\tpath.setAttribute('stroke-width', `${options.weight}`);\n\t\t\tpath.setAttribute('stroke-linecap', options.lineCap);\n\t\t\tpath.setAttribute('stroke-linejoin', options.lineJoin);\n\n\t\t\tif (options.dashArray) {\n\t\t\t\tpath.setAttribute('stroke-dasharray', options.dashArray);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dasharray');\n\t\t\t}\n\n\t\t\tif (options.dashOffset) {\n\t\t\t\tpath.setAttribute('stroke-dashoffset', options.dashOffset);\n\t\t\t} else {\n\t\t\t\tpath.removeAttribute('stroke-dashoffset');\n\t\t\t}\n\t\t} else {\n\t\t\tpath.setAttribute('stroke', 'none');\n\t\t}\n\n\t\tif (options.fill) {\n\t\t\tpath.setAttribute('fill', options.fillColor || options.color);\n\t\t\tpath.setAttribute('fill-opacity', `${options.fillOpacity}`);\n\t\t\tpath.setAttribute('fill-rule', options.fillRule || 'evenodd');\n\t\t} else {\n\t\t\tpath.setAttribute('fill', 'none');\n\t\t}\n\t}\n\n\t_updatePoly(layer, closed) {\n\t\tthis._setPath(layer, SVG.pointsToPath(layer._parts, closed));\n\t}\n\n\t_updateCircle(layer) {\n\t\tconst p = layer._point,\n\t\tr = Math.max(Math.round(layer._pxRadius), 1),\n\t\tr2 = Math.max(Math.round(layer._pxRadiusY), 1) || r,\n\t\tarc = `a${r},${r2} 0 1,0 `;\n\n\t\t// drawing a circle with two half-arcs\n\t\tconst d = layer._empty() ? 'M0 0' :\n\t\t\t`M${num(p.x - r)},${num(p.y)\n\t\t\t}${arc}${r * 2},0 ${\n\t\t\t\tarc}${-r * 2},0 `;\n\n\t\tthis._setPath(layer, d);\n\t}\n\n\t_setPath(layer, path) {\n\t\tlayer._path.setAttribute('d', path);\n\t}\n\n\t// SVG does not have the concept of zIndex so we resort to changing the DOM order of elements\n\t_bringToFront(layer) {\n\t\tDomUtil.toFront(layer._path);\n\t}\n\n\t_bringToBack(layer) {\n\t\tDomUtil.toBack(layer._path);\n\t}\n\n\t/**\n\t * Returns a instance of [SVGElement](https://developer.mozilla.org/docs/Web/API/SVGElement),\n\t * corresponding to the class name passed. For example, using 'line' will return\n\t * an instance of [SVGLineElement](https://developer.mozilla.org/docs/Web/API/SVGLineElement).\n\t * @param {string} name\n\t * @returns {SVGElement}\n\t */\n\tstatic create(name) {\n\t\treturn document.createElementNS('http://www.w3.org/2000/svg', name);\n\t}\n\n\t/**\n\t * Generates a SVG path string for multiple rings, with each ring turning\n\t * into \"M..L..L..\" instructions.\n\t * @param {Point[][]} rings\n\t * @param {boolean} [closed]\n\t * @returns {string}\n\t */\n\tstatic pointsToPath(rings, closed) {\n\t\tconst str = rings.flatMap(points => [\n\t\t\t...points.map((p, j) => `${(j ? 'L' : 'M') + num(p.x)} ${num(p.y)}`),\n\t\t\t// closes the ring for polygons\n\t\t\tclosed ? 'z' : ''\n\t\t]).join('');\n\n\t\t// SVG complains about empty path strings\n\t\treturn str || 'M0 0';\n\t}\n\n}\n\n// Formats a pixel coordinate with 0.1px precision. Built from integer parts because V8 stringifies small integers\n// much faster than fractional numbers, and path strings with many vertices are rebuilt on every redraw.\nfunction num(v) {\n\tconst n = Math.round(v * 10),\n\ta = n < 0 ? -n : n,\n\ti = Math.floor(a / 10),\n\td = a - i * 10;\n\treturn (n < 0 ? '-' : '') + (d ? `${i}.${d}` : i);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BA,IAAa,MAAb,MAAa,YAAY,SAAS;;;;;;;;;CASjC,YAAY,GAAG,MAAM;EACpB,MAAM,GAAG,IAAI;EACb,KAAK,cAAc,GAAG;CACvB;CAGA,iBAAiB;EAChB,KAAK,aAAa,IAAI,OAAO,KAAK;EAGlC,KAAK,WAAW,aAAa,kBAAkB,MAAM;EAErD,KAAK,aAAa,IAAI,OAAO,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K,IAAI,KAAK,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAChC;EAGlB,MAAM,IAAI,MAAM,OAAO,IAAI,SAC1B,IAAI,IAAI,EAAE,IAAI,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,IACxB,MAAM,IAAI,EAAE,KACd,MAAM,CAAC,IAAI,EAAE;EAEf,KAAK,SAAS,OAAO,CAAC;CACvB;CAEA,SAAS,OAAO,MAAM;EACrB,MAAM,MAAM,aAAa,KAAK,IAAI;CACnC;CAGA,cAAc,OAAO;EACpB,QAAgB,MAAM,KAAK;CAC5B;CAEA,aAAa,OAAO;EACnB,OAAe,MAAM,KAAK;CAC3B;;;;;;;;CASA,OAAO,OAAO,MAAM;EACnB,OAAO,SAAS,gBAAgB,8BAA8B,IAAI;CACnE;;;;;;;;CASA,OAAO,aAAa,OAAO,QAAQ;EAQlC,OAPY,MAAM,SAAQ,WAAU,CACnC,GAAG,OAAO,KAAK,GAAG,MAAM,IAAI,IAAI,MAAM,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,IAAI,EAAE,CAAC,GAAG,GAEnE,SAAS,MAAM,EAChB,CAAC,CAAC,CAAC,KAAK,EAGC,KAAK;CACf;AAED;AAIA,SAAS,IAAI,GAAG;CACf,MAAM,IAAI,KAAK,MAAM,IAAI,EAAE,GAC3B,IAAI,IAAI,IAAI,CAAC,IAAI,GACjB,IAAI,KAAK,MAAM,IAAI,EAAE,GACrB,IAAI,IAAI,IAAI;CACZ,QAAQ,IAAI,IAAI,MAAM,OAAO,IAAI,GAAG,EAAE,GAAG,MAAM;AAChD"}
@@ -1,5 +1,5 @@
1
1
  import { LatLng } from "../geo/LatLng.js";
2
- //#region src/map/Hash.js
2
+ // src/map/Hash.js
3
3
  /** @import {MaplairMap} from './Map.js' */
4
4
  /** @import {Layer} from '../layer/Layer.js' */
5
5
  const leadingHashRe = /^#/;
@@ -231,7 +231,6 @@ var Hash = class Hash {
231
231
  ].filter(Boolean).join("&")}`;
232
232
  }
233
233
  };
234
- //#endregion
235
234
  export { Hash };
236
235
 
237
236
  //# sourceMappingURL=Hash.js.map
@@ -16,9 +16,8 @@ import { LeafletMap as MaplairMap } from "./Map.js";
16
16
  import { MarkerDrag } from "../layer/marker/Marker.Drag.js";
17
17
  import { Marker } from "../layer/marker/Marker.js";
18
18
  import { GridLayer } from "../layer/tile/GridLayer.js";
19
- import "../layer/marker/Marker.Rotation.js";
20
19
  import { RotateControl } from "../control/RotateControl.js";
21
- //#region src/map/Map.Rotation.js
20
+ // src/map/Map.Rotation.js
22
21
  function normalizeBearing(bearing) {
23
22
  return (Number(bearing) % 360 + 360) % 360;
24
23
  }
@@ -27,7 +26,7 @@ function rotatePoint(point, degrees) {
27
26
  return new Point(point.x * cos - point.y * sin, point.x * sin + point.y * cos);
28
27
  }
29
28
  const rotatedMaps = /* @__PURE__ */ new WeakMap();
30
- const { panBy } = MaplairMap.prototype, { getEvents: getDivOverlayEvents } = DivOverlay.prototype, { _setPosition: setTooltipPosition } = Tooltip.prototype, { getEvents: getMarkerEvents } = Marker.prototype, { _onDown: onDraggableDown, _updatePosition: updateDraggablePosition } = Draggable.prototype, { _onPointerStart: onPinchStart } = PinchZoomHandler.prototype, { _onDown: onTapDragDown } = TapDragZoomHandler.prototype, { _pinchTo: pinchTo } = ScrollWheelZoomHandler.prototype;
29
+ const { panBy } = MaplairMap.prototype, { getEvents: getDivOverlayEvents } = DivOverlay.prototype, { _setPosition: setTooltipPosition } = Tooltip.prototype, { getEvents: getMarkerEvents, _positionElements: positionMarkerElements } = Marker.prototype, { _onDown: onDraggableDown, _updatePosition: updateDraggablePosition } = Draggable.prototype, { _onPointerStart: onPinchStart } = PinchZoomHandler.prototype, { _onDown: onTapDragDown } = TapDragZoomHandler.prototype, { _pinchTo: pinchTo } = ScrollWheelZoomHandler.prototype;
31
30
  /**
32
31
  * Map options of the map rotation (`maplair/map-rotation`).
33
32
  * @typedef {object} RotationMapOptions
@@ -273,7 +272,7 @@ DivOverlay.include({
273
272
  },
274
273
  _updatePosition() {
275
274
  if (!this._map) return;
276
- const map = this._map, pos = map.latLngToLayerPoint(this._latlng), anchor = map._rotateToPane(new Point(this._getAnchor()));
275
+ const map = this._map, pos = map.latLngToLayerPoint(this._latlng)._round(), anchor = map._rotateToPane(new Point(this._getAnchor()));
277
276
  let offset = Point.from(this.options.offset);
278
277
  const transformed = this._zoomAnimated || this.options.overflow || map._bearing;
279
278
  if (!transformed) offset = offset.add(pos).add(anchor);
@@ -341,19 +340,36 @@ Tooltip.include({ _setPosition(pos) {
341
340
  container.style.top = `${delta.y}px`;
342
341
  this._setContainerPosition(pos, `${-delta.x - margin[0]}px ${-delta.y - margin[1]}px`);
343
342
  } });
344
- /** @typedef {typeof markerRotationMethods} MarkerMapRotationMethods */
345
- Marker.include({
346
343
  /**
347
- * Overrides `getEvents()` of `Marker` to update the marker on rotation.
348
- * @internal
349
- * @returns {Record<string, Function>}
344
+ * Options of `Marker` for the map rotation.
345
+ * @typedef {object} MarkerMapRotationOptions
346
+ * @lends MarkerOptions
347
+ * @property {boolean} [rotateWithView=false] On a rotated map (see
348
+ * `MaplairMap.setBearing()`), whether the icon rotates with the map (e.g. for arrows
349
+ * pointing in a geographic direction) instead of staying upright. The `rotation` of
350
+ * the marker is relative to the screen, or to north with `rotateWithView`.
350
351
  */
351
- getEvents() {
352
- return {
353
- ...getMarkerEvents.call(this),
354
- rotate: this.update
355
- };
356
- } });
352
+ Marker.include({ options: { rotateWithView: false } });
353
+ /** @typedef {typeof markerRotationMethods} MarkerMapRotationMethods */
354
+ Marker.include({
355
+ /**
356
+ * Overrides `getEvents()` of `Marker` to update the marker on rotation.
357
+ * @internal
358
+ * @returns {Record<string, Function>}
359
+ */
360
+ getEvents() {
361
+ return {
362
+ ...getMarkerEvents.call(this),
363
+ rotate: this.update
364
+ };
365
+ },
366
+ _positionElements(pos) {
367
+ positionMarkerElements.call(this, pos);
368
+ const bearing = this.options.rotateWithView ? 0 : this._map?.getBearing() ?? 0;
369
+ if (!bearing) return;
370
+ for (const el of [this._icon, this._shadow]) if (el) el.style.transform += ` rotate(${bearing}deg)`;
371
+ }
372
+ });
357
373
  /** @typedef {typeof markerDragRotationMethods} MarkerDragMapRotationMethods */
358
374
  MarkerDrag.include({ _adjustPan(e) {
359
375
  const marker = this._marker, map = marker._map, speed = this._marker.options.autoPanSpeed, padding = this._marker.options.autoPanPadding, iconPos = getPosition(marker._icon), bounds = map.getPixelBounds(), origin = map.getPixelOrigin();
@@ -498,7 +514,6 @@ ScrollWheelZoomHandler.include({
498
514
  this._panTimer = setTimeout(this._endPan.bind(this), gestureEndDelay);
499
515
  }
500
516
  });
501
- //#endregion
502
517
  export { RotateControl };
503
518
 
504
519
  //# sourceMappingURL=Map.Rotation.js.map
@@ -1 +1 @@
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 '../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 || 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),\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\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":";;;;;;;;;;;;;;;;;;;;;AA4BA,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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I,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;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cAAc,KAAK,MAAM,CAAC;CAE1B,IAAI,KAAK,YAAY,KAAK,eACzB,KAAK,gBAAgB,KAAK,KAAK,cAAc,KAAK,aAAa;AAEjE,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"}
@@ -27,7 +27,7 @@ import { PinchZoomHandler } from "./handler/PinchZoomHandler.js";
27
27
  import { ScrollWheelZoomHandler } from "./handler/ScrollWheelZoomHandler.js";
28
28
  import { TapHoldHandler } from "./handler/TapHoldHandler.js";
29
29
  import { TapDragZoomHandler } from "./handler/TapDragZoomHandler.js";
30
- //#region src/map/Map.js
30
+ // src/map/Map.js
31
31
  /** @import {LatLngExpression} from '../geo/LatLng.js' */
32
32
  /** @import {LatLngBoundsExpression} from '../geo/LatLngBounds.js' */
33
33
  /** @import {PointExpression} from '../geometry/Point.js' */
@@ -400,7 +400,7 @@ var MaplairMap = class MaplairMap extends Evented {
400
400
  * @returns {this}
401
401
  */
402
402
  setZoomAround(latlng, zoom, options) {
403
- const scale = this.getZoomScale(zoom), viewHalf = this.getSize().divideBy(2), centerOffset = (latlng instanceof Point ? latlng : this.latLngToContainerPoint(latlng)).subtract(viewHalf).multiplyBy(1 - 1 / scale), newCenter = this.containerPointToLatLng(viewHalf.add(centerOffset));
403
+ const center = this.project(this.getCenter()), offset = latlng instanceof Point ? this.containerPointToLayerPoint(latlng).subtract(this.containerPointToLayerPoint(this.getSize().divideBy(2))) : this.project(latlng).subtract(center), newCenter = this.unproject(center.add(offset.multiplyBy(1 - 1 / this.getZoomScale(zoom))));
404
404
  return this.setView(newCenter, zoom, { zoom: options });
405
405
  }
406
406
  _getBoundsCenterZoom(bounds, options) {
@@ -522,9 +522,6 @@ var MaplairMap = class MaplairMap extends Evented {
522
522
  return -Math.asinh(t1 / b1);
523
523
  }
524
524
  const r0 = r(0);
525
- function w(s) {
526
- return w0 * (Math.cosh(r0) / Math.cosh(r0 + rho * s));
527
- }
528
525
  function u(s) {
529
526
  return w0 * (Math.cosh(r0) * Math.tanh(r0 + rho * s) - Math.sinh(r0)) / rho2;
530
527
  }
@@ -536,7 +533,7 @@ var MaplairMap = class MaplairMap extends Evented {
536
533
  const t = (Date.now() - start) / duration, s = easeOut(t) * S;
537
534
  if (t <= 1) {
538
535
  this._flyToFrame = requestAnimationFrame(frame);
539
- this._move(this.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom), this.getScaleZoom(w0 / w(s), startZoom), { flyTo: true });
536
+ this._move(this.unproject(from.add(to.subtract(from).multiplyBy(u(s) / u1)), startZoom), this.getScaleZoom(Math.cosh(r0 + rho * s) / Math.cosh(r0), startZoom), { flyTo: true });
540
537
  } else {
541
538
  const zoomChanged = this._zoom !== targetZoom;
542
539
  this._move(targetCenter, targetZoom);
@@ -864,7 +861,7 @@ var MaplairMap = class MaplairMap extends Evented {
864
861
  */
865
862
  getCenter() {
866
863
  this._checkIfLoaded();
867
- if (this._lastCenter && !this._moved()) return new LatLng(this._lastCenter);
864
+ if (this._lastCenter && this._getMapPanePos().equals(this._lastCenterPanePos)) return new LatLng(this._lastCenter);
868
865
  return this.layerPointToLatLng(this._getCenterLayerPoint());
869
866
  }
870
867
  /**
@@ -1068,7 +1065,7 @@ var MaplairMap = class MaplairMap extends Evented {
1068
1065
  * @returns {Point}
1069
1066
  */
1070
1067
  latLngToLayerPoint(latlng) {
1071
- return this.project(LatLng.from(latlng))._round()._subtract(this.getPixelOrigin());
1068
+ return this.project(LatLng.from(latlng))._subtract(this.getPixelOrigin());
1072
1069
  }
1073
1070
  /**
1074
1071
  * Returns a `LatLng` where `lat` and `lng` has been wrapped according to the
@@ -1318,6 +1315,7 @@ var MaplairMap = class MaplairMap extends Evented {
1318
1315
  const zoomChanged = this._zoom !== zoom;
1319
1316
  this._zoom = zoom;
1320
1317
  this._lastCenter = center;
1318
+ this._lastCenterPanePos = this._getMapPanePos();
1321
1319
  this._pixelOrigin = this._getNewPixelOrigin(center);
1322
1320
  if (!suppressEvent) {
1323
1321
  if (zoomChanged || data?.pinch) this.fire("zoom", data);
@@ -1430,10 +1428,10 @@ var MaplairMap = class MaplairMap extends Evented {
1430
1428
  const target = targets[0];
1431
1429
  const data = { originalEvent: e };
1432
1430
  if (e.type !== "keydown" && e.type !== "keyup") {
1433
- const isMarker = target.getLatLng && (!target._pxRadius || target._pxRadius <= 10);
1434
- data.containerPoint = isMarker ? this.latLngToContainerPoint(target.getLatLng()) : this.pointerEventToContainerPoint(e);
1431
+ const latlng = (!target._pxRadius || target._pxRadius <= 10) && target.getLatLng?.();
1432
+ data.containerPoint = latlng ? this.latLngToContainerPoint(latlng) : this.pointerEventToContainerPoint(e);
1435
1433
  data.layerPoint = this.containerPointToLayerPoint(data.containerPoint);
1436
- data.latlng = isMarker ? target.getLatLng() : this.layerPointToLatLng(data.layerPoint);
1434
+ data.latlng = latlng || this.layerPointToLatLng(data.layerPoint);
1437
1435
  }
1438
1436
  for (const t of targets) {
1439
1437
  t.fire(type, data, true);
@@ -1462,10 +1460,6 @@ var MaplairMap = class MaplairMap extends Evented {
1462
1460
  _getMapPanePos() {
1463
1461
  return getPosition(this._mapPane);
1464
1462
  }
1465
- _moved() {
1466
- const pos = this._getMapPanePos();
1467
- return pos && !pos.equals([0, 0]);
1468
- }
1469
1463
  _getTopLeftPoint(center, zoom) {
1470
1464
  return (center && zoom !== void 0 ? this._getNewPixelOrigin(center, zoom) : this.getPixelOrigin()).subtract(this._getMapPanePos());
1471
1465
  }
@@ -1481,7 +1475,7 @@ var MaplairMap = class MaplairMap extends Evented {
1481
1475
  return this.containerPointToLayerPoint(this.getSize()._divideBy(2));
1482
1476
  }
1483
1477
  _getCenterOffset(latlng) {
1484
- return this.latLngToLayerPoint(latlng).subtract(this._getCenterLayerPoint());
1478
+ return this.latLngToLayerPoint(latlng)._round()._subtract(this._getCenterLayerPoint());
1485
1479
  }
1486
1480
  _limitCenter(center, zoom, bounds) {
1487
1481
  if (!bounds) return center;
@@ -1628,7 +1622,6 @@ for (const feature of [
1628
1622
  ZoomControl,
1629
1623
  FullscreenControl
1630
1624
  ]) feature.register(MaplairMap);
1631
- //#endregion
1632
1625
  export { MaplairMap as LeafletMap, MaplairMap as Map, MaplairMap };
1633
1626
 
1634
1627
  //# sourceMappingURL=Map.js.map