maplair 4.3.0 → 4.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +151 -8
- package/dist/esm/control/AttributionControl.js +30 -13
- package/dist/esm/control/AttributionControl.js.map +1 -1
- package/dist/esm/control/ButtonControl.js +0 -1
- package/dist/esm/control/ButtonControl.js.map +1 -1
- package/dist/esm/control/ContextMenu.js +1 -1
- package/dist/esm/control/ContextMenu.js.map +1 -1
- package/dist/esm/control/Control.js +16 -11
- package/dist/esm/control/Control.js.map +1 -1
- package/dist/esm/control/FullscreenControl.js +0 -1
- package/dist/esm/control/FullscreenControl.js.map +1 -1
- package/dist/esm/control/LayersControl.js +46 -27
- package/dist/esm/control/LayersControl.js.map +1 -1
- package/dist/esm/control/RotateControl.js +0 -1
- package/dist/esm/control/RotateControl.js.map +1 -1
- package/dist/esm/control/ScaleControl.js +7 -8
- package/dist/esm/control/ScaleControl.js.map +1 -1
- package/dist/esm/control/SideBySideControl.js +3 -2
- package/dist/esm/control/SideBySideControl.js.map +1 -1
- package/dist/esm/control/ZoomControl.js +14 -13
- package/dist/esm/control/ZoomControl.js.map +1 -1
- package/dist/esm/core/Events.js +3 -2
- package/dist/esm/core/Events.js.map +1 -1
- package/dist/esm/core/Util.js +17 -5
- package/dist/esm/core/Util.js.map +1 -1
- package/dist/esm/dom/DomEvent.PointerEvents.js +72 -2
- package/dist/esm/dom/DomEvent.PointerEvents.js.map +1 -1
- package/dist/esm/dom/DomEvent.js +4 -7
- package/dist/esm/dom/DomEvent.js.map +1 -1
- package/dist/esm/dom/DomUtil.js +5 -5
- package/dist/esm/dom/DomUtil.js.map +1 -1
- package/dist/esm/dom/Draggable.js +10 -8
- package/dist/esm/dom/Draggable.js.map +1 -1
- package/dist/esm/geo/LatLng.js +24 -35
- package/dist/esm/geo/LatLng.js.map +1 -1
- package/dist/esm/geo/LatLngBounds.js +6 -3
- package/dist/esm/geo/LatLngBounds.js.map +1 -1
- package/dist/esm/geometry/Bounds.js +2 -2
- package/dist/esm/geometry/Bounds.js.map +1 -1
- package/dist/esm/geometry/Point.js +16 -19
- package/dist/esm/geometry/Point.js.map +1 -1
- package/dist/esm/geometry/PolyUtil.js +10 -3
- package/dist/esm/geometry/PolyUtil.js.map +1 -1
- package/dist/esm/geometry/Transformation.js +1 -7
- package/dist/esm/geometry/Transformation.js.map +1 -1
- package/dist/esm/layer/BlanketOverlay.js +3 -2
- package/dist/esm/layer/BlanketOverlay.js.map +1 -1
- package/dist/esm/layer/DivOverlay.js +25 -25
- package/dist/esm/layer/DivOverlay.js.map +1 -1
- package/dist/esm/layer/ImageOverlay.js +8 -5
- package/dist/esm/layer/ImageOverlay.js.map +1 -1
- package/dist/esm/layer/Layer.js +12 -7
- package/dist/esm/layer/Layer.js.map +1 -1
- package/dist/esm/layer/Popup.js +33 -15
- package/dist/esm/layer/Popup.js.map +1 -1
- package/dist/esm/layer/Tooltip.js +48 -56
- package/dist/esm/layer/Tooltip.js.map +1 -1
- package/dist/esm/layer/VideoOverlay.js +2 -2
- package/dist/esm/layer/VideoOverlay.js.map +1 -1
- package/dist/esm/layer/marker/DivIcon.js +4 -8
- package/dist/esm/layer/marker/DivIcon.js.map +1 -1
- package/dist/esm/layer/marker/Icon.js +37 -17
- package/dist/esm/layer/marker/Icon.js.map +1 -1
- package/dist/esm/layer/marker/Marker.Drag.js +11 -12
- package/dist/esm/layer/marker/Marker.Drag.js.map +1 -1
- package/dist/esm/layer/marker/Marker.js +54 -53
- package/dist/esm/layer/marker/Marker.js.map +1 -1
- package/dist/esm/layer/marker/SvgIcon.js +1 -1
- package/dist/esm/layer/marker/SvgIcon.js.map +1 -1
- package/dist/esm/layer/tile/GridLayer.js +29 -21
- package/dist/esm/layer/tile/GridLayer.js.map +1 -1
- package/dist/esm/layer/tile/TileLayer.js +19 -15
- package/dist/esm/layer/tile/TileLayer.js.map +1 -1
- package/dist/esm/layer/tile/WMSTileLayer.js +7 -3
- package/dist/esm/layer/tile/WMSTileLayer.js.map +1 -1
- package/dist/esm/layer/vector/Canvas.js +45 -94
- package/dist/esm/layer/vector/Canvas.js.map +1 -1
- package/dist/esm/layer/vector/Circle.js +8 -9
- package/dist/esm/layer/vector/Circle.js.map +1 -1
- package/dist/esm/layer/vector/CircleMarker.js +15 -4
- package/dist/esm/layer/vector/CircleMarker.js.map +1 -1
- package/dist/esm/layer/vector/Path.ZoomStyles.js +4 -1
- package/dist/esm/layer/vector/Path.ZoomStyles.js.map +1 -1
- package/dist/esm/layer/vector/Path.js +10 -5
- package/dist/esm/layer/vector/Path.js.map +1 -1
- package/dist/esm/layer/vector/Polygon.js +10 -11
- package/dist/esm/layer/vector/Polygon.js.map +1 -1
- package/dist/esm/layer/vector/Polyline.js +19 -26
- package/dist/esm/layer/vector/Polyline.js.map +1 -1
- package/dist/esm/layer/vector/Renderer.getRenderer.js +2 -1
- package/dist/esm/layer/vector/Renderer.getRenderer.js.map +1 -1
- package/dist/esm/layer/vector/Renderer.js +16 -0
- package/dist/esm/layer/vector/Renderer.js.map +1 -1
- package/dist/esm/layer/vector/SVG.js +3 -3
- package/dist/esm/layer/vector/SVG.js.map +1 -1
- package/dist/esm/map/Map.Rotation.js +9 -11
- package/dist/esm/map/Map.Rotation.js.map +1 -1
- package/dist/esm/map/Map.js +158 -71
- package/dist/esm/map/Map.js.map +1 -1
- package/dist/esm/map/MapSync.js +2 -5
- package/dist/esm/map/MapSync.js.map +1 -1
- package/dist/esm/map/handler/BoxZoomHandler.js +4 -0
- package/dist/esm/map/handler/BoxZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/DisplaceHandler.js +68 -30
- package/dist/esm/map/handler/DisplaceHandler.js.map +1 -1
- package/dist/esm/map/handler/DragHandler.js +7 -2
- package/dist/esm/map/handler/DragHandler.js.map +1 -1
- package/dist/esm/map/handler/KeyboardHandler.js +3 -5
- package/dist/esm/map/handler/KeyboardHandler.js.map +1 -1
- package/dist/esm/map/handler/PinchZoomHandler.js +4 -7
- package/dist/esm/map/handler/PinchZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/ScrollWheelZoomHandler.js +4 -7
- package/dist/esm/map/handler/ScrollWheelZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/TapDragZoomHandler.js +2 -5
- package/dist/esm/map/handler/TapDragZoomHandler.js.map +1 -1
- package/dist/esm/map/handler/TapHoldHandler.js +8 -20
- package/dist/esm/map/handler/TapHoldHandler.js.map +1 -1
- package/dist/esm/package.js +1 -1
- package/dist/maplair-global-src.js +970 -810
- package/dist/maplair-global-src.js.map +1 -1
- package/dist/maplair-global.js +2 -2
- package/dist/maplair-global.js.map +1 -1
- package/dist/maplair-src.js +970 -810
- package/dist/maplair-src.js.map +1 -1
- package/dist/maplair.css +1 -1
- package/dist/maplair.js +2 -2
- package/dist/maplair.js.map +1 -1
- package/i18n/en.json +1 -0
- package/package.json +1 -1
- package/src/control/AttributionControl.js +37 -11
- package/src/control/ButtonControl.js +0 -1
- package/src/control/ContextMenu.js +1 -1
- package/src/control/Control.js +13 -16
- package/src/control/FullscreenControl.js +0 -1
- package/src/control/LayersControl.js +61 -37
- package/src/control/RotateControl.js +0 -1
- package/src/control/ScaleControl.js +10 -8
- package/src/control/SideBySideControl.js +4 -2
- package/src/control/ZoomControl.js +11 -13
- package/src/core/Events.js +6 -2
- package/src/core/Util.js +17 -4
- package/src/dom/DomEvent.PointerEvents.js +68 -2
- package/src/dom/DomEvent.js +5 -17
- package/src/dom/DomUtil.js +5 -5
- package/src/dom/Draggable.js +11 -8
- package/src/geo/LatLng.js +24 -37
- package/src/geo/LatLngBounds.js +10 -4
- package/src/geometry/Bounds.js +3 -3
- package/src/geometry/Point.js +22 -28
- package/src/geometry/PolyUtil.js +12 -3
- package/src/geometry/Transformation.js +1 -8
- package/src/layer/BlanketOverlay.js +6 -3
- package/src/layer/DivOverlay.js +30 -32
- package/src/layer/ImageOverlay.js +12 -9
- package/src/layer/Layer.js +19 -7
- package/src/layer/Popup.js +41 -21
- package/src/layer/Tooltip.js +50 -70
- package/src/layer/VideoOverlay.js +2 -2
- package/src/layer/marker/DivIcon.js +3 -6
- package/src/layer/marker/Icon.js +41 -20
- package/src/layer/marker/Marker.Drag.js +22 -24
- package/src/layer/marker/Marker.js +71 -64
- package/src/layer/marker/SvgIcon.js +1 -1
- package/src/layer/tile/GridLayer.js +41 -30
- package/src/layer/tile/TileLayer.js +31 -21
- package/src/layer/tile/WMSTileLayer.js +4 -2
- package/src/layer/vector/Canvas.js +53 -149
- package/src/layer/vector/Circle.js +13 -13
- package/src/layer/vector/CircleMarker.js +16 -3
- package/src/layer/vector/Path.ZoomStyles.js +5 -3
- package/src/layer/vector/Path.js +11 -5
- package/src/layer/vector/Polygon.js +11 -10
- package/src/layer/vector/Polyline.js +20 -21
- package/src/layer/vector/Renderer.getRenderer.js +2 -1
- package/src/layer/vector/Renderer.js +21 -3
- package/src/layer/vector/SVG.js +3 -3
- package/src/map/Map.Rotation.js +13 -9
- package/src/map/Map.js +195 -83
- package/src/map/MapSync.js +2 -2
- package/src/map/handler/BoxZoomHandler.js +5 -0
- package/src/map/handler/DisplaceHandler.js +53 -7
- package/src/map/handler/DragHandler.js +5 -5
- package/src/map/handler/KeyboardHandler.js +5 -10
- package/src/map/handler/PinchZoomHandler.js +4 -4
- package/src/map/handler/ScrollWheelZoomHandler.js +4 -4
- package/src/map/handler/TapDragZoomHandler.js +2 -2
- package/src/map/handler/TapHoldHandler.js +13 -25
- package/src/maplair.css +50 -10
- package/dist/esm/dom/DomEvent.DoubleTap.js +0 -90
- package/dist/esm/dom/DomEvent.DoubleTap.js.map +0 -1
- package/src/dom/DomEvent.DoubleTap.js +0 -143
|
@@ -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${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,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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AAM,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
|
+
{"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.append(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?.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.append(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),\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IAAI,IAAI;CACZ,QAAQ,IAAI,IAAI,MAAM,OAAO,IAAI,GAAG,EAAE,GAAG,MAAM;AAChD"}
|
|
@@ -87,8 +87,8 @@ MaplairMap.include({
|
|
|
87
87
|
if (!this._rotatePane) {
|
|
88
88
|
const rotatePane = this._rotatePane = create("div", "maplair-rotate-pane");
|
|
89
89
|
rotatedMaps.set(rotatePane, this);
|
|
90
|
-
this.
|
|
91
|
-
rotatePane.
|
|
90
|
+
this._mapPane.before(rotatePane);
|
|
91
|
+
rotatePane.append(this._mapPane);
|
|
92
92
|
}
|
|
93
93
|
if (bearing === this.getBearing()) return;
|
|
94
94
|
this._bearing = bearing;
|
|
@@ -177,9 +177,9 @@ MaplairMap.include({
|
|
|
177
177
|
return panBy.call(this, this._rotateToPane(Point.from(offset)), options);
|
|
178
178
|
},
|
|
179
179
|
_tryAnimatedPan(center, options) {
|
|
180
|
-
const offset = this.
|
|
181
|
-
if (options?.animate !== true && !this.getSize().contains(offset)) return false;
|
|
182
|
-
this.
|
|
180
|
+
const offset = this.latLngToLayerPoint(center)._subtract(this._getCenterLayerPoint())._round();
|
|
181
|
+
if (options?.animate !== true && !this.getSize().contains(this._rotateToContainer(offset))) return false;
|
|
182
|
+
this._panBy(offset, options);
|
|
183
183
|
return true;
|
|
184
184
|
},
|
|
185
185
|
/**
|
|
@@ -237,7 +237,8 @@ GridLayer.include({ _getTiledPixelBounds(center) {
|
|
|
237
237
|
/** @typedef {typeof blanketOverlayRotationMethods} BlanketOverlayMapRotationMethods */
|
|
238
238
|
BlanketOverlay.include({
|
|
239
239
|
_updateTransform(center, zoom) {
|
|
240
|
-
const scale = this._map.getZoomScale(zoom, this._zoom), viewHalf = this._map._getViewSize().multiplyBy(.5 + this.options.padding), currentCenterPoint = this._map.project(this._center, zoom), topLeftOffset = viewHalf.multiplyBy(-scale)._add(currentCenterPoint)._subtract(this._map._getNewPixelOrigin(center, zoom))
|
|
240
|
+
const scale = this._map.getZoomScale(zoom, this._zoom), viewHalf = this._map._getViewSize().multiplyBy(.5 + this.options.padding), currentCenterPoint = this._map.project(this._center, zoom), topLeftOffset = viewHalf.multiplyBy(-scale)._add(currentCenterPoint)._subtract(this._map._getNewPixelOrigin(center, zoom));
|
|
241
|
+
if (scale === 1) this._map._snapLayerPoint(topLeftOffset);
|
|
241
242
|
setTransform(this._container, topLeftOffset, scale);
|
|
242
243
|
},
|
|
243
244
|
_onMoveEnd(ev) {
|
|
@@ -272,7 +273,7 @@ DivOverlay.include({
|
|
|
272
273
|
},
|
|
273
274
|
_updatePosition() {
|
|
274
275
|
if (!this._map) return;
|
|
275
|
-
const map = this._map, pos = map.latLngToLayerPoint(this._latlng)
|
|
276
|
+
const map = this._map, pos = map._snapLayerPoint(map.latLngToLayerPoint(this._latlng)), anchor = map._rotateToPane(new Point(this._getAnchor()));
|
|
276
277
|
let offset = Point.from(this.options.offset);
|
|
277
278
|
const transformed = this._zoomAnimated || this.options.overflow || map._bearing;
|
|
278
279
|
if (!transformed) offset = offset.add(pos).add(anchor);
|
|
@@ -471,10 +472,7 @@ PinchZoomHandler.include({
|
|
|
471
472
|
this._moved = true;
|
|
472
473
|
}
|
|
473
474
|
cancelAnimationFrame(this._animRequest);
|
|
474
|
-
const moveFn = map._move.bind(map, this._center, this._zoom, {
|
|
475
|
-
pinch: true,
|
|
476
|
-
round: false
|
|
477
|
-
}, void 0);
|
|
475
|
+
const moveFn = map._move.bind(map, this._center, this._zoom, { pinch: true }, void 0);
|
|
478
476
|
this._animRequest = requestAnimationFrame(moveFn.bind(this));
|
|
479
477
|
e.preventDefault();
|
|
480
478
|
}
|
|
@@ -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 {DragHandler} from './handler/DragHandler.js';\nimport {PinchZoomHandler} from './handler/PinchZoomHandler.js';\nimport {ScrollWheelZoomHandler} from './handler/ScrollWheelZoomHandler.js';\nimport {TapDragZoomHandler} from './handler/TapDragZoomHandler.js';\nimport {RotateControl} from '../control/RotateControl.js';\n/** @import {MaplairEvent} from '../core/Events.js' */\n/** @import {LatLng} from '../geo/LatLng.js' */\n/** @import {PointExpression} from '../geometry/Point.js' */\n/** @import {PanOptions, InvalidateSizeOptions} from './Map.js' */\n\nexport {RotateControl};\n\n// The bearing in degrees in the range [0, 360)\nfunction normalizeBearing(bearing) {\n\treturn ((Number(bearing) % 360) + 360) % 360;\n}\n\n// Rotates `point` clockwise (on the screen) by `degrees` around the origin\nfunction rotatePoint(point, degrees) {\n\tconst angle = degrees * Math.PI / 180,\n\tcos = Math.cos(angle),\n\tsin = Math.sin(angle);\n\treturn new Point(point.x * cos - point.y * sin, point.x * sin + point.y * cos);\n}\n\n// The maps of the rotated panes, see `Draggable`\nconst rotatedMaps = new WeakMap();\n\n// Possible size savings: about 60% of the code of this module (about 7–8 kB of\n// its 13 kB minified) are copies of core methods, which are overridden because\n// the rotation changes a computation in their middle:\n// * Popup#_adjustPan, MarkerDrag#_adjustPan, DragHandler#_onDragEnd: the offsets\n// for panBy() in container pixels (about 1.1–1.3 kB each)\n// * PinchZoomHandler#_onPointerMove (1.6 kB) and ScrollWheelZoomHandler#_panBy:\n// the rotation by two fingers, the pinch and pan offsets in the rotated frame\n// * MaplairMap#invalidateSize, #_tryAnimatedPan, #_continuousZoom, #getPixelBounds,\n// GridLayer#_getTiledPixelBounds, BlanketOverlay#_updateTransform, #_onMoveEnd,\n// #_resizeContainer, DivOverlay#_updatePosition, #_setContainerPosition,\n// Popup#_animateZoom: the bounding box of the rotated view, the upright overlays\n// Most of these copies could be replaced by small extension points in the core\n// classes, which this module overrides instead: e.g. MaplairMap#_rotateToPane(offset),\n// #_rotateToContainer(offset) and #_getViewSize() returning the offset or size\n// unchanged, used where the copied methods differ (well below 1 kB in core, for\n// all maps); or by splitting the core methods, so that the computations in\n// question become methods of their own (e.g. the pinch center from the offset of\n// the fingers, the inertia offset, the box of a popup in container pixels).\n// Both would change the pre-existing classes, which this module leaves untouched.\n\n// The methods extended below\nconst {panBy} = MaplairMap.prototype,\n{getEvents: getDivOverlayEvents} = DivOverlay.prototype,\n{_setPosition: setTooltipPosition} = Tooltip.prototype,\n{getEvents: getMarkerEvents, _positionElements: positionMarkerElements} = Marker.prototype,\n{_onDown: onDraggableDown, _updatePosition: updateDraggablePosition} = Draggable.prototype,\n{_onPointerStart: onPinchStart} = PinchZoomHandler.prototype,\n{_onDown: onTapDragDown} = TapDragZoomHandler.prototype,\n{_pinchTo: pinchTo} = ScrollWheelZoomHandler.prototype;\n\n/**\n * Map options of the map rotation (`maplair/map-rotation`).\n * @typedef {object} RotationMapOptions\n * @lends MaplairMapOptions\n * @property {number} [bearing=0] Initial rotation of the map in degrees: the compass\n * direction pointing up, clockwise from north (e.g. `90` for east up), see\n * `setBearing()`.\n * @property {boolean} [pinchRotate=false] Whether the map can be rotated by turning two\n * fingers, see `setBearing()`.\n */\n\nMaplairMap.mergeOptions({\n\tbearing: 0,\n\tpinchRotate: false\n});\n\nMaplairMap.addInitHook(function () {\n\tif (this.options.bearing || this.options.pinchRotate || this.options.rotateControl) {\n\t\tthis._rotate(this.options.bearing);\n\t\tif (this._loaded) {\n\t\t\tthis.fire('moveend');\n\t\t}\n\t}\n});\n\nRotateControl.register(MaplairMap);\n\n/**\n * Methods of `MaplairMap` for the map rotation. The rotation of the map is an optional\n * feature: import this module (`maplair/map-rotation`) to add the `bearing`,\n * `pinchRotate` and `rotateControl` options, `setBearing()`, `getBearing()` and the\n * `rotate` event to `MaplairMap`, and the `RotateControl`. Maps not using it don't\n * contain its code.\n *\n * The map pane is wrapped in a pane rotated around the center of the container.\n * Container/layer point conversions, `getPixelBounds()` and `getBounds()` account\n * for the rotation; grid layers and vector renderers cover the bounding box of\n * the rotated view; markers, popups and tooltips stay upright (see the Marker\n * option `rotateWithView`); dragging, `panBy()`, the keyboard, pinch, tap-drag,\n * touchpad and continuous zoom work in container pixels.\n *\n * @example\n * ```js\n * import {MaplairMap} from 'maplair';\n * import {RotateControl} from 'maplair/map-rotation';\n *\n * const map = new MaplairMap('map', {bearing: 30, pinchRotate: true, rotateControl: true});\n * ```\n *\n * @lends MaplairMap.prototype\n * @fires MaplairMap#rotate {MaplairEvent} Fired when the bearing of the map changes,\n * see `setBearing()`.\n */\nconst mapRotationMethods = {\n\t/**\n\t * Rotates the map around the center of the view, so that the compass direction\n\t * `bearing` (in degrees, clockwise from north) points up. Markers, popups and\n\t * tooltips stay upright. With `{animate: true}`, the map rotates smoothly (the\n\t * shorter way round).\n\t * @group Map rotation\n\t * @param {number} bearing\n\t * @param {{animate?: boolean}} [options]\n\t * @returns {this}\n\t */\n\tsetBearing(bearing, options) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tconst from = this.getBearing();\n\t\tif (!this._rotatePane && !bearing) { return this; }\n\t\tif (bearing === from) { return this; }\n\n\t\tthis._stop();\n\t\tif (!options?.animate || !this._loaded || this._prefersReducedMotion()) {\n\t\t\tthis._rotate(bearing);\n\t\t\treturn this._loaded ? this.fire('movestart').fire('move').fire('moveend') : this;\n\t\t}\n\n\t\t// the shorter way round\n\t\tconst delta = ((bearing - from + 540) % 360) - 180,\n\t\tstart = performance.now(),\n\t\tduration = 250;\n\t\tthis.fire('movestart');\n\t\tconst frame = () => {\n\t\t\tconst t = Math.min(1, (performance.now() - start) / duration);\n\t\t\tthis._rotate(from + delta * (1 - (1 - t) ** 2));\n\t\t\tthis.fire('move');\n\t\t\tif (t < 1) {\n\t\t\t\t// cancelled by `_stop()`\n\t\t\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\t\t} else {\n\t\t\t\tthis.fire('moveend');\n\t\t\t}\n\t\t};\n\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\treturn this;\n\t},\n\n\t// Applies the bearing without the events of a view change (e.g. while pinching)\n\t_rotate(bearing) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tif (!this._rotatePane) {\n\t\t\t// the map pane is wrapped in a pane rotated around the center of the container\n\t\t\tconst rotatePane = this._rotatePane = DomUtil.create('div', 'maplair-rotate-pane');\n\t\t\trotatedMaps.set(rotatePane, this);\n\t\t\tthis._container.insertBefore(rotatePane, this._mapPane);\n\t\t\trotatePane.appendChild(this._mapPane);\n\t\t}\n\t\tif (bearing === this.getBearing()) { return; }\n\n\t\tthis._bearing = bearing;\n\t\tthis._rotatePane.style.transform = bearing ? `rotate(${-bearing}deg)` : '';\n\n\t\tif (this._loaded) {\n\t\t\tthis.fire('rotate');\n\t\t}\n\t},\n\n\t/**\n\t * Returns the rotation of the map, see `setBearing()`.\n\t * @group Map rotation\n\t * @returns {number}\n\t */\n\tgetBearing() {\n\t\treturn this._bearing ?? 0;\n\t},\n\n\t// Rotates an offset in container (screen) pixels to the frame of the rotated map pane\n\t_rotateToPane(point) {\n\t\treturn this._bearing ? rotatePoint(point, this._bearing) : point;\n\t},\n\n\t// Rotates an offset in the frame of the rotated map pane to container (screen) pixels\n\t_rotateToContainer(point) {\n\t\treturn this._bearing ? rotatePoint(point, -this._bearing) : point;\n\t},\n\n\t// The size of the bounding box of the rotated view, in pixels of the map pane\n\t_getViewSize() {\n\t\tconst size = this.getSize();\n\t\tif (!this._bearing) { return size; }\n\t\tconst angle = this._bearing * Math.PI / 180,\n\t\tcos = Math.abs(Math.cos(angle)),\n\t\tsin = Math.abs(Math.sin(angle));\n\t\treturn new Point(size.x * cos + size.y * sin, size.x * sin + size.y * cos);\n\t},\n\n\t// Counter-rotates `el` (positioned with `DomUtil.setPosition()`) around its CSS\n\t// `transformOrigin`, so that it stays upright on a rotated map.\n\t_rotateUpright(el, transformOrigin) {\n\t\tif (this._bearing) {\n\t\t\tel.style.transform += ` rotate(${this._bearing}deg)`;\n\t\t\tel.style.transformOrigin = transformOrigin;\n\t\t} else if (el.style.transformOrigin) {\n\t\t\tel.style.transformOrigin = '';\n\t\t}\n\t},\n\n\t/**\n\t * Overrides `containerPointToLayerPoint()` of `MaplairMap` (documented there) to\n\t * account for the rotation.\n\t * @internal\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tcontainerPointToLayerPoint(point) { // (Point)\n\t\tpoint = Point.from(point);\n\t\tif (this._bearing) {\n\t\t\t// the map pane is rotated around the center of the container\n\t\t\tconst center = this.getSize()._divideBy(2);\n\t\t\tpoint = this._rotateToPane(point.subtract(center))._add(center);\n\t\t}\n\t\treturn point.subtract(this._getMapPanePos());\n\t},\n\n\t/**\n\t * Overrides `layerPointToContainerPoint()` of `MaplairMap` (documented there) to\n\t * account for the rotation.\n\t * @internal\n\t * @param {PointExpression} point\n\t * @returns {Point}\n\t */\n\tlayerPointToContainerPoint(point) { // (Point)\n\t\tpoint = Point.from(point).add(this._getMapPanePos());\n\t\tif (this._bearing) {\n\t\t\tconst center = this.getSize()._divideBy(2);\n\t\t\tpoint = this._rotateToContainer(point.subtract(center))._add(center);\n\t\t}\n\t\treturn point;\n\t},\n\n\t/**\n\t * Overrides `getPixelBounds()` of `MaplairMap` (documented there): the bounding box\n\t * of the rotated view.\n\t * @internal\n\t * @param {LatLng} [center]\n\t * @param {number} [zoom]\n\t * @returns {Bounds}\n\t */\n\tgetPixelBounds(center, zoom) {\n\t\tconst topLeftPoint = this._getTopLeftPoint(center, zoom);\n\t\tif (!this._bearing) {\n\t\t\treturn new Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\n\t\t}\n\t\t// the bounding box of the rotated view\n\t\tconst pixelCenter = topLeftPoint.add(this.getSize()._divideBy(2)),\n\t\thalf = this._getViewSize()._divideBy(2);\n\t\treturn new Bounds(pixelCenter.subtract(half), pixelCenter.add(half));\n\t},\n\n\t/**\n\t * Overrides `panBy()` of `MaplairMap` (documented there): `panBy()` takes offsets in\n\t * container pixels, the map pane moves in its rotated frame.\n\t * @internal\n\t * @param {PointExpression} offset\n\t * @param {PanOptions} [options]\n\t * @returns {this}\n\t */\n\tpanBy(offset, options) {\n\t\treturn panBy.call(this, this._rotateToPane(Point.from(offset)), options);\n\t},\n\n\t_tryAnimatedPan(center, options) {\n\t\t// difference between the new and current centers in pixels\n\t\tconst offset = this._rotateToContainer(this._getCenterOffset(center)._trunc());\n\n\t\t// don't animate too far unless animate: true specified in options\n\t\tif (options?.animate !== true && !this.getSize().contains(offset)) { return false; }\n\n\t\tthis.panBy(offset, options);\n\n\t\treturn true;\n\t},\n\n\t/**\n\t * Overrides `invalidateSize()` of `MaplairMap` (documented there) to pan in container\n\t * pixels.\n\t * @internal\n\t * @param {boolean|InvalidateSizeOptions} [options]\n\t * @returns {this}\n\t */\n\tinvalidateSize(options) {\n\t\tif (!this._loaded) { return this; }\n\n\t\toptions = {\n\t\t\tanimate: false,\n\t\t\tpan: true,\n\t\t\t...(options === true ? {animate: true} : options)\n\t\t};\n\n\t\tconst oldSize = this.getSize();\n\t\tthis._sizeChanged = true;\n\t\tthis._lastCenter = null;\n\n\t\tconst newSize = this.getSize(),\n\t\toldCenter = oldSize.divideBy(2).round(),\n\t\tnewCenter = newSize.divideBy(2).round(),\n\t\toffset = oldCenter.subtract(newCenter);\n\n\t\tif (!offset.x && !offset.y) { return this; }\n\n\t\tif (options.animate && options.pan) {\n\t\t\tthis.panBy(this._rotateToContainer(offset));\n\n\t\t} else {\n\t\t\tif (options.pan) {\n\t\t\t\tthis._rawPanBy(offset);\n\t\t\t}\n\n\t\t\tthis.fire('move');\n\n\t\t\tif (options.debounceMoveend) {\n\t\t\t\tclearTimeout(this._sizeTimer);\n\t\t\t\tthis._sizeTimer = setTimeout(this.fire.bind(this, 'moveend'), 200);\n\t\t\t} else {\n\t\t\t\tthis.fire('moveend');\n\t\t\t}\n\t\t}\n\n\t\treturn this.fire('resize', {\n\t\t\toldSize,\n\t\t\tnewSize\n\t\t});\n\t},\n\n\t// Zooms to `center` and `zoom` frame by frame around the zoom origin at `offset`\n\t// from the center (as the CSS zoom animation does), see the `continuousZoom` option.\n\t_continuousZoom(center, zoom, offset, options) {\n\t\tconst startZoom = this._zoom,\n\t\toriginOffset = offset.multiplyBy(-1),\n\t\torigin = this.layerPointToLatLng(this._getCenterLayerPoint().add(offset)),\n\t\tstart = performance.now(),\n\t\tduration = 250;\n\n\t\tthis._moveStart(true, options.noMoveStart ?? false);\n\n\t\tconst frame = () => {\n\t\t\tconst t = Math.min(1, (performance.now() - start) / duration);\n\t\t\tif (t < 1) {\n\t\t\t\t// ease out, like the CSS zoom transition\n\t\t\t\tconst z = startZoom + (zoom - startZoom) * (1 - (1 - t) ** 2);\n\t\t\t\tthis._move(this.unproject(this.project(origin, z).add(originOffset), z), z, {continuous: true});\n\t\t\t\t// cancelled by `_stop()`\n\t\t\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\t\t} else {\n\t\t\t\tthis._move(center, zoom)._moveEnd(true);\n\t\t\t}\n\t\t};\n\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t}\n};\n/** @typedef {typeof mapRotationMethods} MapRotationMethods */\n\nMaplairMap.include(mapRotationMethods);\n\n/**\n * Methods of `GridLayer` for the map rotation: the tiles cover the bounding box of the\n * rotated view.\n * @lends GridLayer.prototype\n */\nconst gridLayerRotationMethods = {\n\t_getTiledPixelBounds(center) {\n\t\tconst map = this._map,\n\t\tmapZoom = map._animatingZoom ? Math.max(map._animateToZoom, map.getZoom()) : map.getZoom(),\n\t\tscale = map.getZoomScale(mapZoom, this._tileZoom),\n\t\tpixelCenter = map.project(center, this._tileZoom).floor(),\n\t\thalfSize = map._getViewSize().divideBy(scale * 2);\n\n\t\treturn new Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));\n\t}\n};\n/** @typedef {typeof gridLayerRotationMethods} GridLayerMapRotationMethods */\n\nGridLayer.include(gridLayerRotationMethods);\n\n/**\n * Methods of `BlanketOverlay` for the map rotation: the overlay covers the bounding\n * box of the rotated view.\n * @lends BlanketOverlay.prototype\n */\nconst blanketOverlayRotationMethods = {\n\t_updateTransform(center, zoom) {\n\t\tconst scale = this._map.getZoomScale(zoom, this._zoom),\n\t\tviewHalf = this._map._getViewSize().multiplyBy(0.5 + this.options.padding),\n\t\tcurrentCenterPoint = this._map.project(this._center, zoom),\n\t\ttopLeftOffset = viewHalf.multiplyBy(-scale)._add(currentCenterPoint)\n\t\t\t._subtract(this._map._getNewPixelOrigin(center, zoom))\n\t\t\t._round();\n\n\t\tDomUtil.setTransform(this._container, topLeftOffset, scale);\n\t},\n\n\t_onMoveEnd(ev) {\n\t\t// Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n\t\t// the bounding box of the (possibly rotated) view, extended by the padding\n\t\tconst p = this.options.padding,\n\t\tsize = this._map._getViewSize();\n\t\tif (!size.multiplyBy(1 + p * 2).round().equals(this._containerSize)) {\n\t\t\t// e.g. after rotating the map\n\t\t\tthis._resizeContainer();\n\t\t}\n\t\tconst min = this._map._getCenterLayerPoint().subtract(size.multiplyBy(0.5 + p)).round();\n\n\t\tthis._bounds = new Bounds(min, min.add(size.multiplyBy(1 + p * 2)).round());\n\n\t\tthis._center = this._map.getCenter();\n\t\tthis._zoom = this._map.getZoom();\n\t\tthis._updateTransform(this._center, this._zoom);\n\n\t\tthis._onSettled(ev);\n\t},\n\n\t_resizeContainer() {\n\t\tconst p = this.options.padding,\n\t\tsize = this._containerSize = this._map._getViewSize().multiplyBy(1 + p * 2).round();\n\t\tthis._container.style.width = `${size.x}px`;\n\t\tthis._container.style.height = `${size.y}px`;\n\t\treturn size;\n\t}\n};\n/** @typedef {typeof blanketOverlayRotationMethods} BlanketOverlayMapRotationMethods */\n\nBlanketOverlay.include(blanketOverlayRotationMethods);\n\n/**\n * Methods of `DivOverlay` for the map rotation: the overlays stay upright.\n * @lends DivOverlay.prototype\n */\nconst divOverlayRotationMethods = {\n\t/**\n\t * Overrides `getEvents()` of `DivOverlay` to update the position on rotation.\n\t * @internal\n\t * @returns {Record<string, Function>}\n\t */\n\tgetEvents() {\n\t\treturn {...getDivOverlayEvents.call(this), rotate: this._updatePosition};\n\t},\n\n\t_updatePosition() {\n\t\tif (!this._map) { return; }\n\n\t\tconst map = this._map,\n\t\tpos = map.latLngToLayerPoint(this._latlng)._round(),\n\t\t// on a rotated map, the anchor is relative to the upright overlay\n\t\tanchor = map._rotateToPane(new Point(this._getAnchor()));\n\t\tlet offset = Point.from(this.options.offset);\n\n\t\tconst transformed = this._zoomAnimated || this.options.overflow || map._bearing;\n\t\tif (!transformed) {\n\t\t\toffset = offset.add(pos).add(anchor);\n\t\t}\n\n\t\tconst bottom = this._containerBottom = -offset.y,\n\t\tleft = this._containerLeft = -Math.round(this._containerWidth / 2) + offset.x;\n\n\t\t// bottom position the overlay in case the height of the overlay changes (images loading etc)\n\t\tif (this.options.overflow) {\n\t\t\t// relative to the top of the viewport instead of the pane origin\n\t\t\tthis._container.style.top = 'auto';\n\t\t\tthis._container.style.bottom = `calc(100% + ${bottom}px)`;\n\t\t} else {\n\t\t\tthis._container.style.bottom = `${bottom}px`;\n\t\t}\n\t\tthis._container.style.left = `${left}px`;\n\n\t\tif (transformed) {\n\t\t\t// upright around the anchored point (below the bottom margin, see `Popup`)\n\t\t\tthis._setContainerPosition(pos.add(anchor), `${-left}px calc(100% + ${bottom + (this._containerMarginBottom ?? 0)}px)`);\n\t\t}\n\t},\n\n\t// Positions the container at the given layer point. An overflowing overlay\n\t// lives in the top layer of the page, so it is positioned in viewport coordinates.\n\t// `transformOrigin` is the point around which the container is kept upright on a rotated map.\n\t_setContainerPosition(pos, transformOrigin) {\n\t\tthis._containerPos = pos;\n\t\tif (this.options.overflow) {\n\t\t\tconst mapContainer = this._map._container,\n\t\t\trect = mapContainer.getBoundingClientRect();\n\t\t\tpos = this._map.layerPointToContainerPoint(pos)\n\t\t\t\t._add(new Point(rect.left + mapContainer.clientLeft, rect.top + mapContainer.clientTop));\n\t\t}\n\t\tDomUtil.setPosition(this._container, pos);\n\t\tif (!this.options.overflow) {\n\t\t\tthis._map._rotateUpright(this._container, transformOrigin);\n\t\t}\n\t}\n};\n/** @typedef {typeof divOverlayRotationMethods} DivOverlayMapRotationMethods */\n\nDivOverlay.include(divOverlayRotationMethods);\n\n/**\n * Methods of `Popup` for the map rotation: the popup stays upright, autopanning in\n * container pixels.\n * @lends Popup.prototype\n */\nconst popupRotationMethods = {\n\t_animateZoom(e) {\n\t\tconst pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center),\n\t\tanchor = this._map._rotateToPane(new Point(this._getAnchor()));\n\t\tthis._setContainerPosition(pos.add(anchor), this._container.style.transformOrigin);\n\t},\n\n\t_adjustPan() {\n\t\tif (!this.options.autoPan) { return; }\n\t\tthis._map._panAnim?.stop();\n\n\t\t// We can endlessly recurse if keepInView is set and the view resets.\n\t\t// Let's guard against that by exiting early if we're responding to our own autopan.\n\t\tif (this._autopanning) {\n\t\t\tthis._autopanning = false;\n\t\t\treturn;\n\t\t}\n\n\t\tconst map = this._map,\n\t\tmarginBottom = this._containerMarginBottom ?? (parseInt(getComputedStyle(this._container).marginBottom, 10) || 0),\n\t\tcontainerHeight = this._containerHeight + marginBottom,\n\t\tcontainerWidth = this._containerWidth,\n\t\t// the top left corner, relative to the (upright) anchored point\n\t\ttopLeft = new Point(this._containerLeft, -containerHeight - this._containerBottom);\n\n\t\tconst containerPos = map.layerPointToContainerPoint(this._getContainerPosition())._add(topLeft),\n\t\tpadding = Point.from(this.options.autoPanPadding),\n\t\tpaddingTL = Point.from(this.options.autoPanPaddingTopLeft ?? padding),\n\t\tpaddingBR = Point.from(this.options.autoPanPaddingBottomRight ?? padding),\n\t\tsize = map.getSize();\n\t\tlet dx = 0,\n\t\tdy = 0;\n\n\t\tif (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\n\t\t\tdx = containerPos.x + containerWidth - size.x + paddingBR.x;\n\t\t}\n\t\tif (containerPos.x - dx - paddingTL.x < 0) { // left\n\t\t\tdx = containerPos.x - paddingTL.x;\n\t\t}\n\t\tif (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\n\t\t\tdy = containerPos.y + containerHeight - size.y + paddingBR.y;\n\t\t}\n\t\tif (containerPos.y - dy - paddingTL.y < 0) { // top\n\t\t\tdy = containerPos.y - paddingTL.y;\n\t\t}\n\n\t\t// see the `autopanstart` event of `Popup`\n\t\tif (dx || dy) {\n\t\t\t// Track that we're autopanning, as this function will be re-ran on moveend\n\t\t\tif (this.options.keepInView) {\n\t\t\t\tthis._autopanning = true;\n\t\t\t}\n\n\t\t\tmap\n\t\t\t\t.fire('autopanstart')\n\t\t\t\t.panBy([dx, dy]);\n\t\t}\n\t}\n};\n/** @typedef {typeof popupRotationMethods} PopupMapRotationMethods */\n\nPopup.include(popupRotationMethods);\n\n// The margins of the directions, see `.maplair-tooltip-top` etc. in maplair.css\nconst tooltipMargins = {\n\ttop: [0, -6],\n\tbottom: [0, 6],\n\tleft: [-6, 0],\n\tright: [6, 0]\n};\n\n/**\n * Methods of `Tooltip` for the map rotation: the tooltip stays upright.\n * @lends Tooltip.prototype\n */\nconst tooltipRotationMethods = {\n\t// On a rotated map, the tooltip is positioned at its source and kept upright\n\t// around it (taking the margin of the direction into account)\n\t_setPosition(pos) {\n\t\tsetTooltipPosition.call(this, pos);\n\t\tconst container = this._container;\n\t\tif (this.options.overflow) { return; }\n\t\tif (!this._map._bearing) {\n\t\t\tcontainer.style.left = container.style.top = '';\n\t\t\treturn;\n\t\t}\n\t\tconst delta = this._containerPos.subtract(pos),\n\t\tdirection = Object.keys(tooltipMargins).find(d => container.classList.contains(`maplair-tooltip-${d}`)),\n\t\tmargin = tooltipMargins[direction] ?? [0, 0];\n\t\tcontainer.style.left = `${delta.x}px`;\n\t\tcontainer.style.top = `${delta.y}px`;\n\t\tthis._setContainerPosition(pos, `${-delta.x - margin[0]}px ${-delta.y - margin[1]}px`);\n\t}\n};\n/** @typedef {typeof tooltipRotationMethods} TooltipMapRotationMethods */\n\nTooltip.include(tooltipRotationMethods);\n\n/**\n * Options of `Marker` for the map rotation.\n * @typedef {object} MarkerMapRotationOptions\n * @lends MarkerOptions\n * @property {boolean} [rotateWithView=false] On a rotated map (see\n * `MaplairMap.setBearing()`), whether the icon rotates with the map (e.g. for arrows\n * pointing in a geographic direction) instead of staying upright. The `rotation` of\n * the marker is relative to the screen, or to north with `rotateWithView`.\n */\nMarker.include({\n\toptions: {\n\t\trotateWithView: false\n\t}\n});\n\n/**\n * Methods of `Marker` for the map rotation: the marker is updated on rotation, and\n * its icon and shadow stay upright.\n * @lends Marker.prototype\n */\nconst markerRotationMethods = {\n\t/**\n\t * Overrides `getEvents()` of `Marker` to update the marker on rotation.\n\t * @internal\n\t * @returns {Record<string, Function>}\n\t */\n\tgetEvents() {\n\t\treturn {...getMarkerEvents.call(this), rotate: this.update};\n\t},\n\n\t_positionElements(pos) {\n\t\tpositionMarkerElements.call(this, pos);\n\t\tconst bearing = this.options.rotateWithView ? 0 : (this._map?.getBearing() ?? 0);\n\t\tif (!bearing) { return; }\n\t\tfor (const el of [this._icon, this._shadow]) {\n\t\t\tif (el) { el.style.transform += ` rotate(${bearing}deg)`; }\n\t\t}\n\t}\n};\n/** @typedef {typeof markerRotationMethods} MarkerMapRotationMethods */\n\nMarker.include(markerRotationMethods);\n\n/**\n * Methods of `MarkerDrag` for the map rotation: autopanning in container pixels.\n * @lends MarkerDrag.prototype\n */\nconst markerDragRotationMethods = {\n\t_adjustPan(e) {\n\t\tconst marker = this._marker,\n\t\tmap = marker._map,\n\t\tspeed = this._marker.options.autoPanSpeed,\n\t\tpadding = this._marker.options.autoPanPadding,\n\t\ticonPos = DomUtil.getPosition(marker._icon),\n\t\tbounds = map.getPixelBounds(),\n\t\torigin = map.getPixelOrigin();\n\n\t\tconst panBounds = new Bounds(\n\t\t\tbounds.min._subtract(origin).add(padding),\n\t\t\tbounds.max._subtract(origin).subtract(padding)\n\t\t);\n\n\t\tif (!panBounds.contains(iconPos)) {\n\t\t\t// Compute incremental movement\n\t\t\tconst movement = new Point(\n\t\t\t\t(Math.max(panBounds.max.x, iconPos.x) - panBounds.max.x) / (bounds.max.x - panBounds.max.x) -\n\t\t\t\t\t(Math.min(panBounds.min.x, iconPos.x) - panBounds.min.x) / (bounds.min.x - panBounds.min.x),\n\n\t\t\t\t(Math.max(panBounds.max.y, iconPos.y) - panBounds.max.y) / (bounds.max.y - panBounds.max.y) -\n\t\t\t\t\t(Math.min(panBounds.min.y, iconPos.y) - panBounds.min.y) / (bounds.min.y - panBounds.min.y)\n\t\t\t).multiplyBy(speed);\n\n\t\t\tmap.panBy(map._rotateToContainer(movement), {animate: false});\n\n\t\t\tthis._draggable._newPos._add(movement);\n\t\t\tthis._draggable._startPos._add(movement);\n\n\t\t\tDomUtil.setPosition(marker._icon, this._draggable._newPos);\n\t\t\tthis._onDrag(e);\n\n\t\t\tthis._panRequest = requestAnimationFrame(this._adjustPan.bind(this, e));\n\t\t}\n\t}\n};\n/** @typedef {typeof markerDragRotationMethods} MarkerDragMapRotationMethods */\n\nMarkerDrag.include(markerDragRotationMethods);\n\n/**\n * Methods of `Draggable` for the map rotation: dragging in the rotated frame of the\n * map pane.\n * @lends Draggable.prototype\n */\nconst draggableRotationMethods = {\n\t_onDown(e) {\n\t\tonDraggableDown.call(this, e);\n\t\t// on a rotated map, the element moves in the rotated frame of the map pane,\n\t\t// and the rotated pane is scaled by its bounding box (see `DomUtil.getScale()`)\n\t\tconst rotatePane = this._element.closest?.('.maplair-rotate-pane');\n\t\tthis._rotatedMap = rotatePane && rotatedMaps.get(rotatePane);\n\t\tif (this._rotatedMap && this._parentScale) {\n\t\t\tthis._parentScale = DomUtil.getScale(rotatePane.parentNode);\n\t\t}\n\t},\n\n\t_updatePosition() {\n\t\tconst map = this._rotatedMap;\n\t\tif (map?._bearing) {\n\t\t\tthis._newPos = this._startPos.add(map._rotateToPane(this._newPos.subtract(this._startPos)));\n\t\t}\n\t\tupdateDraggablePosition.call(this);\n\t}\n};\n/** @typedef {typeof draggableRotationMethods} DraggableMapRotationMethods */\n\nDraggable.include(draggableRotationMethods);\n\n/**\n * Methods of `DragHandler` for the map rotation: the inertia in container pixels.\n * @lends DragHandler.prototype\n */\nconst dragHandlerRotationMethods = {\n\t_onDragEnd(e) {\n\t\tconst map = this._map,\n\t\toptions = map.options,\n\n\t\tnoInertia = !options.inertia || e.noInertia || this._times.length < 2;\n\n\t\tmap.fire('dragend', e);\n\n\t\tif (noInertia) {\n\t\t\tmap.fire('moveend');\n\n\t\t} else {\n\t\t\tthis._prunePositions(Date.now());\n\n\t\t\tconst direction = this._lastPos.subtract(this._positions[0]),\n\t\t\tduration = (this._lastTime - this._times[0]) / 1000,\n\t\t\tease = options.easeLinearity,\n\n\t\t\tspeedVector = direction.multiplyBy(ease / duration),\n\t\t\tspeed = speedVector.distanceTo([0, 0]),\n\n\t\t\tlimitedSpeed = Math.min(options.inertiaMaxSpeed, speed),\n\t\t\tlimitedSpeedVector = speedVector.multiplyBy(limitedSpeed / speed),\n\n\t\t\tmaxOffset = map.getSize().divideBy(2);\n\n\t\t\tlet decelerationDuration = limitedSpeed / (options.inertiaDeceleration * ease),\n\t\t\toffset = limitedSpeedVector.multiplyBy(-decelerationDuration / 2).round();\n\n\t\t\t// with reduced motion, shorten the coast to fit within half the map size, see DragHandler\n\t\t\tif (map._prefersReducedMotion() && !maxOffset.contains(offset)) {\n\t\t\t\tconst k = Math.min(maxOffset.x / Math.abs(offset.x), maxOffset.y / Math.abs(offset.y));\n\t\t\t\toffset = offset.multiplyBy(k).round();\n\t\t\t\tdecelerationDuration *= Math.sqrt(k);\n\t\t\t}\n\n\t\t\tif (!offset.x && !offset.y) {\n\t\t\t\tmap.fire('moveend');\n\n\t\t\t} else {\n\t\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\n\t\t\t\trequestAnimationFrame(() => {\n\t\t\t\t\t// the offset of the map pane, `panBy()` takes container pixels\n\t\t\t\t\tmap.panBy(map._rotateToContainer(offset), {\n\t\t\t\t\t\tduration: decelerationDuration,\n\t\t\t\t\t\teaseLinearity: ease,\n\t\t\t\t\t\tnoMoveStart: true,\n\t\t\t\t\t\tanimate: true\n\t\t\t\t\t});\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\t}\n};\n/** @typedef {typeof dragHandlerRotationMethods} DragHandlerMapRotationMethods */\n\nDragHandler.include(dragHandlerRotationMethods);\n\n// The time (ms) without further wheel events after which a touchpad pan ends, see `ScrollWheelZoomHandler`\nconst gestureEndDelay = 150;\n\n// The angle (degrees) the fingers have to turn before the map starts rotating\nconst rotateThreshold = 15;\n\nfunction angleOf(p1, p2) {\n\treturn Math.atan2(p2.y - p1.y, p2.x - p1.x) * 180 / Math.PI;\n}\n\n/**\n * Methods of `PinchZoomHandler` for the map rotation: rotating by turning two fingers\n * (see the map option `pinchRotate`), pinching in the rotated frame.\n * @lends PinchZoomHandler.prototype\n */\nconst pinchZoomHandlerRotationMethods = {\n\t_onPointerStart(e) {\n\t\tonPinchStart.call(this, e);\n\t\tconst pointers = PointerEvents.getPointers();\n\t\tif (this._zooming && pointers.length === 2) {\n\t\t\tthis._startAngle = angleOf(...pointers.map(p => this._map.pointerEventToContainerPoint(p)));\n\t\t\tthis._startBearing = this._map.getBearing();\n\t\t\tthis._rotating = false;\n\t\t}\n\t},\n\n\t_onPointerMove(e) {\n\t\tconst pointers = PointerEvents.getPointers();\n\t\tif (pointers.length !== 2 || !this._zooming) { return; }\n\n\t\tconst map = this._map,\n\t\tp1 = map.pointerEventToContainerPoint(pointers[0]),\n\t\tp2 = map.pointerEventToContainerPoint(pointers[1]),\n\t\tscale = p1.distanceTo(p2) / this._startDist;\n\n\t\tthis._zoom = map.getScaleZoom(scale, this._startZoom);\n\n\t\tif (map.options.pinchRotate) {\n\t\t\tconst angle = angleOf(p1, p2);\n\t\t\tlet delta = ((angle - this._startAngle + 540) % 360) - 180;\n\t\t\tif (!this._rotating && Math.abs(delta) > rotateThreshold) {\n\t\t\t\t// start rotating from the threshold on, without a jump\n\t\t\t\tthis._rotating = true;\n\t\t\t\tthis._startAngle += Math.sign(delta) * rotateThreshold;\n\t\t\t\tdelta -= Math.sign(delta) * rotateThreshold;\n\t\t\t}\n\t\t\tif (this._rotating) {\n\t\t\t\t// turning the fingers clockwise turns the map clockwise\n\t\t\t\tmap._rotate(this._startBearing - delta);\n\t\t\t}\n\t\t}\n\n\t\tif (!map.options.bounceAtZoomLimits && (\n\t\t\t(this._zoom < map.getMinZoom() && scale < 1) ||\n\t\t\t\t(this._zoom > map.getMaxZoom() && scale > 1))) {\n\t\t\tthis._zoom = map._limitZoom(this._zoom);\n\t\t}\n\n\t\tif (map.options.pinchZoom === 'center') {\n\t\t\tthis._center = this._startLatLng;\n\t\t\tif (scale === 1 && !this._rotating) { return; }\n\t\t} else {\n\t\t\t// Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng\n\t\t\tconst delta = map._rotateToPane(p1._add(p2)._divideBy(2)._subtract(this._centerPoint));\n\t\t\tif (scale === 1 && delta.x === 0 && delta.y === 0 && !this._rotating) { return; }\n\t\t\tthis._center = map.unproject(map.project(this._pinchStartLatLng, this._zoom).subtract(delta), this._zoom);\n\t\t}\n\n\t\tif (!this._moved) {\n\t\t\tmap._setUserEvent(e);\n\t\t\tmap._moveStart(true, false);\n\t\t\tthis._moved = true;\n\t\t}\n\n\t\tcancelAnimationFrame(this._animRequest);\n\n\t\tconst moveFn = map._move.bind(map, this._center, this._zoom, {pinch: true, round: false}, undefined);\n\t\tthis._animRequest = requestAnimationFrame(moveFn.bind(this));\n\n\t\te.preventDefault();\n\t}\n};\n/** @typedef {typeof pinchZoomHandlerRotationMethods} PinchZoomHandlerMapRotationMethods */\n\nPinchZoomHandler.include(pinchZoomHandlerRotationMethods);\n\n/**\n * Methods of `TapDragZoomHandler` for the map rotation: the zoom origin in the rotated\n * frame.\n * @lends TapDragZoomHandler.prototype\n */\nconst tapDragZoomHandlerRotationMethods = {\n\t_onDown(e) {\n\t\tonTapDragDown.call(this, e);\n\t\t// the offset of the zoom origin in the rotated frame of the map pane\n\t\tif (this._zooming && this._aroundOffset) {\n\t\t\tthis._aroundOffset = this._map._rotateToPane(this._aroundOffset);\n\t\t}\n\t}\n};\n/** @typedef {typeof tapDragZoomHandlerRotationMethods} TapDragZoomHandlerMapRotationMethods */\n\nTapDragZoomHandler.include(tapDragZoomHandlerRotationMethods);\n\n/**\n * Methods of `ScrollWheelZoomHandler` for the map rotation: zooming and panning in the\n * rotated frame.\n * @lends ScrollWheelZoomHandler.prototype\n */\nconst scrollWheelZoomHandlerRotationMethods = {\n\t_pinchTo(e, zoom, eased) {\n\t\tpinchTo.call(this, e, zoom, eased);\n\t\t// the offset of the zoom origin in the rotated frame of the map pane\n\t\tif (this._pinch && !this._pinch.rotated) {\n\t\t\tthis._pinch.offset = this._map._rotateToPane(this._pinch.offset);\n\t\t\tthis._pinch.rotated = true;\n\t\t}\n\t},\n\n\t// Pans the map by the wheel deltas, as by scrolling with two fingers on a touchpad.\n\t_panBy(e) {\n\t\tDomEvent.stop(e);\n\t\tconst map = this._map;\n\t\tif (map._animatingZoom) { return; }\n\n\t\tconst factor = e.deltaMode === 1 ? 20 : e.deltaMode === 2 ? 60 : 1;\n\t\tlet offset = new Point(e.deltaX * factor, e.deltaY * factor);\n\t\tif (e.shiftKey && !e.deltaX) {\n\t\t\t// Shift with a mouse wheel scrolls horizontally\n\t\t\toffset = new Point(offset.y, 0);\n\t\t}\n\t\t// in the rotated frame of the map pane\n\t\toffset = map._rotateToPane(offset);\n\t\tif (map.options.maxBounds) {\n\t\t\toffset = map._limitOffset(offset, map.options.maxBounds);\n\t\t}\n\n\t\tif (!this._panning) {\n\t\t\tmap._stop();\n\t\t\tthis._panning = true;\n\t\t\tmap._setUserEvent(e);\n\t\t\tmap.fire('movestart');\n\t\t}\n\t\tmap._rawPanBy(offset.round());\n\t\tmap.fire('move');\n\n\t\tclearTimeout(this._panTimer);\n\t\tthis._panTimer = setTimeout(this._endPan.bind(this), gestureEndDelay);\n\t}\n};\n/** @typedef {typeof scrollWheelZoomHandlerRotationMethods} ScrollWheelZoomHandlerMapRotationMethods */\n\nScrollWheelZoomHandler.include(scrollWheelZoomHandlerRotationMethods);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AA2BA,SAAS,iBAAiB,SAAS;CAClC,QAAS,OAAO,OAAO,IAAI,MAAO,OAAO;AAC1C;AAGA,SAAS,YAAY,OAAO,SAAS;CACpC,MAAM,QAAQ,UAAU,KAAK,KAAK,KAClC,MAAM,KAAK,IAAI,KAAK,GACpB,MAAM,KAAK,IAAI,KAAK;CACpB,OAAO,IAAI,MAAM,MAAM,IAAI,MAAM,MAAM,IAAI,KAAK,MAAM,IAAI,MAAM,MAAM,IAAI,GAAG;AAC9E;AAGA,MAAM,8BAAc,IAAI,QAAQ;AAuBhC,MAAM,EAAC,UAAS,WAAW,WAC3B,EAAC,WAAW,wBAAuB,WAAW,WAC9C,EAAC,cAAc,uBAAsB,QAAQ,WAC7C,EAAC,WAAW,iBAAiB,mBAAmB,2BAA0B,OAAO,WACjF,EAAC,SAAS,iBAAiB,iBAAiB,4BAA2B,UAAU,WACjF,EAAC,iBAAiB,iBAAgB,iBAAiB,WACnD,EAAC,SAAS,kBAAiB,mBAAmB,WAC9C,EAAC,UAAU,YAAW,uBAAuB;;;;;;;;;;;AAa7C,WAAW,aAAa;CACvB,SAAS;CACT,aAAa;AACd,CAAC;AAED,WAAW,YAAY,WAAY;CAClC,IAAI,KAAK,QAAQ,WAAW,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AAS,QAAQ,EAAE,SAAS,MAAM;EAC3D,IAAI,EAAE,YAAY,CAAC,EAAE,QAEpB,SAAS,IAAI,MAAM,OAAO,GAAG,CAAC;EAG/B,SAAS,IAAI,cAAc,MAAM;EACjC,IAAI,IAAI,QAAQ,WACf,SAAS,IAAI,aAAa,QAAQ,IAAI,QAAQ,SAAS;EAGxD,IAAI,CAAC,KAAK,UAAU;GACnB,IAAI,MAAM;GACV,KAAK,WAAW;GAChB,IAAI,cAAc,CAAC;GACnB,IAAI,KAAK,WAAW;EACrB;EACA,IAAI,UAAU,OAAO,MAAM,CAAC;EAC5B,IAAI,KAAK,MAAM;EAEf,aAAa,KAAK,SAAS;EAC3B,KAAK,YAAY,WAAW,KAAK,QAAQ,KAAK,IAAI,GAAG,eAAe;CACrE;AAIkE,CAAC"}
|
|
1
|
+
{"version":3,"file":"Map.Rotation.js","names":["DomUtil.create","DomUtil.getPosition","DomUtil.getScale","PointerEvents.getPointers"],"sources":["../../../src/map/Map.Rotation.js"],"sourcesContent":["import {MaplairMap} from './Map.js';\nimport * as DomUtil from '../dom/DomUtil.js';\nimport * as DomEvent from '../dom/DomEvent.js';\nimport * as PointerEvents from '../dom/DomEvent.PointerEvents.js';\nimport {Draggable} from '../dom/Draggable.js';\nimport {Point} from '../geometry/Point.js';\nimport {Bounds} from '../geometry/Bounds.js';\nimport {BlanketOverlay} from '../layer/BlanketOverlay.js';\nimport {GridLayer} from '../layer/tile/GridLayer.js';\nimport {DivOverlay} from '../layer/DivOverlay.js';\nimport {Popup} from '../layer/Popup.js';\nimport {Tooltip} from '../layer/Tooltip.js';\nimport {Marker} from '../layer/marker/Marker.js';\nimport {MarkerDrag} from '../layer/marker/Marker.Drag.js';\nimport {DragHandler} from './handler/DragHandler.js';\nimport {PinchZoomHandler} from './handler/PinchZoomHandler.js';\nimport {ScrollWheelZoomHandler} from './handler/ScrollWheelZoomHandler.js';\nimport {TapDragZoomHandler} from './handler/TapDragZoomHandler.js';\nimport {RotateControl} from '../control/RotateControl.js';\n/** @import {MaplairEvent} from '../core/Events.js' */\n/** @import {LatLng} from '../geo/LatLng.js' */\n/** @import {PointExpression} from '../geometry/Point.js' */\n/** @import {PanOptions, InvalidateSizeOptions} from './Map.js' */\n\nexport {RotateControl};\n\n// The bearing in degrees in the range [0, 360)\nfunction normalizeBearing(bearing) {\n\treturn ((Number(bearing) % 360) + 360) % 360;\n}\n\n// Rotates `point` clockwise (on the screen) by `degrees` around the origin\nfunction rotatePoint(point, degrees) {\n\tconst angle = degrees * Math.PI / 180,\n\tcos = Math.cos(angle),\n\tsin = Math.sin(angle);\n\treturn new Point(point.x * cos - point.y * sin, point.x * sin + point.y * cos);\n}\n\n// The maps of the rotated panes, see `Draggable`\nconst rotatedMaps = new WeakMap();\n\n// Possible size savings: about 60% of the code of this module (about 7–8 kB of\n// its 13 kB minified) are copies of core methods, which are overridden because\n// the rotation changes a computation in their middle:\n// * Popup#_adjustPan, MarkerDrag#_adjustPan, DragHandler#_onDragEnd: the offsets\n// for panBy() in container pixels (about 1.1–1.3 kB each)\n// * PinchZoomHandler#_onPointerMove (1.6 kB) and ScrollWheelZoomHandler#_panBy:\n// the rotation by two fingers, the pinch and pan offsets in the rotated frame\n// * MaplairMap#invalidateSize, #_tryAnimatedPan, #_continuousZoom, #getPixelBounds,\n// GridLayer#_getTiledPixelBounds, BlanketOverlay#_updateTransform, #_onMoveEnd,\n// #_resizeContainer, DivOverlay#_updatePosition, #_setContainerPosition,\n// Popup#_animateZoom: the bounding box of the rotated view, the upright overlays\n// Most of these copies could be replaced by small extension points in the core\n// classes, which this module overrides instead: e.g. MaplairMap#_rotateToPane(offset),\n// #_rotateToContainer(offset) and #_getViewSize() returning the offset or size\n// unchanged, used where the copied methods differ (well below 1 kB in core, for\n// all maps); or by splitting the core methods, so that the computations in\n// question become methods of their own (e.g. the pinch center from the offset of\n// the fingers, the inertia offset, the box of a popup in container pixels).\n// Both would change the pre-existing classes, which this module leaves untouched.\n\n// The methods extended below\nconst {panBy} = MaplairMap.prototype,\n{getEvents: getDivOverlayEvents} = DivOverlay.prototype,\n{_setPosition: setTooltipPosition} = Tooltip.prototype,\n{getEvents: getMarkerEvents, _positionElements: positionMarkerElements} = Marker.prototype,\n{_onDown: onDraggableDown, _updatePosition: updateDraggablePosition} = Draggable.prototype,\n{_onPointerStart: onPinchStart} = PinchZoomHandler.prototype,\n{_onDown: onTapDragDown} = TapDragZoomHandler.prototype,\n{_pinchTo: pinchTo} = ScrollWheelZoomHandler.prototype;\n\n/**\n * Map options of the map rotation (`maplair/map-rotation`).\n * @typedef {object} RotationMapOptions\n * @lends MaplairMapOptions\n * @property {number} [bearing=0] Initial rotation of the map in degrees: the compass\n * direction pointing up, clockwise from north (e.g. `90` for east up), see\n * `setBearing()`.\n * @property {boolean} [pinchRotate=false] Whether the map can be rotated by turning two\n * fingers, see `setBearing()`.\n */\n\nMaplairMap.mergeOptions({\n\tbearing: 0,\n\tpinchRotate: false\n});\n\nMaplairMap.addInitHook(function () {\n\tif (this.options.bearing || this.options.pinchRotate || this.options.rotateControl) {\n\t\tthis._rotate(this.options.bearing);\n\t\tif (this._loaded) {\n\t\t\tthis.fire('moveend');\n\t\t}\n\t}\n});\n\nRotateControl.register(MaplairMap);\n\n/**\n * Methods of `MaplairMap` for the map rotation. The rotation of the map is an optional\n * feature: import this module (`maplair/map-rotation`) to add the `bearing`,\n * `pinchRotate` and `rotateControl` options, `setBearing()`, `getBearing()` and the\n * `rotate` event to `MaplairMap`, and the `RotateControl`. Maps not using it don't\n * contain its code.\n *\n * The map pane is wrapped in a pane rotated around the center of the container.\n * Container/layer point conversions, `getPixelBounds()` and `getBounds()` account\n * for the rotation; grid layers and vector renderers cover the bounding box of\n * the rotated view; markers, popups and tooltips stay upright (see the Marker\n * option `rotateWithView`); dragging, `panBy()`, the keyboard, pinch, tap-drag,\n * touchpad and continuous zoom work in container pixels.\n *\n * @example\n * ```js\n * import {MaplairMap} from 'maplair';\n * import {RotateControl} from 'maplair/map-rotation';\n *\n * const map = new MaplairMap('map', {bearing: 30, pinchRotate: true, rotateControl: true});\n * ```\n *\n * @lends MaplairMap.prototype\n * @fires MaplairMap#rotate {MaplairEvent} Fired when the bearing of the map changes,\n * see `setBearing()`.\n */\nconst mapRotationMethods = {\n\t/**\n\t * Rotates the map around the center of the view, so that the compass direction\n\t * `bearing` (in degrees, clockwise from north) points up. Markers, popups and\n\t * tooltips stay upright. With `{animate: true}`, the map rotates smoothly (the\n\t * shorter way round).\n\t * @group Map rotation\n\t * @param {number} bearing\n\t * @param {{animate?: boolean}} [options]\n\t * @returns {this}\n\t */\n\tsetBearing(bearing, options) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tconst from = this.getBearing();\n\t\tif (!this._rotatePane && !bearing) { return this; }\n\t\tif (bearing === from) { return this; }\n\n\t\tthis._stop();\n\t\tif (!options?.animate || !this._loaded || this._prefersReducedMotion()) {\n\t\t\tthis._rotate(bearing);\n\t\t\treturn this._loaded ? this.fire('movestart').fire('move').fire('moveend') : this;\n\t\t}\n\n\t\t// the shorter way round\n\t\tconst delta = ((bearing - from + 540) % 360) - 180,\n\t\tstart = performance.now(),\n\t\tduration = 250;\n\t\tthis.fire('movestart');\n\t\tconst frame = () => {\n\t\t\tconst t = Math.min(1, (performance.now() - start) / duration);\n\t\t\tthis._rotate(from + delta * (1 - (1 - t) ** 2));\n\t\t\tthis.fire('move');\n\t\t\tif (t < 1) {\n\t\t\t\t// cancelled by `_stop()`\n\t\t\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\t\t} else {\n\t\t\t\tthis.fire('moveend');\n\t\t\t}\n\t\t};\n\t\tthis._flyToFrame = requestAnimationFrame(frame);\n\t\treturn this;\n\t},\n\n\t// Applies the bearing without the events of a view change (e.g. while pinching)\n\t_rotate(bearing) {\n\t\tbearing = normalizeBearing(bearing);\n\t\tif (!this._rotatePane) {\n\t\t\t// the map pane is wrapped in a pane rotated around the center of the container\n\t\t\tconst rotatePane = this._rotatePane = DomUtil.create('div', 'maplair-rotate-pane');\n\t\t\trotatedMaps.set(rotatePane, this);\n\t\t\tthis._mapPane.before(rotatePane);\n\t\t\trotatePane.append(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\t// difference in the frame of the map pane, which `_panBy()` moves\n\t\tconst offset = this.latLngToLayerPoint(center)._subtract(this._getCenterLayerPoint())._round();\n\n\t\t// don't animate too far unless animate: true specified in options\n\t\tif (options?.animate !== true && !this.getSize().contains(this._rotateToContainer(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\n\t\t// a scaled container is resampled anyway, and rounding where its corner lands would make its content away\n\t\t// from the corner jitter against the zoom motion\n\t\tif (scale === 1) { this._map._snapLayerPoint(topLeftOffset); }\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._snapLayerPoint(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 * 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}, 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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