leaflet-rotate 0.5.0 → 0.5.1

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/index.js", "../src/dom/DomUtil.js", "../src/dom/Draggable.js", "../src/geometry/Point.js", "../src/layer/DivOverlay.js", "../src/layer/Popup.js", "../src/layer/Tooltip.js", "../src/layer/marker/Icon.js", "../src/layer/marker/Marker.js", "../src/layer/tile/GridLayer.js", "../src/layer/vector/Renderer.js", "../src/map/Map.js", "../src/map/handler/CompassBearing.js", "../src/map/handler/ContainerMutation.js", "../src/map/handler/TouchGestures.js", "../src/map/handler/TouchRotate.js", "../src/map/handler/ShiftKeyRotate.js", "../src/map/handler/TouchZoom.js", "../src/control/Rotate.js"],
4
- "sourcesContent": ["/**\n * Export Leaflet classes in the same order as the core library.\n *\n * @since leaflet-rotate (v0.1.0)\n * \n * @external L\n *\n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/Leaflet.js\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/control/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/core/index.js\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/dom/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/geometry/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/geo/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/marker/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/tile/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/vector/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/index.js\n */\n\n// import {version} from '../package.json';\n// export {version};\n\n// control\n// export * from './core/index';\n\n// core\n// export * from './core/index';\n\n// dom\nexport * from './dom/DomUtil';\nexport * from './dom/Draggable';\n\n// geometry\nexport * from './geometry/Point';\nexport * from './geometry/Bounds';\n\n// geo\nexport * from './geo/LatLngBounds';\n\n// layer\nexport * from './layer/DivOverlay';\nexport * from './layer/Popup';\nexport * from './layer/Tooltip';\nexport * from './layer/marker/Icon';\nexport * from './layer/marker/Marker';\nexport * from './layer/tile/GridLayer';\nexport * from './layer/vector/Renderer';\n\n// map\nexport * from './map/Map';\nexport * from './map/handler/CompassBearing';\nexport * from './map/handler/ContainerMutation';\nexport * from './map/handler/TouchGestures';\nexport * from './map/handler/TouchRotate';\nexport * from './map/handler/ShiftKeyRotate';\nexport * from './map/handler/TouchZoom';\n\n// custom controls\nexport * from './control/Rotate';\n", "/**\n * @external L.DomUtil\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/DomUtil.js\n */\n\nconst domUtilProto = Object.assign({}, L.DomUtil);\n\nObject.assign(L.DomUtil, {\n /**\n * Resets the 3D CSS transform of `el` so it is translated by `offset` pixels,\n * optionally scaled by `scale`, and rotated around `pivot` when `bearing` is set.\n *\n * @param {HTMLElement} el Element to transform.\n * @param {L.Point} [offset] Translation in pixels; defaults to the origin.\n * @param {number} [scale] Optional scale factor.\n * @param {number} [bearing] Optional rotation in radians.\n * @param {L.Point} [pivot] Point in pixels around which to rotate.\n * \n * @returns {void}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setTransform(el, offset, scale, bearing, pivot) {\n let pos = offset || new L.Point(0, 0);\n\n if (!bearing) {\n return domUtilProto.setTransform(el, pos._round(), scale);\n }\n\n pos = pos.rotateFrom(bearing, pivot);\n el.style.transform =\n 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)' +\n (scale ? ' scale(' + scale + ')' : '') +\n ' rotate(' + bearing + 'rad)';\n },\n\n /**\n * Sets the position of `el` to `point`, using CSS transforms or top/left positioning\n * depending on browser support, and optionally rotating it around `pivot`.\n *\n * @param {HTMLElement} el Element to position.\n * @param {L.Point} point Position in pixels.\n * @param {number} [bearing] Rotation in radians; zero or omitted uses Leaflet positioning.\n * @param {L.Point} [pivot] Point in pixels around which to rotate.\n * @param {number} [scale] Optional scale factor.\n * \n * @returns {void}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setPosition(el, point, bearing, pivot, scale) {\n if (!bearing) {\n return domUtilProto.setPosition(el, point);\n }\n\n el._leaflet_pos = point;\n L.DomUtil.setTransform(el, point, scale, bearing, pivot);\n },\n\n /**\n * Returns the position assigned to `el`.\n *\n * @param {HTMLElement} el Element whose Leaflet position is requested.\n * \n * @returns {L.Point} Stored Leaflet position, or the position measured by Leaflet.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getPosition(el) {\n return el._leaflet_pos || domUtilProto.getPosition(el);\n }\n});\n", "/**\n * This plugin does not modify the `L.Draggable` API; it adapts marker drag\n * coordinates in `L.Marker` when rotation or pitch is enabled.\n *\n * @external L.Draggable\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/Draggable.js\n */\n\n/**\n * A class for making DOM elements draggable (including touch support).\n * Used internally for map and marker dragging. Only works for elements\n * that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).\n *\n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Draggable.include({\n\n /** @TODO */\n // updateMapBearing(mapBearing) {\n // this._mapBearing = mapBearing;\n // },\n\n});", "/**\n * @external L.Point\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/geometry/Point.js\n */\n\nObject.assign(L.Point.prototype, {\n\n /**\n * Rotate around (0,0) by applying the 2D rotation matrix:\n * \n * \u23A1 x' \u23A4 = \u23A1 cos \u03B8 -sin \u03B8 \u23A4 \u23A1 x \u23A4\n * \u23A3 y' \u23A6 \u23A3 sin \u03B8 cos \u03B8 \u23A6 \u23A3 y \u23A6\n * \n * @param {number} theta Rotation angle in radians, counterclockwise.\n * @returns {L.Point} Rotated point (or this point when theta is zero).\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotate(theta) {\n return this.rotateFrom(theta, new L.Point(0,0))\n },\n\n /**\n * Rotate around (pivot.x, pivot.y) by:\n * \n * 1. subtract (pivot.x, pivot.y)\n * 2. rotate around (0, 0)\n * 3. add (pivot.x, pivot.y) back\n * \n * same as `this.subtract(pivot).rotate(theta).add(pivot)`\n * \n * @param {number} theta Rotation angle in radians, counterclockwise.\n * @param {L.Point} pivot Point to rotate around.\n * \n * @returns {L.Point}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotateFrom(theta, pivot) {\n if (!theta) { return this; }\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const cx = pivot.x,\n cy = pivot.y;\n const x = this.x - cx,\n y = this.y - cy;\n\n return new L.Point(\n x * cosTheta - y * sinTheta + cx,\n x * sinTheta + y * cosTheta + cy\n );\n },\n\n});\n\n/**\n * Convert an array or point-like object to an `L.Point`.\n * \n * @param {L.Point|number[]|{x:number,y:number}|null} point Coordinate to convert.\n * \n * @returns {L.Point|null} Existing point, converted point, or `null` for a null input.\n * \n * @since leaflet-rotate (v0.1.0)\n */\nexport function toPoint(point) {\n if (point == null || point instanceof L.Point) {\n return point;\n }\n return Array.isArray(point)\n ? new L.Point(point[0], point[1])\n : new L.Point(point.x, point.y);\n}\n", "/**\n * Keeps popup and tooltip screen positions aligned with rotated and pitched maps.\n *\n * @external L.DivOverlay\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/DivOverlay.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nimport { toPoint } from '../geometry/Point';\n\nconst divOverlayProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.DivOverlay.prototype));\n\nL.DivOverlay.include({\n\n /**\n * Extend overlay event subscriptions to refresh position after map rotation and pitch.\n * \n * @listens L.Map~rotate\n * @listens L.Map~pitch\n *\n * @returns {Object} Leaflet event map for the overlay.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = Object.assign(divOverlayProto.getEvents.apply(this, arguments), {\n rotate: this._updatePosition,\n pitch: this._updatePitchEvents,\n });\n if (this._map && this._map._pitch) {\n events.move = this._updatePosition;\n }\n return events;\n },\n\n /**\n * Listen to map movement only while pitch is non-zero.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _updatePitchEvents() {\n if (this._map._pitch) {\n this._map.on('move', this._updatePosition, this);\n } else {\n this._map.off('move', this._updatePosition, this);\n }\n },\n\n /**\n * Reposition the overlay after map movement, applying rotation/pitch-aware coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _updatePosition() {\n if (!this._map) { return; }\n divOverlayProto._updatePosition.apply(this, arguments);\n if (this._map._rotate && this._zoomAnimated) {\n const anchor = this._getAnchor();\n const pos = L.DomUtil.getPosition(this._container).subtract(anchor);\n L.DomUtil.setPosition(this._container, this._map.rotatedPointToMapPanePoint(pos).add(anchor));\n } else if (this._map._rotate) {\n const mapPanePoint = this._map.rotatedPointToMapPanePoint(this._map.latLngToLayerPoint(this._latlng)),\n offset = toPoint(this.options.offset || [0, 0]),\n anchor = this._getAnchor();\n\n this._containerLeft = -Math.round(this._containerWidth / 2) + mapPanePoint.x + offset.x + anchor.x;\n this._containerBottom = -(mapPanePoint.y + offset.y + anchor.y);\n this._container.style.left = this._containerLeft + 'px';\n this._container.style.bottom = this._containerBottom + 'px';\n this._container.style.top = '';\n L.DomUtil.setPosition(this._container, new L.Point(0, 0));\n this._container.style.transform = '';\n }\n\n },\n\n});\n", "/**\n * Preserves popup positioning and auto-pan behavior on rotated maps.\n *\n * @external L.Popup\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/Popup.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nimport { toPoint } from '../geometry/Point';\n\nconst popupProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Popup.prototype));\n\nL.Popup.include({\n\n /**\n * Update the popup position during zoom animation and transform it into map-pane coordinates.\n *\n * @param {Object} e Zoom animation event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _animateZoom(e) {\n popupProto._animateZoom.apply(this, arguments);\n if (this._map && this._map._rotate) {\n const anchor = this._getAnchor();\n const pos = L.DomUtil.getPosition(this._container).subtract(anchor);\n L.DomUtil.setPosition(this._container, this._map.rotatedPointToMapPanePoint(pos).add(anchor));\n }\n },\n\n /**\n * Pan the map when a popup with auto-pan enabled would extend beyond the viewport.\n * \n * @see https://github.com/fnicollet/Leaflet/pull/21\n *\n * @fires L.Map#autopanstart\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _adjustPan() {\n if (!this.options.autoPan || (this._map._panAnim && this._map._panAnim._inProgress)) { return; }\n\n // We can endlessly recurse if keepInView is set and the view resets.\n // Let's guard against that by exiting early if we're responding to our own autopan.\n if (this._autopanning) {\n this._autopanning = false;\n return;\n }\n\n const map = this._map,\n marginBottom = parseInt(getComputedStyle(this._container).marginBottom, 10) || 0,\n containerHeight = this._container.offsetHeight + marginBottom,\n containerWidth = this._containerWidth,\n layerPos = new L.Point(this._containerLeft, -containerHeight - this._containerBottom);\n\n layerPos._add(L.DomUtil.getPosition(this._container));\n\n /** @TODO use popupProto._adjustPan */\n // var containerPos = map.layerPointToContainerPoint(layerPos);\n const containerPos = layerPos._add(this._map._getMapPanePos()),\n padding = toPoint(this.options.autoPanPadding || [0, 0]),\n paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding),\n paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding),\n size = map.getSize();\n let dx = 0,\n dy = 0;\n\n if (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\n dx = containerPos.x + containerWidth - size.x + paddingBR.x;\n }\n if (containerPos.x - dx - paddingTL.x < 0) { // left\n dx = containerPos.x - paddingTL.x;\n }\n if (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\n dy = containerPos.y + containerHeight - size.y + paddingBR.y;\n }\n if (containerPos.y - dy - paddingTL.y < 0) { // top\n dy = containerPos.y - paddingTL.y;\n }\n\n // @namespace Map\n // @section Popup events\n // @event autopanstart: Event\n // Fired when the map starts autopanning when opening a popup.\n if (dx || dy) {\n // Track that we're autopanning, as this function will be re-ran on moveend\n if (this.options.keepInView) {\n this._autopanning = true;\n }\n map\n .fire('autopanstart')\n .panBy([dx, dy]);\n }\n },\n\n});\n", "/**\n * Keeps tooltips positioned correctly when the map is rotated or pitched.\n *\n * @external L.Tooltip\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/Tooltip.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst tooltipProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Tooltip.prototype));\n\nL.Tooltip.include({\n\n /**\n * Reposition the tooltip during zoom animation using transformed map coordinates.\n *\n * @param {Object} e Zoom animation event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _animateZoom(e) {\n if (!this._map._rotate) {\n return tooltipProto._animateZoom.apply(this, arguments);\n }\n let pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);\n\n pos = this._map.rotatedPointToMapPanePoint(pos);\n this._setPosition(pos);\n },\n\n /**\n * Recompute tooltip screen position after map movement.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _updatePosition() {\n if (!this._map._rotate) {\n return tooltipProto._updatePosition.apply(this, arguments);\n }\n let pos = this._map.latLngToLayerPoint(this._latlng);\n\n pos = this._map.rotatedPointToMapPanePoint(pos);\n this._setPosition(pos);\n },\n\n});\n", "/**\n * Applies icon-anchor transform origins so marker rotation pivots around its anchor.\n *\n * @external L.Icon\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Icon.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst iconProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Icon.prototype));\n\nL.Icon.include({\n\n /**\n * Set marker icon dimensions and anchor styles, including the rotation origin.\n * \n * @param {HTMLImageElement} img Icon or shadow element.\n * @param {string} name Icon style key (`icon` or `shadow`).\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _setIconStyles(img, name) {\n const options = this.options;\n let sizeOption = options[name + 'Size'];\n\n if (typeof sizeOption === 'number') {\n sizeOption = [sizeOption, sizeOption];\n }\n\n const size = sizeOption ? new L.Point(...(Array.isArray(sizeOption) ? sizeOption : [sizeOption.x, sizeOption.y])) : null,\n anchorOption = name === 'shadow' && options.shadowAnchor || options.iconAnchor || size && size.divideBy(2, true),\n anchor = anchorOption ? new L.Point(...(Array.isArray(anchorOption) ? anchorOption : [anchorOption.x, anchorOption.y])) : null;\n\n img.className = 'leaflet-marker-' + name + ' ' + (options.className || '');\n\n if (anchor) {\n img.style.marginLeft = (-anchor.x) + 'px';\n img.style.marginTop = (-anchor.y) + 'px';\n /** @TODO use iconProto._setIconStyles */\n img.style.transformOrigin = anchor.x + \"px \" + anchor.y + \"px 0px\";\n }\n\n if (size) {\n img.style.width = size.x + 'px';\n img.style.height = size.y + 'px';\n }\n },\n\n});\n", "/**\n * Adds rotation and pitch-aware positioning to Leaflet markers.\n *\n * @external L.Marker\n * @external L.Handler.MarkerDrag\n * \n * @property {number} [rotation=0] Marker icon rotation in radians.\n * @property {boolean} [rotateWithView=false] Rotate the icon with the map bearing.\n * @property {boolean} [keepUpright=false] Flip a map-aligned icon to keep it upright.\n * @property {number} [scale] Optional scale applied to the icon and shadow.\n * \n * @since leaflet-rotate (v0.1.0)\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Marker.js\n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Marker.Drag.js\n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/Draggable.js\n */\n\nconst markerProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Marker.prototype));\n\nL.Marker.mergeOptions({\n\n /**\n * Rotation of the marker icon in radians.\n * \n * @type {Number}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotation: 0,\n\n /**\n * Rotate the marker icon when the map bearing changes.\n *\n * Combine with `keepUpright: true` to keep the marker readable while\n * preserving its line alignment.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotateWithView: false,\n\n /**\n * Flip the icon when needed to keep it upright while map-aligned.\n *\n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n keepUpright: false,\n\n /**\n * Optional scale of the marker icon and shadow.\n * \n * @type {Number}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n scale: undefined,\n\n});\n\nlet markerDragProto; // retrived at runtime (see below: L.Marker::_initInteraction())\n\nconst MarkerDrag = {\n\n // _onDragStart() {\n // if (!this._marker._map._rotate) {\n // return markerDragProto._onDragStart.apply(this, arguments);\n // }\n // this._draggable.updateMapBearing(this._marker._map._bearing);\n // },\n\n /**\n * Update a dragged marker's geographic position from its transformed icon position.\n * \n * @param {Object} e Marker drag event with `latlng` and `oldLatLng` fields.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onDrag(e) {\n const marker = this._marker,\n /** @TODO use markerDragProto._onDrag */\n rotated_marker = marker.options.rotation || marker.options.rotateWithView,\n shadow = marker._shadow;\n let iconPos = L.DomUtil.getPosition(marker._icon);\n\n /** @TODO use markerDragProto._onDrag */\n // update shadow position\n if (!rotated_marker && shadow) {\n L.DomUtil.setPosition(shadow, iconPos);\n }\n\n /** @TODO use markerDragProto._onDrag */\n if (marker._map._rotate) {\n // Reverse calculation from mapPane coordinates to rotatePane coordinates\n iconPos = marker._map.mapPanePointToRotatedPoint(iconPos);\n }\n const latlng = marker._map.layerPointToLatLng(iconPos);\n\n marker._latlng = latlng;\n e.latlng = latlng;\n e.oldLatLng = this._oldLatLng;\n\n /** @TODO use markerDragProto._onDrag */\n if (rotated_marker) marker.setLatLng(latlng); // use `setLatLng` to presisit rotation. low efficiency\n else marker.fire('move', e); // `setLatLng` will trig 'move' event. we imitate here.\n\n // @event drag: Event\n // Fired repeatedly while the user drags the marker.\n marker\n .fire('drag', e);\n },\n\n /**\n * Reposition the marker after a drag ends, then run Leaflet's drag-end logic.\n * \n * @param {Object} e Marker drag-end event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onDragEnd(e) {\n if (this._marker._map._rotate) {\n this._marker.update();\n }\n markerDragProto._onDragEnd.apply(this, arguments);\n },\n\n};\n\nL.Marker.include({\n\n /**\n * Extend marker event subscriptions to reposition its icon after bearing or pitch changes.\n * \n * @listens L.Map~rotate\n * @listens L.Map~pitch\n * \n * @returns {Object} Leaflet event map for the marker.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = Object.assign(markerProto.getEvents.apply(this, arguments), {\n rotate: this.update,\n pitch: this._updatePitchEvents,\n });\n if (this._map && this._map._pitch) {\n events.move = this.update;\n }\n return events;\n },\n\n /**\n * Subscribe to map movement while pitch is active to keep the icon aligned.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _updatePitchEvents() {\n if (this._map._pitch) {\n this._map.on('move', this.update, this);\n } else {\n this._map.off('move', this.update, this);\n }\n },\n\n /**\n * Install rotation-aware drag callbacks when marker dragging is enabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _initInteraction() {\n const ret = markerProto._initInteraction.apply(this, arguments);\n if (this.dragging && this.dragging.enabled() && this._map && this._map._rotate) {\n // L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable\n markerDragProto = markerDragProto || Object.getPrototypeOf(this.dragging);\n this.dragging.disable();\n Object.assign(this.dragging, {\n // _onDragStart: MarkerDrag._onDragStart.bind(this.dragging),\n _onDrag: MarkerDrag._onDrag.bind(this.dragging),\n _onDragEnd: MarkerDrag._onDragEnd.bind(this.dragging),\n });\n this.dragging.enable();\n }\n return ret;\n },\n\n /**\n * Position and rotate the marker icon and shadow in map-pane coordinates.\n * \n * @param {L.Point} pos Marker anchor in layer-point coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _setPos(pos) {\n\n /** @TODO use markerProto._setPos */\n if (this._map._rotate) {\n pos = this._map.rotatedPointToMapPanePoint(pos);\n }\n\n /** @TODO use markerProto._setPos */\n let bearing = this.options.rotation || 0;\n if (this.options.rotateWithView) {\n bearing += this._map._bearing;\n }\n if (this.options.keepUpright) {\n bearing = ((bearing % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI);\n if (bearing > Math.PI / 2 && bearing < 3 * Math.PI / 2) {\n bearing += Math.PI;\n }\n bearing %= 2 * Math.PI;\n }\n\n /** @TODO use markerProto._setPos */\n if (this._icon) {\n L.DomUtil.setPosition(this._icon, pos, bearing, pos, this.options.scale);\n }\n\n /** @TODO use markerProto._setPos */\n if (this._shadow) {\n L.DomUtil.setPosition(this._shadow, pos, bearing, pos, this.options.scale);\n }\n\n this._zIndex = pos.y + this.options.zIndexOffset;\n\n this._resetZIndex();\n },\n\n // _updateZIndex(offset) {\n // if (!this._map._rotate) {\n // return markerProto._updateZIndex.apply(this, arguments);\n // }\n // this._icon.style.zIndex = Math.round(this._zIndex + offset);\n // },\n\n /**\n * Set the marker icon's rotation and redraw it.\n * \n * @param {number} rotation Angle in radians.\n * \n * @returns {void}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setRotation(rotation) {\n this.options.rotation = rotation;\n this.update();\n },\n\n});\n", "/**\n * Updates tile coverage for rotated map bounds.\n *\n * @external L.GridLayer\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/tile/GridLayer.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst gridLayerProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.GridLayer.prototype));\n\nL.GridLayer.include({\n\n /**\n * Add a throttled tile refresh after map bearing changes.\n * \n * @listens L.Map~rotate\n * \n * @returns {Object} Leaflet event map for the grid layer.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = gridLayerProto.getEvents.apply(this, arguments);\n if (this._map._rotate && !this.options.updateWhenIdle) {\n if (!this._onRotate) {\n this._onRotate = L.Util.throttle(this._onMoveEnd, this.options.updateInterval, this);\n }\n events.rotate = this._onRotate;\n }\n return events;\n },\n\n /**\n * Return tile pixel bounds that cover the rotated viewport.\n * \n * @param {L.LatLng} center View center used to calculate bounds.\n * \n * @returns {L.Bounds} Pixel bounds covered by the layer's tiles.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getTiledPixelBounds(center) {\n if (!this._map._rotate) {\n return gridLayerProto._getTiledPixelBounds.apply(this, arguments);\n }\n\n return this._map._getNewPixelBounds(center, this._tileZoom);\n },\n\n});\n", "/**\n * Recalculates vector renderer bounds and transforms for rotated and pitched maps.\n *\n * @external L.Renderer\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/vector/Renderer.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst rendererProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Renderer.prototype));\nconst rendererBase = Object.getPrototypeOf(L.Renderer.prototype);\nconst rendererGetEvents = rendererProto.getEvents || rendererBase.getEvents;\nconst rendererOnMoveEnd = rendererProto._onMoveEnd || rendererBase._onMoveEnd;\n\nL.Renderer.include({\n\n /**\n * Subscribe the renderer to map rotation so its visible bounds are recalculated.\n * \n * @listens L.Map~rotate\n * \n * @returns {Object} Leaflet event map for the renderer.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = rendererGetEvents.apply(this, arguments);\n return Object.assign(events, { rotate: this._onRotate });\n },\n\n /**\n * Reproject vector paths and refresh renderer bounds after bearing changes.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onRotate() {\n if (!this._map._rotate) { return; }\n this._onZoomEnd();\n if (L.version.startsWith('2.')) {\n this._onMoveEnd();\n } else {\n this._update();\n }\n },\n\n /**\n * Add the zoom-animation class needed for correct renderer transforms in Leaflet 1.\n *\n * Fixes `map.flyTo()` when `map.options.zoomAnimation` is false.\n * \n * @see https://github.com/Leaflet/Leaflet/pull/8794\n * \n * @since leaflet-rotate (v0.2.0)\n */\n onAdd() {\n rendererProto.onAdd.apply(this, arguments);\n if (L.version <= \"1.9.3\") {\n // always keep transform-origin as 0 0\n this._container.classList.add('leaflet-zoom-animated');\n }\n },\n\n /**\n * Update the renderer transform during zoom animation, accounting for rotated coordinates.\n *\n * @FIXME layer drifts on `map.setZoom()` (eg. zoom during animation)\n * \n * the main cause seems to be related to `this._updateTransform(path._center, path._zoom))`\n * and `this._topLeft = this._map.layerPointToLatLng(this._bounds.min);`\n * \n * @example\n * map.setZoom(2);\n * path._renderer._update();\n * path._renderer._updateTransform(path._renderer._center, path._renderer._zoom);\n * \n * @see https://github.com/Leaflet/Leaflet/pull/8794\n * @see https://github.com/Leaflet/Leaflet/pull/8103\n * @see https://github.com/Leaflet/Leaflet/issues/7466\n * \n * @TODO recheck these changes against leaflet@v1.9.3\n * \n * @see https://github.com/Leaflet/Leaflet/compare/v1.7.0...v1.9.3\n * \n * @param {L.LatLng} center Target map center.\n * @param {number} zoom Target zoom level.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _updateTransform(center, zoom) {\n if (L.version.startsWith('2.')) {\n if (this._map._rotate) {\n const scale = this._map.getZoomScale(zoom, this._zoom),\n offset = this._topLeftPoint.multiplyBy(scale)\n .subtract(this._map._getNewPixelOrigin(center, zoom));\n\n L.DomUtil.setTransform(this._container, offset, scale);\n return;\n }\n return rendererBase._updateTransform.apply(this, arguments);\n }\n if (!this._map._rotate) {\n return rendererProto._updateTransform.apply(this, arguments);\n }\n if (zoom === this._zoom) {\n // _reset() has already repositioned the renderer at the current zoom.\n return;\n }\n /**\n * @FIXME see path._renderer._reset();\n */\n const scale = this._map.getZoomScale(zoom, this._zoom),\n offset = this._map._latLngToNewLayerPoint(this._topLeft, zoom, center);\n\n L.DomUtil.setTransform(this._container, offset, scale);\n \n },\n\n /**\n * Recalculate bounds and finish renderer updates after movement on Leaflet 2.\n *\n * @param {Object} ev Map movement event.\n * \n * @since leaflet-rotate (v0.4.0)\n */\n _onMoveEnd(ev) {\n if (!L.version.startsWith('2.') || !this._map._rotate) {\n return rendererOnMoveEnd.apply(this, arguments);\n }\n\n this._bounds = this._map._getPaddedPixelBounds(this.options.padding);\n this._topLeft = this._map.layerPointToLatLng(this._bounds.min);\n this._center = this._map.getCenter();\n this._zoom = this._map.getZoom();\n this._topLeftPoint = this._map._getNewPixelOrigin(this._center, this._zoom).add(this._bounds.min);\n this._updateTransform(this._center, this._zoom);\n this._resizeContainer();\n this._onSettled(ev);\n },\n\n /**\n * Resize the renderer container to cover the pitch-aware map bounds.\n * \n * @since leaflet-rotate (v0.4.0)\n */\n _resizeContainer() {\n if (!L.version.startsWith('2.') || !this._map._rotate || !this._bounds) {\n return rendererBase._resizeContainer.apply(this, arguments);\n }\n\n const size = this._bounds.getSize();\n this._container.style.width = size.x + 'px';\n this._container.style.height = size.y + 'px';\n return size;\n },\n\n // getEvents() {\n // const events = {\n // viewreset: this._reset,\n // zoom: this._onZoom,\n // moveend: this._update,\n // zoomend: this._onZoomEnd\n // };\n // if (this._zoomAnimated) {\n // events.zoomanim = this._onAnimZoom;\n // }\n // return events;\n // },\n\n // _onAnimZoom(ev) {\n // this._updateTransform(ev.center, ev.zoom);\n // },\n\n\t// _onZoom() {\n // this._updateTransform(this._map.getCenter(), this._map.getZoom());\n\t// },\n\n // _onZoomEnd() {\n // for (const id in this._layers) {\n // this._layers[id]._project();\n // }\n // },\n\n // _reset() {\n // this._update();\n // this._updateTransform(this._center, this._zoom);\n\n // for (const id in this._layers) {\n // this._layers[id]._reset();\n // }\n // },\n\n // _updatePaths() {\n // for (const id in this._layers) {\n // this._layers[id]._update();\n // }\n // },\n\n /**\n * Recalculate renderer bounds and cached view state.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _update() {\n if (!this._map._rotate) {\n return rendererProto._update.apply(this, arguments);\n }\n // Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n // Subclasses are responsible of firing the 'update' event.\n this._bounds = this._map._getPaddedPixelBounds(this.options.padding);\n this._topLeft = this._map.layerPointToLatLng(this._bounds.min);\n this._center = this._map.getCenter();\n this._zoom = this._map.getZoom();\n },\n\n});\n", "/**\n * Extends Leaflet maps with bearing rotation and 3D pitch.\n *\n * @external L.Map\n * \n * @since leaflet-rotate (v0.1.0)\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/Map.js\n */\n\n/**\n * @event L.Map#rotate Fired after the map bearing changes.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\n/**\n * @event L.Map#pitch Fired after the map pitch changes.\n * \n * @since leaflet-rotate (0.5.0)\n */\n\nimport { toPoint } from '../geometry/Point';\n\nconst mapProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Map.prototype));\n\nL.Map.mergeOptions({\n\n /**\n * @type {boolean} Enable bearing and pitch transformations.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotate: false,\n\n /**\n * @type {number} Initial map bearing in degrees.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n bearing: 0,\n\n /**\n * @type {number} Initial map pitch in degrees, clamped to 0\u201385.\n * \n * @since leaflet-rotate (0.5.0)\n */\n pitch: 0,\n\n});\n\nL.Map.include({\n\n /**\n * Apply an immediate animated-zoom frame without waiting for a transition delay.\n *\n * @param {L.LatLng} center Target center.\n * @param {number} zoom Target zoom level.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _animateZoomNoDelay(center, zoom) {\n if (!this._mapPane) { return; }\n\n this._animatingZoom = true;\n this._animateToCenter = center;\n this._animateToZoom = zoom;\n this._move(center, zoom, undefined, true);\n this._onZoomTransitionEnd();\n },\n\n /**\n * Initialize the Leaflet map and apply its initial bearing and pitch.\n * \n * @param {HTMLElement|string} id Map container element or its ID.\n * @param {Object} [options={}] Leaflet map options, including `rotate`, `bearing`, and `pitch`.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(id, options) {\n if (options.rotate) {\n this._rotate = true;\n this._bearing = 0;\n this._pitch = 0;\n }\n mapProto.initialize.apply(this, arguments);\n if (this.options.rotate) {\n this.on('resize', this._updatePitchTransform, this);\n this.setBearing(this.options.bearing);\n this.setPitch(this.options.pitch);\n }\n },\n\n /**\n * Given a pixel coordinate relative to the map container,\n * returns the corresponding pixel coordinate relative to\n * the [origin pixel](#map-getpixelorigin).\n * \n * @param {L.Point|number[]} point Pixel coordinate in the map container.\n * \n * @returns {L.Point} Corresponding layer-point coordinate.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n containerPointToLayerPoint(point) {\n if (!this._rotate) {\n return mapProto.containerPointToLayerPoint.apply(this, arguments);\n }\n if (this._pitch) {\n return this._transformPitchPoint(\n toPoint(point).subtract(this._getMapPanePos()),\n this._pitchInverseTransform\n );\n }\n return toPoint(point)\n .subtract(this._getMapPanePos())\n .rotateFrom(-this._bearing, this._getRotatePanePos())\n .subtract(this._getRotatePanePos());\n },\n\n /**\n * Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\n * returns the corresponding pixel coordinate relative to the map container.\n * \n * @param {L.Point|number[]} point Pixel coordinate in layer-point space.\n * \n * @returns {L.Point} Corresponding pixel coordinate in the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n layerPointToContainerPoint(point) {\n if (!this._rotate) {\n return mapProto.layerPointToContainerPoint.apply(this, arguments);\n }\n if (this._pitch) {\n return this._transformPitchPoint(point, this._pitchTransform).add(this._getMapPanePos());\n }\n return toPoint(point)\n .add(this._getRotatePanePos())\n .rotateFrom(this._bearing, this._getRotatePanePos())\n .add(this._getMapPanePos());\n },\n\n /**\n * Converts a coordinate from the rotated pane reference system\n * to the reference system of the not rotated map pane.\n * \n * (rotatePane) --> (mapPane)\n * (rotatePane) --> (norotatePane)\n * \n * @param {L.Point|number[]} point Point in the rotated pane.\n * \n * @returns {L.Point} Corresponding point in map-pane coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotatedPointToMapPanePoint(point) {\n if (this._pitch) {\n return this._transformPitchPoint(point, this._pitchTransform);\n }\n return toPoint(point)\n .rotate(this._bearing)\n ._add(this._getRotatePanePos());\n },\n\n /**\n * Converts a coordinate from the not rotated map pane reference system\n * to the reference system of the rotated pane.\n * \n * (mapPane) --> (rotatePane)\n * (norotatePane) --> (rotatePane)\n * \n * @param {L.Point|number[]} point Point in map-pane coordinates.\n * \n * @returns {L.Point} Corresponding point in the rotated pane.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n mapPanePointToRotatedPoint(point) {\n if (this._pitch) {\n return this._transformPitchPoint(point, this._pitchInverseTransform);\n }\n return toPoint(point)\n ._subtract(this._getRotatePanePos())\n .rotate(-this._bearing);\n },\n\n // latLngToLayerPoint(latlng) {\n // const projectedPoint = this.project(L.latLng(latlng))._round();\n // return projectedPoint._subtract(this.getPixelOrigin());\n // },\n\n // latLngToContainerPoint(latlng) {\n\t// \treturn this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng)));\n\t// },\n\n /**\n * Given latlng bounds, returns the bounds in projected pixel\n * relative to the map container.\n * \n * @see https://github.com/ronikar/Leaflet/blob/5c480ef959b947c3beed7065425a5a36c486262b/src/map/Map.js#L1114-L1135\n * \n * @param {L.LatLngBounds} bounds Geographic bounds to project.\n * \n * @returns {L.Bounds} Axis-aligned bounds in container-pixel coordinates.\n * \n * @since leaflet-rotate (v0.2.0)\n */\n mapBoundsToContainerBounds(bounds) {\n if (!this._rotate && mapProto.mapBoundsToContainerBounds) {\n return mapProto.mapBoundsToContainerBounds.apply(this, arguments);\n }\n\n // const nw = this.latLngToContainerPoint(bounds.getNorthWest()),\n // ne = this.latLngToContainerPoint(bounds.getNorthEast()),\n // sw = this.latLngToContainerPoint(bounds.getSouthWest()),\n // se = this.latLngToContainerPoint(bounds.getSouthEast());\n\n // same as `this.latLngToContainerPoint(latlng)` but with floating point precision\n const origin = this.getPixelOrigin();\n const nw = this.layerPointToContainerPoint(this.project(bounds.getNorthWest())._subtract(origin)),\n ne = this.layerPointToContainerPoint(this.project(bounds.getNorthEast())._subtract(origin)),\n sw = this.layerPointToContainerPoint(this.project(bounds.getSouthWest())._subtract(origin)),\n se = this.layerPointToContainerPoint(this.project(bounds.getSouthEast())._subtract(origin));\n\n return new L.Bounds([\n new L.Point(Math.min(nw.x, ne.x, se.x, sw.x), Math.min(nw.y, ne.y, se.y, sw.y)), // [ minX, minY ]\n new L.Point(Math.max(nw.x, ne.x, se.x, sw.x), Math.max(nw.y, ne.y, se.y, sw.y)) // [ maxX, maxY ]\n ]);\n },\n\n /**\n * Return the geographic bounds of the current viewport, accounting for rotation and pitch.\n * \n * The result is the smallest geographic bounds containing all four viewport corners.\n * \n * @returns {L.LatLngBounds} Geographic bounds visible in the map viewport.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getBounds() {\n if (!this._rotate) {\n return mapProto.getBounds.apply(this, arguments);\n }\n\n // SEE: https://github.com/fnicollet/Leaflet/pull/22\n //\n // const bounds = this.getPixelBounds(),\n // sw = this.unproject(bounds.getBottomLeft()),\n // ne = this.unproject(bounds.getTopRight());\n // return new LatLngBounds(sw, ne);\n //\n\n // LatLngBounds' constructor automatically\n // extends the bounds to fit the passed points\n const size = this.getSize();\n return new L.LatLngBounds([\n this.containerPointToLatLng([0, 0]), // topleft\n this.containerPointToLatLng([size.x, 0]), // topright \n this.containerPointToLatLng([size.x, size.y]), // bottomright\n this.containerPointToLatLng([0, size.y]), // bottomleft\n ]);\n },\n\n /**\n * Returns the bounds of the current map view in projected pixel\n * coordinates (sometimes useful in layer and overlay implementations).\n * \n * @TODO find out if map bounds calculated by `L.Map::getPixelBounds()`\n * function should match the `rotatePane` or `norotatePane` bounds\n *\n * @see https://github.com/fnicollet/Leaflet/issues/7\n * \n * @returns {L.Bounds}\n */\n // getPixelBounds(center, zoom) {\n // // const topLeftPoint = map.containerPointToLayerPoint(this._getTopLeftPoint());\n // const topLeftPoint = this._getTopLeftPoint(center, zoom);\n // return new L.Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\n // },\n\n /**\n * Set the map bearing, optionally animating to the new value.\n * \n * @param {number} theta Target bearing in degrees; normalized to [0, 360).\n * @param {Object} [options] Animation options.\n * @param {boolean} [options.animate=false] Animate the change.\n * @param {number} [options.duration=0.25] Animation duration in seconds.\n * @param {number} [options.easeLinearity=0.5] Easing curve linearity.\n * \n * @returns {void}\n * \n * @fires L.Map#rotate\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setBearing(theta, options) {\n if (!this._rotate) { return; }\n\n if (options && options.animate) {\n this._bearingAnimationId = (this._bearingAnimationId || 0) + 1;\n const animationId = this._bearingAnimationId;\n if (this._bearingAnimationFrame) {\n cancelAnimationFrame(this._bearingAnimationFrame);\n }\n\n const startBearing = this.getBearing(),\n endBearing = L.Util.wrapNum(theta, [0, 360]),\n delta = ((endBearing - startBearing + 540) % 360) - 180,\n duration = Math.max(0, options.duration == null ? 0.25 : options.duration) * 1000,\n easeLinearity = Math.max(options.easeLinearity || 0.5, 0.2),\n startTime = performance.now();\n\n const animate = function() {\n if (!this._mapPane) {\n delete this._bearingAnimationFrame;\n return;\n }\n\n const progress = duration ? Math.min((performance.now() - startTime) / duration, 1) : 1,\n eased = 1 - Math.pow(1 - progress, 1 / easeLinearity);\n\n this._setBearing(progress === 1 ? endBearing : startBearing + delta * eased);\n if (this._bearingAnimationId !== animationId) { return; }\n if (progress < 1) {\n this._bearingAnimationFrame = requestAnimationFrame(animate.bind(this));\n } else {\n delete this._bearingAnimationFrame;\n }\n };\n\n this._bearingAnimationFrame = requestAnimationFrame(animate.bind(this));\n return;\n }\n\n this._bearingAnimationId = (this._bearingAnimationId || 0) + 1;\n if (this._bearingAnimationFrame) {\n cancelAnimationFrame(this._bearingAnimationFrame);\n delete this._bearingAnimationFrame;\n }\n\n this._setBearing(theta);\n },\n\n /**\n * Apply a bearing immediately and update the rotated pane and map coordinates.\n * \n * @param {number} theta Bearing in degrees.\n * @param {L.LatLng} [mapCenter] Center to preserve while applying the change.\n * \n * @fires L.Map#rotate\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _setBearing(theta, mapCenter) {\n if (!mapCenter && this._loaded) {\n mapCenter = this.getCenter();\n }\n\n const bearing = L.Util.wrapNum(theta, [0, 360]) * (Math.PI / 180),\n center = this._getPixelCenter(),\n oldPos = this._getRotatePanePos().rotateFrom(-this._bearing, center),\n newPos = oldPos.rotateFrom(bearing, center);\n\n this._pivot = center;\n this._bearing = bearing;\n this._rotatePanePos = newPos;\n\n if (this._pitch) {\n this._rotatePane._leaflet_pos = oldPos;\n this._updatePitchTransform();\n } else {\n L.DomUtil.setPosition(this._rotatePane, oldPos, bearing, center);\n }\n\n if (mapCenter) {\n this._pixelOrigin = this.project(mapCenter, this._zoom)\n .subtract(this.containerPointToLayerPoint(this.getSize().divideBy(2)));\n delete this._lastCenter;\n this.fire('move');\n }\n\n this.fire('rotate');\n },\n\n /**\n * Transform a point with a projective matrix, accepting DOMMatrix or its 2D inverse.\n * \n * @param {L.Point|number[]} point Input pixel coordinate.\n * @param {DOMMatrix|Object} matrix Forward or inverse transformation matrix.\n * \n * @returns {L.Point} Transformed pixel coordinate.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _transformPitchPoint(point, matrix) {\n point = toPoint(point);\n if (!(matrix instanceof DOMMatrix)) {\n const denominator = matrix.g * point.x + matrix.h * point.y + matrix.i;\n return new L.Point(\n (matrix.a * point.x + matrix.b * point.y + matrix.c) / denominator,\n (matrix.d * point.x + matrix.e * point.y + matrix.f) / denominator\n );\n }\n const transformed = new DOMPoint(point.x, point.y).matrixTransform(matrix);\n return new L.Point(transformed.x / transformed.w, transformed.y / transformed.w);\n },\n\n /**\n * Apply the current pitch/bearing CSS transform and cache its forward and inverse matrices.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _updatePitchTransform() {\n if (!this._pitch || !this._rotatePane) { return; }\n\n const pivot = this._getPixelCenter(),\n size = this.getSize(),\n perspective = Math.max(1, size.y * 1.5),\n position = this._rotatePane._leaflet_pos || new L.Point(0, 0),\n transform = `translate3d(${pivot.x}px,${pivot.y}px,0) perspective(${perspective}px) rotateX(${this.getPitch()}deg) rotateZ(${this.getBearing()}deg) translate3d(${position.x - pivot.x}px,${position.y - pivot.y}px,0)`;\n\n this._rotatePane.style.transformOrigin = '0 0';\n this._rotatePane.style.transform = transform;\n const matrix = this._pitchTransform = new DOMMatrix(getComputedStyle(this._rotatePane).transform),\n a = matrix.m11, b = matrix.m21, c = matrix.m41,\n d = matrix.m12, e = matrix.m22, f = matrix.m42,\n g = matrix.m14, h = matrix.m24, i = matrix.m44,\n determinant = a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g);\n\n this._pitchInverseTransform = {\n a: (e * i - f * h) / determinant,\n b: (c * h - b * i) / determinant,\n c: (b * f - c * e) / determinant,\n d: (f * g - d * i) / determinant,\n e: (a * i - c * g) / determinant,\n f: (c * d - a * f) / determinant,\n g: (d * h - e * g) / determinant,\n h: (b * g - a * h) / determinant,\n i: (a * e - b * d) / determinant,\n };\n },\n\n /**\n * Set the map pitch in degrees. Values are clamped to the range 0\u201385.\n *\n * @param {number} pitch Pitch angle in degrees; clamped to [0, 85].\n * \n * @returns {L.Map} This map instance.\n * \n * @fires L.Map#pitch\n * \n * @since leaflet-rotate (0.5.0)\n */\n setPitch(pitch) {\n this._setPitchAndBearing(pitch, this.getBearing());\n return this;\n },\n\n /**\n * Update pitch and bearing together, preserving the current map center.\n * Used by the Ctrl+drag handler to avoid applying two separate transforms.\n * \n * @param {number} pitch Pitch angle in degrees.\n * @param {number} bearing Bearing angle in degrees.\n * \n * @fires L.Map#pitch\n * @fires L.Map#rotate\n * \n * @since leaflet-rotate (0.5.0)\n */\n _setPitchAndBearing(pitch, bearing) {\n if (!this._rotate) { return; }\n\n const clampedPitch = Math.max(0, Math.min(pitch, 85)) * (Math.PI / 180),\n clampedBearing = L.Util.wrapNum(bearing, [0, 360]) * (Math.PI / 180),\n pitchChanged = clampedPitch !== this._pitch;\n if (!pitchChanged && clampedBearing === this._bearing) { return; }\n\n const mapCenter = this._loaded ? this.getCenter() : undefined;\n if (pitchChanged) {\n this._pitch = clampedPitch;\n this._rotatePane.style.transformOrigin = L.version.startsWith('2.') ? '0 0' : '';\n }\n this._setBearing(bearing, mapCenter);\n if (pitchChanged) {\n this.fire('pitch');\n }\n },\n\n /**\n * Get the current map pitch in degrees.\n * \n * @returns {number} Pitch angle in degrees.\n * \n * @since leaflet-rotate (0.5.0)\n */\n getPitch() {\n return (this._pitch || 0) * (180 / Math.PI);\n },\n\n /**\n * Get the current map bearing. Enable the `rotate` map option before calling.\n * \n * @returns {number} Bearing in degrees, normalized to [0, 360).\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getBearing() {\n return this._bearing * (180 / Math.PI);\n },\n\n /**\n * Creates a new [map pane](#map-pane) with the given name if it doesn't\n * exist already, then returns it. The pane is created as a child of\n * `container`, or as a child of the main map pane if not set.\n * \n * @param {String} name leaflet pane\n * @param {HTMLElement} [container] parent element\n * \n * @returns {HTMLElement} pane container\n * \n * @since leaflet-rotate (v0.1.0)\n */\n // createPane(name, container) {\n // if (!this._rotate || name == 'mapPane') {\n // return mapProto.createPane.apply(this, arguments);\n // }\n // // init \"rotatePane\"\n // if (!this._rotatePane) {\n // // this._pivot = this.getSize().divideBy(2);\n // this._rotatePane = mapProto.createPane.call(this, 'rotatePane', this._mapPane);\n // L.DomUtil.setPosition(this._rotatePane, new L.Point(0, 0), this._bearing, this._pivot);\n // }\n // return mapProto.createPane.call(this, name, container || this._rotatePane);\n // },\n\n /**\n * Panes are DOM elements used to control the ordering of layers on\n * the map. You can access panes with [`map.getPane`](#map-getpane)\n * or [`map.getPanes`](#map-getpanes) methods. New panes can be created\n * with the [`map.createPane`](#map-createpane) method.\n * \n * Every map has the following default panes that differ only in zIndex:\n * \n * - mapPane [HTMLElement = 'auto'] - Pane that contains all other map panes\n * - tilePane [HTMLElement = 2] - Pane for tile layers\n * - overlayPane [HTMLElement = 4] - Pane for overlays like polylines and polygons\n * - shadowPane [HTMLElement = 5] - Pane for overlay shadows (e.g. marker shadows)\n * - markerPane [HTMLElement = 6] - Pane for marker icons\n * - tooltipPane [HTMLElement = 650] - Pane for tooltips.\n * - popupPane [HTMLElement = 700] - Pane for popups.\n */\n /**\n * Create the map's panes, placing tile/vector layers in the transformed pane\n * and markers/overlays in the pane that remains upright.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _initPanes() {\n const panes = this._panes = {};\n this._paneRenderers = {};\n\n this._mapPane = this.createPane('mapPane', this._container);\n L.DomUtil.setPosition(this._mapPane, new L.Point(0, 0));\n\n if (this._rotate) {\n this._rotatePane = this.createPane('rotatePane', this._mapPane);\n this._norotatePane = this.createPane('norotatePane', this._mapPane);\n if (L.version.startsWith('2.')) {\n this._rotatePane.style.transformOrigin = '0 0';\n }\n // rotatePane\n this.createPane('tilePane', this._rotatePane);\n this.createPane('overlayPane', this._rotatePane);\n // norotatePane\n this.createPane('shadowPane', this._norotatePane);\n this.createPane('markerPane', this._norotatePane);\n this.createPane('tooltipPane', this._norotatePane);\n this.createPane('popupPane', this._norotatePane);\n } else {\n this.createPane('tilePane');\n this.createPane('overlayPane');\n this.createPane('shadowPane');\n this.createPane('markerPane');\n this.createPane('tooltipPane');\n this.createPane('popupPane');\n }\n\n if (!this.options.markerZoomAnimation) {\n panes.markerPane.classList.add('leaflet-zoom-hide');\n panes.shadowPane.classList.add('leaflet-zoom-hide');\n }\n },\n\n /**\n * Pans the map the minimum amount to make the `latlng` visible. Use\n * padding options to fit the display to more restricted bounds.\n * If `latlng` is already within the (optionally padded) display bounds,\n * the map will not be panned.\n * \n * @see https://github.com/Raruto/leaflet-rotate/issues/18\n * \n * @param {L.LatLng} latlng Geographic point to keep visible.\n * @param {Object} [options={}] Padding options (`padding`, `paddingTopLeft`, `paddingBottomRight`).\n * \n * @returns {L.Map} current map instance\n * \n * @since leaflet-rotate (v0.1.4)\n */\n panInside(latlng, options) {\n if (!this._rotate || (!this._pitch && Math.abs(this._bearing).toFixed(1) < 0.1)) {\n return mapProto.panInside.apply(this, arguments);\n }\n\n options = options || {};\n\n const paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\n paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\n /** @TODO use mapProto.panInside */\n // pixelPoint = this.project(latlng),\n // pixelBounds = this.getPixelBounds(),\n // pixelCenter = this.project(this.getCenter()),\n pixelPoint = this.latLngToContainerPoint(latlng),\n pixelBounds = new L.Bounds([new L.Point(0, 0), this.getSize()]),\n pixelCenter = pixelBounds.getCenter(),\n //\n paddedBounds = new L.Bounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]),\n paddedSize = paddedBounds.getSize();\n \n if (!paddedBounds.contains(pixelPoint)) {\n this._enforcingBounds = true;\n const centerOffset = pixelPoint.subtract(paddedBounds.getCenter());\n const offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);\n pixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x;\n pixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y;\n /** @TODO use mapProto.panInside */\n // this.panTo(this.unproject(pixelCenter), options);\n this.panTo(this.containerPointToLatLng(pixelCenter), options);\n //\n this._enforcingBounds = false;\n }\n return this;\n },\n\n /**\n * Pans the map to the closest view that would lie inside the given bounds\n * (if it's not already), controlling the animation using the options specific,\n * if any.\n * \n * @TODO check if map bounds calculated by `L.Map::panInsideBounds()`\n * function should match the `rotatePane` or `norotatePane` bounds\n *\n * @see https://github.com/fnicollet/Leaflet/issues/7\n * \n * @param {L.LatLngBounds} bounds Geographic bounds to fit inside the viewport.\n * @param {Object} [options] Pan animation options.\n * \n * @returns {L.Map} This map instance.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n // panInsideBounds(bounds, options) {\n // this._enforcingBounds = true;\n // const center = this.getCenter(),\n // newCenter = this._limitCenter(center, this._zoom, L.latLngBounds(bounds));\n //\n // if (!center.equals(newCenter)) {\n // this.panTo(newCenter, options);\n // }\n //\n // this._enforcingBounds = false;\n // return this;\n // },\n\n // adjust center for view to get inside bounds\n // _limitCenter(center, zoom, bounds) {\n //\n // if (!bounds) { return center; }\n //\n // const centerPoint = this.project(center, zoom),\n // viewHalf = this.getSize().divideBy(2),\n // viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\n // offset = this._getBoundsOffset(viewBounds, bounds, zoom);\n //\n // // If offset is less than a pixel, ignore.\n // // This prevents unstable projections from getting into\n // // an infinite loop of tiny offsets.\n // if (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) {\n // return center;\n // }\n //\n // return this.unproject(centerPoint.add(offset), zoom);\n // },\n\n // @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this\n // Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\n // but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\n // flyToBounds(bounds, options) {\n // const target = this._getBoundsCenterZoom(bounds, options);\n // return this.flyTo(target.center, target.zoom, options);\n // },\n\n // _getBoundsCenterZoom(bounds, options) {\n //\n // options = options || {};\n // bounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds);\n //\n // const paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]),\n // paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]);\n //\n // let zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\n //\n // zoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;\n //\n // if (zoom === Infinity) {\n // return { center: bounds.getCenter(), zoom };\n // }\n //\n // return { center, zoom };\n //\n // },\n\n /**\n * Returns the maximum zoom level on which the given bounds fit to the map\n * view in its entirety. If `inside` (optional) is set to `true`, the method\n * instead returns the minimum zoom level on which the map view fits into\n * the given bounds in its entirety.\n * \n * @param {L.LatLngBounds} bounds Geographic bounds to fit.\n * @param {boolean} [inside=false] Fit the viewport inside bounds instead of bounds inside the viewport.\n * @param {L.Point|number[]} [padding=[0,0]] Pixel padding around the viewport.\n * \n * @returns {number} Zoom level satisfying the fit.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getBoundsZoom(bounds, inside, padding) {\n if (!this._rotate || (!this._pitch && Math.abs(this._bearing).toFixed(1) < 0.1)) {\n return mapProto.getBoundsZoom.apply(this, arguments);\n }\n\n bounds = bounds instanceof L.LatLngBounds ? bounds : new L.LatLngBounds(bounds);\n padding = toPoint(padding || [0, 0]);\n\n let zoom = this.getZoom() || 0;\n const min = this.getMinZoom(),\n max = this.getMaxZoom(),\n /** @TODO use mapProto.getBoundsZoom */\n // nw = bounds.getNorthWest(),\n // se = bounds.getSouthEast(),\n // size = this.getSize().subtract(padding),\n // boundsSize = L.bounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),\n size = this.getSize().subtract(padding),\n boundsSize = this.mapBoundsToContainerBounds(bounds).getSize(),\n snap = this.options.zoomSnap,\n scalex = size.x / boundsSize.x,\n scaley = size.y / boundsSize.y,\n scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\n\n zoom = this.getScaleZoom(scale, zoom);\n\n if (snap) {\n zoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\n zoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\n }\n\n return Math.max(min, Math.min(max, zoom));\n },\n\n /**\n * Layer point of the current center\n * \n * @returns {L.Point} layer center\n */\n // _getCenterLayerPoint() {\n // return this.containerPointToLayerPoint(this.getSize()._divideBy(2));\n // },\n\n /**\n * Return the pixel offset from the current center to the given geographic point.\n * \n * @param {L.LatLng} latlng Geographic point.\n * \n * @returns {L.Point} Offset in layer pixels, adjusted for bearing and pitch.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getCenterOffset(latlng) {\n let centerOffset = mapProto._getCenterOffset.apply(this, arguments);\n if (this._pitch) {\n const center = this.getSize()._divideBy(2);\n centerOffset = this.containerPointToLayerPoint(center.add(centerOffset))\n .subtract(this.containerPointToLayerPoint(center));\n } else if (this._rotate) {\n centerOffset = centerOffset.rotate(this._bearing);\n }\n return centerOffset;\n },\n\n /**\n * Return the current position of the rotated pane.\n * \n * @returns {L.Point} Rotated-pane position in map-pane coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getRotatePanePos() {\n return this._rotatePanePos || new L.Point(0, 0);\n // return L.DomUtil.getPosition(this._rotatePane) || new L.Point(0, 0);\n },\n\n // _latLngToNewLayerPoint(latlng, zoom, center) {\n // const topLeft = this._getNewPixelOrigin(center, zoom);\n // return this.project(latlng, zoom)._subtract(topLeft);\n //},\n\n /**\n * Calculate the pixel origin for a target view while preserving bearing-aware alignment.\n * \n * @param {L.LatLng} center Target center.\n * @param {number} zoom Target zoom level.\n * \n * @returns {L.Point} New pixel origin.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getNewPixelOrigin(center, zoom) {\n if (!this._rotate || L.version.startsWith('2.')) {\n return mapProto._getNewPixelOrigin.apply(this, arguments);\n }\n const viewHalf = this.getSize()._divideBy(2);\n return this.project(center, zoom)\n .rotate(this._bearing)\n ._subtract(viewHalf)\n ._add(this._getMapPanePos())\n ._add(this._getRotatePanePos())\n .rotate(-this._bearing)\n ._round();\n },\n\n /**\n * Calculate the pixel bounds needed to cover the transformed viewport.\n * \n * @param {L.LatLng} [center=this.getCenter()] Target center.\n * @param {number} [zoom=this.getZoom()] Target zoom level.\n * \n * @returns {L.Bounds} Pixel bounds in projected map coordinates.\n * \n * @since leaflet-rotate (v0.2.0)\n * \n * @see src\\layer\\tile\\GridLayer::_getTiledPixelBounds()\n */\n _getNewPixelBounds(center, zoom) {\n center = center || this.getCenter();\n zoom = zoom || this.getZoom();\n if (!this._rotate && mapProto._getNewPixelBounds) {\n return mapProto._getNewPixelBounds.apply(this, arguments);\n }\n const mapZoom = this._animatingZoom ? Math.max(this._animateToZoom, this.getZoom()) : this.getZoom(),\n scale = this.getZoomScale(mapZoom, zoom),\n pixelCenter = this.project(center, zoom).floor(),\n size = this.getSize(),\n halfSize = new L.Bounds([\n this.containerPointToLayerPoint([0, 0]).floor(),\n this.containerPointToLayerPoint([size.x, 0]).floor(),\n this.containerPointToLayerPoint([0, size.y]).floor(),\n this.containerPointToLayerPoint([size.x, size.y]).floor()\n ]).getSize().divideBy(scale * 2);\n\n return new L.Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));\n },\n\n /**\n * @since leaflet-rotate (v0.2.0)\n * \n * @returns {L.Point} Map pivot point in pixel coordinates.\n */\n _getPixelCenter() {\n if (!this._rotate && mapProto._getPixelCenter) {\n return mapProto._getPixelCenter.apply(this, arguments);\n }\n return this.getSize()._divideBy(2)._subtract(this._getMapPanePos());\n },\n\n /**\n * @see src\\layer\\vector\\Renderer::_update()\n * \n * @param {number} padding Bounds padding as a fraction of map size.\n * \n * @returns {L.Bounds} Padded bounds in layer-point coordinates.\n * \n * @since leaflet-rotate (v0.2.0)\n */\n _getPaddedPixelBounds(padding) {\n if (!this._rotate && mapProto._getPaddedPixelBounds) {\n return mapProto._getPaddedPixelBounds.apply(this, arguments);\n }\n const p = padding,\n size = this.getSize(),\n padMin = size.multiplyBy(-p),\n padMax = size.multiplyBy(1 + p);\n //min = this.containerPointToLayerPoint(size.multiplyBy(-p)).round();\n\n return new L.Bounds([\n this.containerPointToLayerPoint([padMin.x, padMin.y]).floor(),\n this.containerPointToLayerPoint([padMin.x, padMax.y]).floor(),\n this.containerPointToLayerPoint([padMax.x, padMin.y]).floor(),\n this.containerPointToLayerPoint([padMax.x, padMax.y]).floor()\n ]);\n },\n\n /**\n * Build and fire Leaflet's location-found event, including the device heading.\n * \n * @param {GeolocationPosition} pos Browser geolocation result.\n * \n * @fires L.Map#locationfound\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _handleGeolocationResponse(pos) {\n if (!this._container._leaflet_id) { return; }\n\n const lat = pos.coords.latitude,\n lng = pos.coords.longitude,\n /** @TODO use mapProto._handleGeolocationResponse */\n hdg = pos.coords.heading,\n latlng = new L.LatLng(lat, lng),\n bounds = latlng.toBounds(pos.coords.accuracy),\n options = this._locateOptions;\n\n if (options.setView) {\n const zoom = this.getBoundsZoom(bounds);\n this.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\n }\n\n const data = {\n latlng: latlng,\n bounds: bounds,\n timestamp: pos.timestamp,\n /** @TODO use mapProto._handleGeolocationResponse */\n heading: hdg\n };\n\n for (const i in pos.coords) {\n if (typeof pos.coords[i] === 'number') {\n data[i] = pos.coords[i];\n }\n }\n\n // @event locationfound: LocationEvent\n // Fired when geolocation (using the [`locate`](#map-locate) method)\n // went successfully.\n this.fire('locationfound', data);\n },\n\n /**\n * @see https://github.com/ronikar/Leaflet/blob/5c480ef959b947c3beed7065425a5a36c486262b/src/geo/LatLngBounds.js#L253-L264\n * \n * @param {L.Bounds} points \n * \n * @returns {L.Bounds}\n */\n // toCircumscribedBounds(points) {\n // const minX = points.reduce(function (pv, v) { return Math.min(pv, v.x); }, points[0].x),\n // maxX = points.reduce(function (pv, v) { return Math.max(pv, v.x); }, points[0].x),\n // minY = points.reduce(function (pv, v) { return Math.min(pv, v.y); }, points[0].y),\n // maxY = points.reduce(function (pv, v) { return Math.max(pv, v.y); }, points[0].y);\n //\n // return L.bounds(L.point(minX, minY), L.point(maxX, maxY));\n // },\n\n});\n", "/**\n * Sets map bearing from device orientation when the browser exposes compass data.\n * \n * @typedef L.Map.CompassBearing\n * @property {L.Map.CompassBearing} compassBearing Map handler, enabled to follow device heading.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.CompassBearing = L.Handler.extend({\n\n /**\n * @param {L.Map} map Map whose bearing follows device orientation.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(map) {\n this._map = map;\n /** @see https://caniuse.com/?search=DeviceOrientation */\n if ('ondeviceorientationabsolute' in window) {\n this.__deviceOrientationEvent = 'deviceorientationabsolute';\n } else if('ondeviceorientation' in window) {\n this.__deviceOrientationEvent = 'deviceorientation';\n }\n this._throttled = L.Util.throttle(this._onDeviceOrientation, 100, this);\n },\n\n /**\n * Subscribe to the supported device-orientation event, if available.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n if (this._map._rotate && this.__deviceOrientationEvent) {\n L.DomEvent.on(window, this.__deviceOrientationEvent, this._throttled, this);\n } else {\n // L.Map.CompassBearing handler will be automatically\n // disabled if device orientation is not supported.\n this.disable();\n }\n },\n\n /**\n * Unsubscribe from device orientation when the handler is disabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n if (this._map._rotate && this.__deviceOrientationEvent) {\n L.DomEvent.off(window, this.__deviceOrientationEvent, this._throttled, this);\n }\n },\n\n /**\n * Apply a device orientation reading to the map bearing.\n *\n * `DeviceOrientationEvent.absolute` - Indicates whether the device is providing absolute\n * orientation values (relatives to Magnetic North) or\n * using some arbitrary frame determined by the device.\n * \n * `DeviceOrientationEvent.alpha` - Returns the rotation of the device around the Z axis;\n * that is, the number of degrees by which the device is\n * being twisted around the center of the screen.\n * \n * `window.orientation` - Returns the screen orientation in degrees (in 90-degree increments)\n * of the viewport relative to the device's natural orientation.\n * Its only possible values are -90, 0, 90, and 180. Positive\n * values are counterclockwise; negative values are clockwise.\n * \n * @see https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/absolute\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/alpha\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/orientation\n *\n * @param {DeviceOrientationEvent} e Orientation reading from the browser.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onDeviceOrientation(e) {\n let angle = e.webkitCompassHeading != null ? e.webkitCompassHeading : e.alpha;\n let deviceOrientation = 0;\n\n if (!Number.isFinite(angle)) { return; }\n\n // Safari iOS\n if (!e.absolute && e.webkitCompassHeading) {\n angle = 360 - angle;\n }\n\n // Older browsers\n if (!e.absolute && 'undefined' !== typeof window.orientation) {\n deviceOrientation = window.orientation;\n }\n\n this._map.setBearing(angle - deviceOrientation);\n },\n\n});\n\n/**\n * Add Compass bearing handler to L.Map (disabled unless `window.DeviceOrientationEvent` is set).\n * \n * @property {L.Map.CompassBearing} compassBearing\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'compassBearing', L.Map.CompassBearing);\n", "/**\n * Calls `invalidateSize()` when the map container's inline style changes.\n * \n * @typedef L.Map.ContainerMutation\n * @property {boolean} [trackContainerMutation=false] Observe inline style changes on the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\n/**\n * @TODO check again this file after leaflet v1.9.3 (eg. L.Browser.mutation).\n * Mutation Observer support will likely be added by default in next releases.\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether the map uses mutation observers to\n * detect changes in its container and trigger\n * `invalidateSize`. Disabled by default due to\n * support not being available in all web browsers.\n *\n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n * \n * @see https://developer.mozilla.org/docs/Web/API/MutationObserver\n */\n trackContainerMutation: false\n\n});\n\nL.Map.ContainerMutation = L.Handler.extend({\n\n /**\n * Start observing the map container's style attribute.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n // if (!L.Browser.mutation) { return; }\n if (!this._observer) {\n this._observer = new MutationObserver(L.Util.bind(this._map.invalidateSize, this._map));\n }\n this._observer.observe(this._map.getContainer(), {\n childList: false,\n attributes: true,\n characterData: false,\n subtree: false,\n attributeFilter: ['style']\n });\n },\n\n /**\n * Stop observing container mutations.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n // if (!L.Browser.mutation) { return; }\n this._observer.disconnect();\n },\n\n});\n\n/**\n * Add Container mutation handler to L.Map (disabled unless `trackContainerMutation` is set).\n * \n * @property {L.Map.ContainerMutation} trackContainerMutation\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'trackContainerMutation', L.Map.ContainerMutation);\n", "/**\n * Shared implementation for two-finger pinch zoom and map rotation.\n * \n * @see https://github.com/fnicollet/Leaflet/commit/a77af51a6b10f308d1b9a16552091d1d0aee8834\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/handler/Map.TouchZoom.js\n * \n * @typedef L.Map.TouchGestures\n * @property {boolean} [bounceAtZoomLimits] Whether pinch zoom may temporarily exceed zoom limits.\n * @property {boolean} zoom Whether pinch zoom is enabled.\n * @property {boolean} rotate Whether touch rotation is enabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\n/**\n * Convert a touch's client coordinates to coordinates relative to the map container.\n * \n * @param {L.Map} map\n * @param {Touch} touch\n * \n * @returns {L.Point}\n * \n * @since leaflet-rotate (v0.1.0)\n */\nfunction touchToContainerPoint(map, touch) {\n const container = map.getContainer(),\n rect = container.getBoundingClientRect();\n\n return new L.Point(\n touch.clientX - rect.left - container.clientLeft,\n touch.clientY - rect.top - container.clientTop,\n );\n}\n\nL.Map.mergeOptions({\n\n /**\n * Whether pinch zoom may temporarily exceed min/max zoom and bounce back.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n bounceAtZoomLimits: true,\n\n});\n\nL.Map.TouchGestures = L.Handler.extend({\n\n /**\n * Initialize the shared handler from the map's touch zoom/rotation options.\n * \n * @param {L.Map} map Map whose touch gestures are handled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(map) {\n this._map = map;\n this.rotate = !!this._map.options.touchRotate;\n this.zoom = !!this._map.options.touchZoom;\n },\n\n /**\n * Listen for the start of two-finger gestures on the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n L.DomEvent.on(this._map._container, 'touchstart', this._onTouchStart, this);\n },\n\n /**\n * Remove the touch-start listener.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n L.DomEvent.off(this._map._container, 'touchstart', this._onTouchStart, this);\n },\n\n /**\n * Record initial touch points and start tracking a two-finger gesture.\n * \n * @param {TouchEvent} e Touch-start event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onTouchStart(e) {\n const map = this._map;\n\n if (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming || this._rotating) { return; }\n\n const p1 = touchToContainerPoint(map, e.touches[0]),\n p2 = touchToContainerPoint(map, e.touches[1]),\n vector = p1.subtract(p2);\n\n this._centerPoint = map.getSize()._divideBy(2);\n this._startLatLng = map.containerPointToLatLng(this._centerPoint);\n\n if (this.zoom) {\n if (map.options.touchZoom !== 'center') {\n this._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2));\n }\n this._startDist = p1.distanceTo(p2);\n this._startZoom = map.getZoom();\n this._zooming = true;\n } else {\n this._zooming = false;\n }\n\n if (this.rotate) {\n this._startTheta = Math.atan(vector.x / vector.y);\n this._startBearing = map.getBearing();\n if (vector.y < 0) { this._startBearing += 180; }\n this._rotating = true;\n } else {\n this._rotating = false;\n }\n\n this._moved = false;\n\n map._stop();\n\n L.DomEvent\n .on(document, 'touchmove', this._onTouchMove, this)\n .on(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n L.DomEvent.preventDefault(e);\n },\n\n /**\n * Update bearing and/or zoom while the two touch points move.\n * \n * @param {TouchEvent} e Touch-move event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onTouchMove(e) {\n if (!e.touches || e.touches.length !== 2 || !(this._zooming || this._rotating)) { return; }\n\n const map = this._map,\n p1 = touchToContainerPoint(map, e.touches[0]),\n p2 = touchToContainerPoint(map, e.touches[1]),\n vector = p1.subtract(p2),\n scale = p1.distanceTo(p2) / this._startDist;\n let delta;\n\n if (this._rotating) {\n const theta = Math.atan(vector.x / vector.y);\n let bearingDelta = (theta - this._startTheta) * (180 / Math.PI);\n if (vector.y < 0) { bearingDelta += 180; }\n if (bearingDelta) {\n /**\n * @TODO the pivot should be the last touch point,\n * but zoomAnimation manages to overwrite the rotate\n * pane position. Maybe related to #3529.\n * \n * @see https://github.com/Leaflet/Leaflet/pull/3529\n * @see https://github.com/fnicollet/Leaflet/commit/a77af51a6b10f308d1b9a16552091d1d0aee8834\n */\n map.setBearing(this._startBearing - bearingDelta);\n }\n }\n\n if (this._zooming) {\n this._zoom = map.getScaleZoom(scale, this._startZoom);\n\n if (!map.options.bounceAtZoomLimits && (\n (this._zoom < map.getMinZoom() && scale < 1) ||\n (this._zoom > map.getMaxZoom() && scale > 1))) {\n this._zoom = map._limitZoom(this._zoom);\n }\n\n if (map.options.touchZoom === 'center') {\n this._center = this._startLatLng;\n if (scale === 1) { return; }\n } else {\n // Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng\n delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint);\n if (scale === 1 && delta.x === 0 && delta.y === 0) { return; }\n\n const mapDelta = map._pitch\n ? map.containerPointToLayerPoint(this._centerPoint.add(delta))\n .subtract(map.containerPointToLayerPoint(this._centerPoint))\n : delta.rotate(-map.getBearing() * (Math.PI / 180));\n\n this._center = map.unproject(map.project(this._pinchStartLatLng).subtract(mapDelta));\n }\n\n }\n\n if (!this._moved) {\n map._moveStart(true, false);\n this._moved = true;\n }\n\n const moveFn = map._move.bind(map, this._center, this._zoom, { pinch: true, round: false }, undefined);\n moveFn();\n\n if (this.zoom) {\n if (map.options.zoomAnimation) {\n map._animateZoomNoDelay(this._center, map._limitZoom(this._zoom));\n } else {\n map._resetView(this._center, map._limitZoom(this._zoom));\n }\n }\n\n L.DomEvent.preventDefault(e);\n },\n\n /**\n * Finish the gesture, settle the zoom and remove document listeners.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onTouchEnd() {\n if (!this._moved || !(this._zooming || this._rotating)) {\n this._zooming = false;\n return;\n }\n\n this._zooming = false;\n this._rotating = false;\n L.DomEvent\n .off(document, 'touchmove', this._onTouchMove, this)\n .off(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n if (this.zoom) {\n // Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate.\n if (this._map.options.zoomAnimation) {\n this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap);\n } else {\n this._map._resetView(this._center, this._map._limitZoom(this._zoom));\n }\n }\n },\n\n});\n\n/**\n * Add the shared touch gesture handler to the map.\n * \n * @property {L.Map.TouchGestures} touchGestures\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'touchGestures', L.Map.TouchGestures);\n", "/**\n * Enables two-finger rotation through the shared touch-gesture handler.\n * \n * @typedef L.Map.TouchRotate\n * @property {boolean} [touchRotate=false] Enable two-finger map rotation.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether the map can be rotated with a two-finger rotation gesture\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n touchRotate: false,\n\n});\n\nL.Map.TouchRotate = L.Handler.extend({\n\n /**\n * Enable rotation handling in the map's shared touch gesture handler.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n this._map.touchGestures.enable();\n this._map.touchGestures.rotate = true;\n },\n\n /**\n * Disable rotation handling without affecting pinch zoom.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n this._map.touchGestures.rotate = false;\n },\n\n});\n\n/**\n * Add Touch Rotate handler (disabled unless `touchGestures` is set).\n * \n * @property {L.Map.TouchGestures} touchGestures\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'touchRotate', L.Map.TouchRotate);\n", "\n/**\n * Handles Shift+wheel bearing changes and Ctrl+drag bearing/pitch changes.\n * \n * @typedef L.Map.ShiftKeyRotate\n * @property {boolean} [shiftKeyRotate=true] Enable Shift+wheel bearing rotation.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether Shift+wheel changes the map bearing.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n shiftKeyRotate: true,\n\n /**\n * Whether Ctrl+drag changes bearing and pitch.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (0.5.0)\n */\n pitchDrag: true,\n\n});\n\nL.Map.ShiftKeyRotate = L.Handler.extend({\n\n /**\n * @param {L.Map} map Map controlled by this handler.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(map) {\n this._map = map;\n this._onMouseDownBound = this._onMouseDown.bind(this);\n this._onMouseMoveBound = this._onMouseMove.bind(this);\n this._onMouseUpBound = this._onMouseUp.bind(this);\n },\n\n /**\n * Attach enabled wheel and pointer/mouse gesture listeners.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n if (this._map.options.shiftKeyRotate) {\n L.DomEvent.on(this._map._container, \"wheel\", this._handleShiftScroll, this);\n }\n if (this._map.options.pitchDrag) {\n this.addPitchHooks();\n }\n },\n\n /**\n * Detach gesture listeners and cancel any active drag.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n L.DomEvent.off(this._map._container, \"wheel\", this._handleShiftScroll, this);\n this.removePitchHooks();\n },\n\n /**\n * Listen for the start of Ctrl+drag pitch gestures.\n * \n * @since leaflet-rotate (0.5.0)\n */\n addPitchHooks() {\n if (this._pitchHooksAdded) { return; }\n this._pitchEvents = L.version.startsWith('2.')\n ? ['pointerdown', 'pointermove', 'pointerup pointercancel']\n : ['mousedown', 'mousemove', 'mouseup'];\n this._map._container.addEventListener(this._pitchEvents[0], this._onMouseDownBound, true);\n this._pitchHooksAdded = true;\n },\n\n /**\n * Stop listening for pitch gestures and remove active document listeners.\n * \n * @since leaflet-rotate (0.5.0)\n */\n removePitchHooks() {\n if (!this._pitchHooksAdded) { return; }\n this._map._container.removeEventListener(this._pitchEvents[0], this._onMouseDownBound, true);\n this._onMouseUp();\n delete this._pitchEvents;\n this._pitchHooksAdded = false;\n },\n\n /**\n * Rotate the map in fixed increments while Shift is held during wheel input.\n * \n * @param {WheelEvent} e Wheel event from the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _handleShiftScroll(e) {\n if (e.shiftKey) {\n e.preventDefault();\n this._map.scrollWheelZoom.disable();\n this._map.setBearing(this._map.getBearing() + Math.sign(e.deltaY) * 5);\n } else {\n this._map.scrollWheelZoom.enable();\n }\n },\n\n /**\n * Start Ctrl+drag and capture subsequent movement outside the map.\n * \n * @param {MouseEvent|PointerEvent} e Gesture start event.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _onMouseDown(e) {\n if (!this._map._rotate || !this._map.options.pitchDrag || !e.ctrlKey || e.button !== 0) { return; }\n\n const scrollWheelZoom = this._map.scrollWheelZoom;\n if (scrollWheelZoom && scrollWheelZoom._timer) {\n clearTimeout(scrollWheelZoom._timer);\n scrollWheelZoom._timer = null;\n scrollWheelZoom._delta = 0;\n scrollWheelZoom._startTime = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n this._lastX = e.clientX;\n this._lastY = e.clientY;\n document.addEventListener(this._pitchEvents[1], this._onMouseMoveBound);\n for (const event of this._pitchEvents[2].split(' ')) {\n document.addEventListener(event, this._onMouseUpBound);\n }\n },\n\n /**\n * Apply pointer movement to pitch (vertical) and bearing (horizontal).\n * \n * @param {MouseEvent|PointerEvent} e Gesture movement event.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _onMouseMove(e) {\n this._map._setPitchAndBearing(\n this._map.getPitch() + (this._lastY - e.clientY) * 0.5,\n this._map.getBearing() + (e.clientX - this._lastX) * 0.8\n );\n this._lastX = e.clientX;\n this._lastY = e.clientY;\n e.preventDefault();\n },\n\n /**\n * End Ctrl+drag and clear document-level listeners.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _onMouseUp() {\n if (!this._pitchEvents) { return; }\n document.removeEventListener(this._pitchEvents[1], this._onMouseMoveBound);\n for (const event of this._pitchEvents[2].split(' ')) {\n document.removeEventListener(event, this._onMouseUpBound);\n }\n delete this._lastX;\n delete this._lastY;\n },\n\n});\n\n/**\n * Create the handler when either desktop rotation gesture is enabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook(function() {\n if (this.options.shiftKeyRotate) {\n this.shiftKeyRotate = new L.Map.ShiftKeyRotate(this);\n this.shiftKeyRotate.enable();\n } else if (this.options.pitchDrag) {\n this.shiftKeyRotate = new L.Map.ShiftKeyRotate(this);\n this.shiftKeyRotate.addPitchHooks();\n this.on('unload', this.shiftKeyRotate.removePitchHooks, this.shiftKeyRotate);\n }\n if (this.scrollWheelZoom.enabled() && this.options.shiftKeyRotate) {\n this.scrollWheelZoom.disable();\n this.scrollWheelZoom.enable();\n }\n});\n", "/**\n * Adds pinch zoom support through the shared touch-gesture handler.\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/handler/Map.TouchZoom.js\n * \n * @external L.Map.TouchZoom\n * @property {boolean|string} [touchZoom=L.Browser.touch] Enable pinch zoom; `'center'` zooms around the view center.\n * @property {boolean} [bounceAtZoomLimits=false] Allow pinch zoom to exceed zoom limits before settling.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether the map can be zoomed by touch-dragging\n * with two fingers. If passed `'center'`, it will\n * zoom to the center of the view regardless of\n * where the touch events (fingers) were. Enabled\n * for touch-capable web browsers.\n * \n * @type {(Boolean|String)}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n touchZoom: L.Browser.touch,\n\n /**\n * @TODO check if this is a duplicate of `L.Map.TouchGestures::bounceAtZoomLimits`\n * \n * Set it to false if you don't want the map to\n * zoom beyond min/max zoom and then bounce back\n * when pinch-zooming.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n bounceAtZoomLimits: false,\n\n});\n\nL.Map.TouchZoom = L.Handler.extend({\n\n /**\n * Enable pinch zoom handling and mark the shared touch handler as active.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n this._map._container.classList.add('leaflet-touch-zoom');\n this._map.touchGestures.enable();\n this._map.touchGestures.zoom = true;\n },\n\n /**\n * Disable pinch zoom handling while preserving touch rotation state.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n this._map._container.classList.remove('leaflet-touch-zoom');\n this._map.touchGestures.zoom = false;\n },\n\n});\n\n/**\n * Add Touch Zoom handler (disabled unless `L.Browser.touch` is set).\n * \n * @property {L.Map.TouchGestures} touchGestures\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'touchZoom', L.Map.TouchZoom);\n", "/**\n * Leaflet control for changing map rotation and selecting a rotation mode.\n * Its modes are:\n * \n * - Locked: rotation gestures are disabled.\n * - Touch: two-finger rotation is enabled.\n * - Compass: bearing follows device orientation when supported and permitted.\n * \n * @class L.Control.Rotate\n * \n * @extends L.Control\n * \n * @property {string} [position='topleft'] Leaflet control position.\n * @property {boolean} [closeOnZeroBearing=true] Hide the control when bearing is zero.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Control.Rotate = L.Control.extend({\n\n options: {\n position: 'topleft',\n closeOnZeroBearing: true\n },\n\n /**\n * Create the control element and subscribe to map rotation.\n * \n * @param {L.Map} map\n * \n * @returns {HTMLElement} Control container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n onAdd(map) {\n const container = this._container = L.DomUtil.create('div', 'leaflet-control-rotate leaflet-bar');\n\n // this.button = L.Control.Zoom.prototype._createButton.call(this, 'R', 'leaflet-control-rotate', 'leaflet-control-rotate', container, this._toggleLock);\n\n const arrow = this._arrow = L.DomUtil.create('span', 'leaflet-control-rotate-arrow');\n\n arrow.style.backgroundImage = `url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")`;\n arrow.style.cursor = 'grab';\n arrow.style.display = 'block';\n arrow.style.width = '100%';\n arrow.style.height = '100%';\n arrow.style.backgroundRepeat = 'no-repeat';\n arrow.style.backgroundPosition = '50%';\n\n // Copy-pasted from L.Control.Zoom\n const link = this._link = L.DomUtil.create('a', 'leaflet-control-rotate-toggle', container);\n link.appendChild(arrow);\n link.href = '#';\n link.title = 'Rotate map';\n\n L.DomEvent\n .on(link, 'dblclick', L.DomEvent.stopPropagation)\n .on(link, 'mousedown', this._handleMouseDown, this)\n .on(link, 'click', L.DomEvent.stop)\n .on(link, 'click', this._cycleState, this)\n .on(link, 'click', this._refocusOnMap, this);\n\n this._restyle();\n\n map.on('rotate', this._restyle, this);\n\n // State flag\n this._follow = false;\n this._canFollow = false;\n\n if (this.options.closeOnZeroBearing && map.getBearing() === 0) {\n container.style.display = 'none';\n }\n\n return container;\n },\n \n /**\n * Remove the map event listener when the control is detached.\n * \n * @param {L.Map} map\n * \n * @since leaflet-rotate (v0.1.0)\n */\n onRemove(map) {\n map.off('rotate', this._restyle, this);\n },\n\n /**\n * Begin dragging the control's bearing indicator.\n * \n * @param {MouseEvent} e Mouse-down event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _handleMouseDown(e) {\n L.DomEvent.stop(e);\n this.dragging = true;\n this.dragstartX = e.pageX;\n this.dragstartY = e.pageY;\n L.DomEvent\n .on(document, 'mousemove', this._handleMouseDrag, this)\n .on(document, 'mouseup', this._handleMouseUp, this);\n },\n\n /**\n * End bearing-indicator dragging and remove document listeners.\n * \n * @param {MouseEvent} e Mouse-up event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _handleMouseUp(e) {\n L.DomEvent.stop(e);\n this.dragging = false;\n\n L.DomEvent\n .off(document, 'mousemove', this._handleMouseDrag, this)\n .off(document, 'mouseup', this._handleMouseUp, this);\n },\n\n /**\n * Set bearing from the horizontal drag distance.\n * \n * @param {MouseEvent} e Mouse-move event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _handleMouseDrag(e) {\n if (!this.dragging) { return; }\n const deltaX = e.clientX - this.dragstartX;\n this._map.setBearing(deltaX);\n },\n\n /**\n * Cycle through touch, compass, and locked rotation modes.\n * Compass mode may require permission from the browser.\n * \n * @param {Event} ev Control click event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _cycleState(ev) {\n if (!this._map) {\n return;\n }\n\n const map = this._map;\n\n // Touch mode\n if (!map.touchRotate.enabled() && !map.compassBearing.enabled()) {\n map.touchRotate.enable();\n }\n \n // Compass mode\n else if (!map.compassBearing.enabled()) {\n map.touchRotate.disable();\n (\n DeviceOrientationEvent && DeviceOrientationEvent.requestPermission\n ? DeviceOrientationEvent.requestPermission() // iOS compass\n : Promise.resolve('granted') // others\n ).then(state => \"granted\" === state && map.compassBearing.enable())\n }\n\n // Locked mode\n else {\n map.compassBearing.disable();\n map.setBearing(0);\n if (this.options.closeOnZeroBearing) {\n map.touchRotate.enable();\n }\n }\n this._restyle();\n },\n\n /**\n * Update the control icon and visibility to match the current mode.\n * \n * @listens L.Map#rotate\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _restyle() {\n if (!this._map.options.rotate) {\n this._link.classList.add('leaflet-disabled');\n } else {\n const map = this._map;\n const bearing = map.getBearing();\n\n this._arrow.style.transform = 'rotate(' + bearing + 'deg)';\n\n if (bearing && this.options.closeOnZeroBearing) {\n this._container.style.display = 'block';\n }\n\n // Compass mode\n if (map.compassBearing.enabled()) {\n this._link.style.backgroundColor = 'orange';\n }\n \n // Touch mode\n else if (map.touchRotate.enabled()) {\n this._link.style.backgroundColor = null;\n }\n\n // Locked mode\n else {\n this._link.style.backgroundColor = 'grey';\n if (0 === bearing && this.options.closeOnZeroBearing) {\n this._container.style.display = 'none';\n }\n }\n }\n },\n\n});\n\nif (L.control) {\n L.control.rotate = options => new L.Control.Rotate(options);\n}\n\nL.Map.mergeOptions({\n /**\n * Add the rotation control automatically. Set to `false` to disable,\n * or pass an options object to configure the control.\n * \n * @type {boolean|Object}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotateControl: true,\n});\n\n/**\n * Add the configured rotation control to each newly initialized map.\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook(function() {\n if (this.options.rotateControl) {\n const options = typeof this.options.rotateControl === 'object' ? this.options.rotateControl : {};\n this.rotateControl = new L.Control.Rotate(options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;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ;AAAA,EAEJ,CAAC;AAED,MAAI,EAAE,SAAS;AACX,MAAE,QAAQ,SAAS,aAAW,IAAI,EAAE,QAAQ,OAAO,OAAO;AAAA,EAC9D;AAEA,IAAE,IAAI,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IASf,eAAe;AAAA,EACnB,CAAC;AAOD,IAAE,IAAI,YAAY,WAAW;AACzB,QAAI,KAAK,QAAQ,eAAe;AAC5B,YAAM,UAAU,OAAO,KAAK,QAAQ,kBAAkB,WAAW,KAAK,QAAQ,gBAAgB,CAAC;AAC/F,WAAK,gBAAgB,IAAI,EAAE,QAAQ,OAAO,OAAO;AACjD,WAAK,WAAW,KAAK,aAAa;AAAA,IACtC;AAAA,EACJ,CAAC;",
6
- "names": ["scale", "offset"]
3
+ "sources": ["../src/index.js", "../src/dom/DomUtil.js", "../src/dom/Draggable.js", "../src/geometry/Point.js", "../src/layer/DivOverlay.js", "../src/layer/Popup.js", "../src/layer/Tooltip.js", "../src/layer/marker/Icon.js", "../src/layer/marker/Marker.js", "../src/layer/tile/GridLayer.js", "../src/layer/vector/Renderer.js", "../src/map/Map.js", "../src/map/handler/CompassBearing.js", "../src/map/handler/ContainerMutation.js", "../src/map/handler/TouchGestures.js", "../src/map/handler/TouchRotate.js", "../src/map/handler/TouchPitch.js", "../src/map/handler/ShiftKeyRotate.js", "../src/map/handler/TouchZoom.js", "../src/control/Rotate.js"],
4
+ "sourcesContent": ["/**\n * Export Leaflet classes in the same order as the core library.\n *\n * @since leaflet-rotate (v0.1.0)\n * \n * @external L\n *\n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/Leaflet.js\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/control/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/core/index.js\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/dom/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/geometry/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/geo/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/marker/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/tile/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/layer/vector/index.js\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/index.js\n */\n\n// import {version} from '../package.json';\n// export {version};\n\n// control\n// export * from './core/index';\n\n// core\n// export * from './core/index';\n\n// dom\nexport * from './dom/DomUtil';\nexport * from './dom/Draggable';\n\n// geometry\nexport * from './geometry/Point';\nexport * from './geometry/Bounds';\n\n// geo\nexport * from './geo/LatLngBounds';\n\n// layer\nexport * from './layer/DivOverlay';\nexport * from './layer/Popup';\nexport * from './layer/Tooltip';\nexport * from './layer/marker/Icon';\nexport * from './layer/marker/Marker';\nexport * from './layer/tile/GridLayer';\nexport * from './layer/vector/Renderer';\n\n// map\nexport * from './map/Map';\nexport * from './map/handler/CompassBearing';\nexport * from './map/handler/ContainerMutation';\nexport * from './map/handler/TouchGestures';\nexport * from './map/handler/TouchRotate';\nexport * from './map/handler/TouchPitch';\nexport * from './map/handler/ShiftKeyRotate';\nexport * from './map/handler/TouchZoom';\n\n// custom controls\nexport * from './control/Rotate';\n", "/**\n * @external L.DomUtil\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/DomUtil.js\n */\n\nconst domUtilProto = Object.assign({}, L.DomUtil);\n\nObject.assign(L.DomUtil, {\n /**\n * Resets the 3D CSS transform of `el` so it is translated by `offset` pixels,\n * optionally scaled by `scale`, and rotated around `pivot` when `bearing` is set.\n *\n * @param {HTMLElement} el Element to transform.\n * @param {L.Point} [offset] Translation in pixels; defaults to the origin.\n * @param {number} [scale] Optional scale factor.\n * @param {number} [bearing] Optional rotation in radians.\n * @param {L.Point} [pivot] Point in pixels around which to rotate.\n * \n * @returns {void}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setTransform(el, offset, scale, bearing, pivot) {\n let pos = offset || new L.Point(0, 0);\n\n if (!bearing) {\n return domUtilProto.setTransform(el, pos._round(), scale);\n }\n\n pos = pos.rotateFrom(bearing, pivot);\n el.style.transform =\n 'translate3d(' + pos.x + 'px,' + pos.y + 'px,0)' +\n (scale ? ' scale(' + scale + ')' : '') +\n ' rotate(' + bearing + 'rad)';\n },\n\n /**\n * Sets the position of `el` to `point`, using CSS transforms or top/left positioning\n * depending on browser support, and optionally rotating it around `pivot`.\n *\n * @param {HTMLElement} el Element to position.\n * @param {L.Point} point Position in pixels.\n * @param {number} [bearing] Rotation in radians; zero or omitted uses Leaflet positioning.\n * @param {L.Point} [pivot] Point in pixels around which to rotate.\n * @param {number} [scale] Optional scale factor.\n * \n * @returns {void}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setPosition(el, point, bearing, pivot, scale) {\n if (!bearing) {\n return domUtilProto.setPosition(el, point);\n }\n\n el._leaflet_pos = point;\n L.DomUtil.setTransform(el, point, scale, bearing, pivot);\n },\n\n /**\n * Returns the position assigned to `el`.\n *\n * @param {HTMLElement} el Element whose Leaflet position is requested.\n * \n * @returns {L.Point} Stored Leaflet position, or the position measured by Leaflet.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getPosition(el) {\n return el._leaflet_pos || domUtilProto.getPosition(el);\n }\n});\n", "/**\n * This plugin does not modify the `L.Draggable` API; it adapts marker drag\n * coordinates in `L.Marker` when rotation or pitch is enabled.\n *\n * @external L.Draggable\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/Draggable.js\n */\n\n/**\n * A class for making DOM elements draggable (including touch support).\n * Used internally for map and marker dragging. Only works for elements\n * that were positioned with [`L.DomUtil.setPosition`](#domutil-setposition).\n *\n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Draggable.include({\n\n /** @TODO */\n // updateMapBearing(mapBearing) {\n // this._mapBearing = mapBearing;\n // },\n\n});", "/**\n * @external L.Point\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/geometry/Point.js\n */\n\nObject.assign(L.Point.prototype, {\n\n /**\n * Rotate around (0,0) by applying the 2D rotation matrix:\n * \n * \u23A1 x' \u23A4 = \u23A1 cos \u03B8 -sin \u03B8 \u23A4 \u23A1 x \u23A4\n * \u23A3 y' \u23A6 \u23A3 sin \u03B8 cos \u03B8 \u23A6 \u23A3 y \u23A6\n * \n * @param {number} theta Rotation angle in radians, counterclockwise.\n * @returns {L.Point} Rotated point (or this point when theta is zero).\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotate(theta) {\n return this.rotateFrom(theta, new L.Point(0,0))\n },\n\n /**\n * Rotate around (pivot.x, pivot.y) by:\n * \n * 1. subtract (pivot.x, pivot.y)\n * 2. rotate around (0, 0)\n * 3. add (pivot.x, pivot.y) back\n * \n * same as `this.subtract(pivot).rotate(theta).add(pivot)`\n * \n * @param {number} theta Rotation angle in radians, counterclockwise.\n * @param {L.Point} pivot Point to rotate around.\n * \n * @returns {L.Point}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotateFrom(theta, pivot) {\n if (!theta) { return this; }\n const sinTheta = Math.sin(theta);\n const cosTheta = Math.cos(theta);\n const cx = pivot.x,\n cy = pivot.y;\n const x = this.x - cx,\n y = this.y - cy;\n\n return new L.Point(\n x * cosTheta - y * sinTheta + cx,\n x * sinTheta + y * cosTheta + cy\n );\n },\n\n});\n\n/**\n * Convert an array or point-like object to an `L.Point`.\n * \n * @param {L.Point|number[]|{x:number,y:number}|null} point Coordinate to convert.\n * \n * @returns {L.Point|null} Existing point, converted point, or `null` for a null input.\n * \n * @since leaflet-rotate (v0.1.0)\n */\nexport function toPoint(point) {\n if (point == null || point instanceof L.Point) {\n return point;\n }\n return Array.isArray(point)\n ? new L.Point(point[0], point[1])\n : new L.Point(point.x, point.y);\n}\n", "/**\n * Keeps popup and tooltip screen positions aligned with rotated and pitched maps.\n *\n * @external L.DivOverlay\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/DivOverlay.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nimport { toPoint } from '../geometry/Point';\n\nconst divOverlayProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.DivOverlay.prototype));\n\nL.DivOverlay.include({\n\n /**\n * Extend overlay event subscriptions to refresh position after map rotation and pitch.\n * \n * @listens L.Map~rotate\n * @listens L.Map~pitch\n *\n * @returns {Object} Leaflet event map for the overlay.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = Object.assign(divOverlayProto.getEvents.apply(this, arguments), {\n rotate: this._updatePosition,\n pitch: this._updatePitchEvents,\n });\n if (this._map && this._map._pitch) {\n events.move = this._updatePosition;\n }\n return events;\n },\n\n /**\n * Listen to map movement only while pitch is non-zero.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _updatePitchEvents() {\n if (this._map._pitch) {\n this._map.on('move', this._updatePosition, this);\n } else {\n this._map.off('move', this._updatePosition, this);\n }\n },\n\n /**\n * Reposition the overlay after map movement, applying rotation/pitch-aware coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _updatePosition() {\n if (!this._map) { return; }\n divOverlayProto._updatePosition.apply(this, arguments);\n if (this._map._rotate && this._zoomAnimated) {\n const anchor = this._getAnchor();\n const pos = L.DomUtil.getPosition(this._container).subtract(anchor);\n L.DomUtil.setPosition(this._container, this._map.rotatedPointToMapPanePoint(pos).add(anchor));\n } else if (this._map._rotate) {\n const mapPanePoint = this._map.rotatedPointToMapPanePoint(this._map.latLngToLayerPoint(this._latlng)),\n offset = toPoint(this.options.offset || [0, 0]),\n anchor = this._getAnchor();\n\n this._containerLeft = -Math.round(this._containerWidth / 2) + mapPanePoint.x + offset.x + anchor.x;\n this._containerBottom = -(mapPanePoint.y + offset.y + anchor.y);\n this._container.style.left = this._containerLeft + 'px';\n this._container.style.bottom = this._containerBottom + 'px';\n this._container.style.top = '';\n L.DomUtil.setPosition(this._container, new L.Point(0, 0));\n this._container.style.transform = '';\n }\n\n },\n\n});\n", "/**\n * Preserves popup positioning and auto-pan behavior on rotated maps.\n *\n * @external L.Popup\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/Popup.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nimport { toPoint } from '../geometry/Point';\n\nconst popupProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Popup.prototype));\n\nL.Popup.include({\n\n /**\n * Update the popup position during zoom animation and transform it into map-pane coordinates.\n *\n * @param {Object} e Zoom animation event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _animateZoom(e) {\n popupProto._animateZoom.apply(this, arguments);\n if (this._map && this._map._rotate) {\n const anchor = this._getAnchor();\n const pos = L.DomUtil.getPosition(this._container).subtract(anchor);\n L.DomUtil.setPosition(this._container, this._map.rotatedPointToMapPanePoint(pos).add(anchor));\n }\n },\n\n /**\n * Pan the map when a popup with auto-pan enabled would extend beyond the viewport.\n * \n * @see https://github.com/fnicollet/Leaflet/pull/21\n *\n * @fires L.Map#autopanstart\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _adjustPan() {\n if (!this.options.autoPan || (this._map._panAnim && this._map._panAnim._inProgress)) { return; }\n\n // We can endlessly recurse if keepInView is set and the view resets.\n // Let's guard against that by exiting early if we're responding to our own autopan.\n if (this._autopanning) {\n this._autopanning = false;\n return;\n }\n\n const map = this._map,\n marginBottom = parseInt(getComputedStyle(this._container).marginBottom, 10) || 0,\n containerHeight = this._container.offsetHeight + marginBottom,\n containerWidth = this._containerWidth,\n layerPos = new L.Point(this._containerLeft, -containerHeight - this._containerBottom);\n\n layerPos._add(L.DomUtil.getPosition(this._container));\n\n /** @TODO use popupProto._adjustPan */\n // var containerPos = map.layerPointToContainerPoint(layerPos);\n const containerPos = layerPos._add(this._map._getMapPanePos()),\n padding = toPoint(this.options.autoPanPadding || [0, 0]),\n paddingTL = toPoint(this.options.autoPanPaddingTopLeft || padding),\n paddingBR = toPoint(this.options.autoPanPaddingBottomRight || padding),\n size = map.getSize();\n let dx = 0,\n dy = 0;\n\n if (containerPos.x + containerWidth + paddingBR.x > size.x) { // right\n dx = containerPos.x + containerWidth - size.x + paddingBR.x;\n }\n if (containerPos.x - dx - paddingTL.x < 0) { // left\n dx = containerPos.x - paddingTL.x;\n }\n if (containerPos.y + containerHeight + paddingBR.y > size.y) { // bottom\n dy = containerPos.y + containerHeight - size.y + paddingBR.y;\n }\n if (containerPos.y - dy - paddingTL.y < 0) { // top\n dy = containerPos.y - paddingTL.y;\n }\n\n // @namespace Map\n // @section Popup events\n // @event autopanstart: Event\n // Fired when the map starts autopanning when opening a popup.\n if (dx || dy) {\n // Track that we're autopanning, as this function will be re-ran on moveend\n if (this.options.keepInView) {\n this._autopanning = true;\n }\n map\n .fire('autopanstart')\n .panBy([dx, dy]);\n }\n },\n\n});\n", "/**\n * Keeps tooltips positioned correctly when the map is rotated or pitched.\n *\n * @external L.Tooltip\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/Tooltip.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst tooltipProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Tooltip.prototype));\n\nL.Tooltip.include({\n\n /**\n * Reposition the tooltip during zoom animation using transformed map coordinates.\n *\n * @param {Object} e Zoom animation event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _animateZoom(e) {\n if (!this._map._rotate) {\n return tooltipProto._animateZoom.apply(this, arguments);\n }\n let pos = this._map._latLngToNewLayerPoint(this._latlng, e.zoom, e.center);\n\n pos = this._map.rotatedPointToMapPanePoint(pos);\n this._setPosition(pos);\n },\n\n /**\n * Recompute tooltip screen position after map movement.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _updatePosition() {\n if (!this._map._rotate) {\n return tooltipProto._updatePosition.apply(this, arguments);\n }\n let pos = this._map.latLngToLayerPoint(this._latlng);\n\n pos = this._map.rotatedPointToMapPanePoint(pos);\n this._setPosition(pos);\n },\n\n});\n", "/**\n * Applies icon-anchor transform origins so marker rotation pivots around its anchor.\n *\n * @external L.Icon\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Icon.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst iconProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Icon.prototype));\n\nL.Icon.include({\n\n /**\n * Set marker icon dimensions and anchor styles, including the rotation origin.\n * \n * @param {HTMLImageElement} img Icon or shadow element.\n * @param {string} name Icon style key (`icon` or `shadow`).\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _setIconStyles(img, name) {\n const options = this.options;\n let sizeOption = options[name + 'Size'];\n\n if (typeof sizeOption === 'number') {\n sizeOption = [sizeOption, sizeOption];\n }\n\n const size = sizeOption ? new L.Point(...(Array.isArray(sizeOption) ? sizeOption : [sizeOption.x, sizeOption.y])) : null,\n anchorOption = name === 'shadow' && options.shadowAnchor || options.iconAnchor || size && size.divideBy(2, true),\n anchor = anchorOption ? new L.Point(...(Array.isArray(anchorOption) ? anchorOption : [anchorOption.x, anchorOption.y])) : null;\n\n img.className = 'leaflet-marker-' + name + ' ' + (options.className || '');\n\n if (anchor) {\n img.style.marginLeft = (-anchor.x) + 'px';\n img.style.marginTop = (-anchor.y) + 'px';\n /** @TODO use iconProto._setIconStyles */\n img.style.transformOrigin = anchor.x + \"px \" + anchor.y + \"px 0px\";\n }\n\n if (size) {\n img.style.width = size.x + 'px';\n img.style.height = size.y + 'px';\n }\n },\n\n});\n", "/**\n * Adds rotation and pitch-aware positioning to Leaflet markers.\n *\n * @external L.Marker\n * @external L.Handler.MarkerDrag\n * \n * @property {number} [rotation=0] Marker icon rotation in radians.\n * @property {boolean} [rotateWithView=false] Rotate the icon with the map bearing.\n * @property {boolean} [keepUpright=false] Flip a map-aligned icon to keep it upright.\n * @property {number} [scale] Optional scale applied to the icon and shadow.\n * \n * @since leaflet-rotate (v0.1.0)\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Marker.js\n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/marker/Marker.Drag.js\n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/dom/Draggable.js\n */\n\nconst markerProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Marker.prototype));\n\nL.Marker.mergeOptions({\n\n /**\n * Rotation of the marker icon in radians.\n * \n * @type {Number}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotation: 0,\n\n /**\n * Rotate the marker icon when the map bearing changes.\n *\n * Combine with `keepUpright: true` to keep the marker readable while\n * preserving its line alignment.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotateWithView: false,\n\n /**\n * Flip the icon when needed to keep it upright while map-aligned.\n *\n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n keepUpright: false,\n\n /**\n * Optional scale of the marker icon and shadow.\n * \n * @type {Number}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n scale: undefined,\n\n});\n\nlet markerDragProto; // retrived at runtime (see below: L.Marker::_initInteraction())\n\nconst MarkerDrag = {\n\n // _onDragStart() {\n // if (!this._marker._map._rotate) {\n // return markerDragProto._onDragStart.apply(this, arguments);\n // }\n // this._draggable.updateMapBearing(this._marker._map._bearing);\n // },\n\n /**\n * Update a dragged marker's geographic position from its transformed icon position.\n * \n * @param {Object} e Marker drag event with `latlng` and `oldLatLng` fields.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onDrag(e) {\n const marker = this._marker,\n /** @TODO use markerDragProto._onDrag */\n rotated_marker = marker.options.rotation || marker.options.rotateWithView,\n shadow = marker._shadow;\n let iconPos = L.DomUtil.getPosition(marker._icon);\n\n /** @TODO use markerDragProto._onDrag */\n // update shadow position\n if (!rotated_marker && shadow) {\n L.DomUtil.setPosition(shadow, iconPos);\n }\n\n /** @TODO use markerDragProto._onDrag */\n if (marker._map._rotate) {\n // Reverse calculation from mapPane coordinates to rotatePane coordinates\n iconPos = marker._map.mapPanePointToRotatedPoint(iconPos);\n }\n const latlng = marker._map.layerPointToLatLng(iconPos);\n\n marker._latlng = latlng;\n e.latlng = latlng;\n e.oldLatLng = this._oldLatLng;\n\n /** @TODO use markerDragProto._onDrag */\n if (rotated_marker) marker.setLatLng(latlng); // use `setLatLng` to presisit rotation. low efficiency\n else marker.fire('move', e); // `setLatLng` will trig 'move' event. we imitate here.\n\n // @event drag: Event\n // Fired repeatedly while the user drags the marker.\n marker\n .fire('drag', e);\n },\n\n /**\n * Reposition the marker after a drag ends, then run Leaflet's drag-end logic.\n * \n * @param {Object} e Marker drag-end event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onDragEnd(e) {\n if (this._marker._map._rotate) {\n this._marker.update();\n }\n markerDragProto._onDragEnd.apply(this, arguments);\n },\n\n};\n\nL.Marker.include({\n\n /**\n * Extend marker event subscriptions to reposition its icon after bearing or pitch changes.\n * \n * @listens L.Map~rotate\n * @listens L.Map~pitch\n * \n * @returns {Object} Leaflet event map for the marker.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = Object.assign(markerProto.getEvents.apply(this, arguments), {\n rotate: this.update,\n pitch: this._updatePitchEvents,\n });\n if (this._map && this._map._pitch) {\n events.move = this.update;\n }\n return events;\n },\n\n /**\n * Subscribe to map movement while pitch is active to keep the icon aligned.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _updatePitchEvents() {\n if (this._map._pitch) {\n this._map.on('move', this.update, this);\n } else {\n this._map.off('move', this.update, this);\n }\n },\n\n /**\n * Install rotation-aware drag callbacks when marker dragging is enabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _initInteraction() {\n const ret = markerProto._initInteraction.apply(this, arguments);\n if (this.dragging && this.dragging.enabled() && this._map && this._map._rotate) {\n // L.Handler.MarkerDrag is used internally by L.Marker to make the markers draggable\n markerDragProto = markerDragProto || Object.getPrototypeOf(this.dragging);\n this.dragging.disable();\n Object.assign(this.dragging, {\n // _onDragStart: MarkerDrag._onDragStart.bind(this.dragging),\n _onDrag: MarkerDrag._onDrag.bind(this.dragging),\n _onDragEnd: MarkerDrag._onDragEnd.bind(this.dragging),\n });\n this.dragging.enable();\n }\n return ret;\n },\n\n /**\n * Position and rotate the marker icon and shadow in map-pane coordinates.\n * \n * @param {L.Point} pos Marker anchor in layer-point coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _setPos(pos) {\n\n /** @TODO use markerProto._setPos */\n if (this._map._rotate) {\n pos = this._map.rotatedPointToMapPanePoint(pos);\n }\n\n /** @TODO use markerProto._setPos */\n let bearing = this.options.rotation || 0;\n if (this.options.rotateWithView) {\n bearing += this._map._bearing;\n }\n if (this.options.keepUpright) {\n bearing = ((bearing % (2 * Math.PI)) + 2 * Math.PI) % (2 * Math.PI);\n if (bearing > Math.PI / 2 && bearing < 3 * Math.PI / 2) {\n bearing += Math.PI;\n }\n bearing %= 2 * Math.PI;\n }\n\n /** @TODO use markerProto._setPos */\n if (this._icon) {\n L.DomUtil.setPosition(this._icon, pos, bearing, pos, this.options.scale);\n }\n\n /** @TODO use markerProto._setPos */\n if (this._shadow) {\n L.DomUtil.setPosition(this._shadow, pos, bearing, pos, this.options.scale);\n }\n\n this._zIndex = pos.y + this.options.zIndexOffset;\n\n this._resetZIndex();\n },\n\n // _updateZIndex(offset) {\n // if (!this._map._rotate) {\n // return markerProto._updateZIndex.apply(this, arguments);\n // }\n // this._icon.style.zIndex = Math.round(this._zIndex + offset);\n // },\n\n /**\n * Set the marker icon's rotation and redraw it.\n * \n * @param {number} rotation Angle in radians.\n * \n * @returns {void}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setRotation(rotation) {\n this.options.rotation = rotation;\n this.update();\n },\n\n});\n", "/**\n * Updates tile coverage for rotated map bounds.\n *\n * @external L.GridLayer\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/tile/GridLayer.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst gridLayerProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.GridLayer.prototype));\n\nL.GridLayer.include({\n\n /**\n * Add a throttled tile refresh after map bearing changes.\n * \n * @listens L.Map~rotate\n * \n * @returns {Object} Leaflet event map for the grid layer.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = gridLayerProto.getEvents.apply(this, arguments);\n if (this._map._rotate && !this.options.updateWhenIdle) {\n if (!this._onRotate) {\n this._onRotate = L.Util.throttle(this._onMoveEnd, this.options.updateInterval, this);\n }\n events.rotate = this._onRotateEvent;\n }\n return events;\n },\n\n /**\n * Keep tile levels aligned when a bearing/pitch change shifts the pixel origin\n * (eg. when the rotation pivot is not the view center), then refresh tiles (throttled).\n * \n * @listens L.Map~rotate\n * \n * @since leaflet-rotate (0.5.1)\n */\n _onRotateEvent() {\n const map = this._map;\n if (!map) { return; }\n const origin = map.getPixelOrigin();\n if (this._rotateOrigin && !this._rotateOrigin.equals(origin) && !map._animatingZoom && this._levels) {\n this._setZoomTransforms(map.getCenter(), map.getZoom());\n }\n this._rotateOrigin = origin;\n this._onRotate();\n },\n\n /**\n * Return tile pixel bounds that cover the rotated viewport.\n * \n * @param {L.LatLng} center View center used to calculate bounds.\n * \n * @returns {L.Bounds} Pixel bounds covered by the layer's tiles.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getTiledPixelBounds(center) {\n if (!this._map._rotate) {\n return gridLayerProto._getTiledPixelBounds.apply(this, arguments);\n }\n\n return this._map._getNewPixelBounds(center, this._tileZoom);\n },\n\n});\n", "/**\n * Recalculates vector renderer bounds and transforms for rotated and pitched maps.\n *\n * @external L.Renderer\n * \n * @see https://github.com/Leaflet/Leaflet/tree/v1.9.3/src/layer/vector/Renderer.js\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nconst rendererProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Renderer.prototype));\nconst rendererBase = Object.getPrototypeOf(L.Renderer.prototype);\nconst rendererGetEvents = rendererProto.getEvents || rendererBase.getEvents;\nconst rendererOnMoveEnd = rendererProto._onMoveEnd || rendererBase._onMoveEnd;\n\nL.Renderer.include({\n\n /**\n * Subscribe the renderer to map rotation so its visible bounds are recalculated.\n * \n * @listens L.Map~rotate\n * \n * @returns {Object} Leaflet event map for the renderer.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getEvents() {\n const events = rendererGetEvents.apply(this, arguments);\n return Object.assign(events, { rotate: this._onRotate });\n },\n\n /**\n * Refresh renderer bounds after bearing or pitch changes.\n * \n * Paths are reprojected only when the pixel origin actually changed (eg. fractional centers\n * after an off-center zoom), since reprojection is the main cost with long polylines.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onRotate() {\n if (!this._map._rotate) { return; }\n const origin = this._map.getPixelOrigin();\n if (!this._rotateOrigin || !this._rotateOrigin.equals(origin)) {\n this._rotateOrigin = origin;\n clearTimeout(this._rotateTimer);\n this._onZoomEnd();\n this._updateAfterRotate();\n return;\n }\n // paths are still aligned: only redraw when the view leaves the already drawn area\n if (this._bounds && this._bounds.contains(this._map._getPaddedPixelBounds(0))) { return; }\n clearTimeout(this._rotateTimer);\n const wait = (this._lastRotateUpdate || 0) + 100 - performance.now();\n if (wait > 0) {\n this._rotateTimer = setTimeout(() => this._map && this._updateAfterRotate(), wait);\n } else {\n this._updateAfterRotate();\n }\n },\n\n /**\n * Recalculate renderer bounds and redraw after bearing or pitch changes.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _updateAfterRotate() {\n this._lastRotateUpdate = performance.now();\n if (L.version.startsWith('2.')) {\n this._onMoveEnd();\n } else {\n this._update();\n }\n },\n\n /**\n * Add the zoom-animation class needed for correct renderer transforms in Leaflet 1.\n *\n * Fixes `map.flyTo()` when `map.options.zoomAnimation` is false.\n * \n * @see https://github.com/Leaflet/Leaflet/pull/8794\n * \n * @since leaflet-rotate (v0.2.0)\n */\n onAdd() {\n rendererProto.onAdd.apply(this, arguments);\n if (L.version <= \"1.9.3\") {\n // always keep transform-origin as 0 0\n this._container.classList.add('leaflet-zoom-animated');\n }\n },\n\n /**\n * Update the renderer transform during zoom animation, accounting for rotated coordinates.\n * \n * @see https://github.com/Leaflet/Leaflet/pull/8794\n * @see https://github.com/Leaflet/Leaflet/pull/8103\n * @see https://github.com/Leaflet/Leaflet/issues/7466\n * \n * @param {L.LatLng} center Target map center.\n * @param {number} zoom Target zoom level.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _updateTransform(center, zoom) {\n const v2 = L.version.startsWith('2.');\n if (!this._map._rotate) {\n return (v2 ? rendererBase : rendererProto)._updateTransform.apply(this, arguments);\n }\n if (!v2 && zoom === this._zoom) {\n // _reset() has already repositioned the renderer at the current zoom.\n return;\n }\n // Stay in pixel space: round-tripping `_topLeft` through lat/lng clamps at low zooms (layers jump).\n const scale = this._map.getZoomScale(zoom, this._zoom),\n offset = this._topLeftPoint.multiplyBy(scale)\n .subtract(this._map._getNewPixelOrigin(center, zoom));\n\n L.DomUtil.setTransform(this._container, offset, scale);\n },\n\n /**\n * Recalculate bounds and finish renderer updates after movement on Leaflet 2.\n *\n * @param {Object} ev Map movement event.\n * \n * @since leaflet-rotate (v0.4.0)\n */\n _onMoveEnd(ev) {\n if (!L.version.startsWith('2.') || !this._map._rotate) {\n return rendererOnMoveEnd.apply(this, arguments);\n }\n\n this._bounds = this._map._getPaddedPixelBounds(this.options.padding);\n this._topLeft = this._map.layerPointToLatLng(this._bounds.min);\n this._center = this._map.getCenter();\n this._zoom = this._map.getZoom();\n this._topLeftPoint = this._map._getNewPixelOrigin(this._center, this._zoom).add(this._bounds.min);\n this._updateTransform(this._center, this._zoom);\n this._resizeContainer();\n this._onSettled(ev);\n },\n\n /**\n * Resize the renderer container to cover the pitch-aware map bounds.\n * \n * @since leaflet-rotate (v0.4.0)\n */\n _resizeContainer() {\n if (!L.version.startsWith('2.') || !this._map._rotate || !this._bounds) {\n return rendererBase._resizeContainer.apply(this, arguments);\n }\n\n const size = this._bounds.getSize();\n this._container.style.width = size.x + 'px';\n this._container.style.height = size.y + 'px';\n return size;\n },\n\n // getEvents() {\n // const events = {\n // viewreset: this._reset,\n // zoom: this._onZoom,\n // moveend: this._update,\n // zoomend: this._onZoomEnd\n // };\n // if (this._zoomAnimated) {\n // events.zoomanim = this._onAnimZoom;\n // }\n // return events;\n // },\n\n // _onAnimZoom(ev) {\n // this._updateTransform(ev.center, ev.zoom);\n // },\n\n\t// _onZoom() {\n // this._updateTransform(this._map.getCenter(), this._map.getZoom());\n\t// },\n\n // _onZoomEnd() {\n // for (const id in this._layers) {\n // this._layers[id]._project();\n // }\n // },\n\n // _reset() {\n // this._update();\n // this._updateTransform(this._center, this._zoom);\n\n // for (const id in this._layers) {\n // this._layers[id]._reset();\n // }\n // },\n\n // _updatePaths() {\n // for (const id in this._layers) {\n // this._layers[id]._update();\n // }\n // },\n\n /**\n * Recalculate renderer bounds and cached view state.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _update() {\n if (!this._map._rotate) {\n return rendererProto._update.apply(this, arguments);\n }\n // Update pixel bounds of renderer container (for positioning/sizing/clipping later)\n // Subclasses are responsible of firing the 'update' event.\n this._bounds = this._map._getPaddedPixelBounds(this.options.padding);\n this._topLeft = this._map.layerPointToLatLng(this._bounds.min);\n this._center = this._map.getCenter();\n this._zoom = this._map.getZoom();\n this._topLeftPoint = this._map._getNewPixelOrigin(this._center, this._zoom).add(this._bounds.min);\n },\n\n});\n", "/**\n * Extends Leaflet maps with bearing rotation and 3D pitch.\n *\n * @external L.Map\n * \n * @since leaflet-rotate (v0.1.0)\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/Map.js\n */\n\n/**\n * @event L.Map#rotate Fired after the map bearing changes.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\n/**\n * @event L.Map#pitch Fired after the map pitch changes.\n * \n * @since leaflet-rotate (0.5.0)\n */\n\nimport { toPoint } from '../geometry/Point';\n\nconst mapProto = Object.defineProperties({}, Object.getOwnPropertyDescriptors(L.Map.prototype));\n\nL.Map.mergeOptions({\n\n /**\n * @type {boolean} Enable bearing and pitch transformations.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotate: false,\n\n /**\n * @type {number} Initial map bearing in degrees.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n bearing: 0,\n\n /**\n * @type {number} Initial map pitch in degrees, clamped to 0\u201385.\n * \n * @since leaflet-rotate (0.5.0)\n */\n pitch: 0,\n\n /**\n * @type {number} Maximum distance of the pitched map plane from the map center, in multiples\n * of the map height. Tiles, vectors and `getBounds()` stop there (and always\n * before the horizon); a `.leaflet-pitch-sky` element fills the area above.\n * \n * @since leaflet-rotate (0.5.1)\n */\n pitchMaxDistance: 3,\n\n});\n\nL.Map.include({\n\n /**\n * Apply an immediate animated-zoom frame without waiting for a transition delay.\n *\n * @param {L.LatLng} center Target center.\n * @param {number} zoom Target zoom level.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _animateZoomNoDelay(center, zoom) {\n if (!this._mapPane) { return; }\n\n this._animatingZoom = true;\n this._animateToCenter = center;\n this._animateToZoom = zoom;\n this._move(center, zoom, undefined, true);\n this._onZoomTransitionEnd();\n },\n\n /**\n * Initialize the Leaflet map and apply its initial bearing and pitch.\n * \n * @param {HTMLElement|string} id Map container element or its ID.\n * @param {Object} [options={}] Leaflet map options, including `rotate`, `bearing`, and `pitch`.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(id, options) {\n if (options.rotate) {\n this._rotate = true;\n this._bearing = 0;\n this._pitch = 0;\n }\n mapProto.initialize.apply(this, arguments);\n if (this.options.rotate) {\n this.on('resize', this._updatePitchTransform, this);\n this.on('move', this._updatePitchSky, this);\n this.setBearing(this.options.bearing);\n this.setPitch(this.options.pitch);\n }\n },\n\n /**\n * Given a pixel coordinate relative to the map container,\n * returns the corresponding pixel coordinate relative to\n * the [origin pixel](#map-getpixelorigin).\n * \n * @param {L.Point|number[]} point Pixel coordinate in the map container.\n * \n * @returns {L.Point} Corresponding layer-point coordinate.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n containerPointToLayerPoint(point) {\n if (!this._rotate) {\n return mapProto.containerPointToLayerPoint.apply(this, arguments);\n }\n if (this._pitch) {\n return this._transformPitchPoint(\n toPoint(point).subtract(this._getMapPanePos()),\n this._pitchInverseTransform\n );\n }\n return toPoint(point)\n .subtract(this._getMapPanePos())\n .rotateFrom(-this._bearing, this._getRotatePanePos())\n .subtract(this._getRotatePanePos());\n },\n\n /**\n * Given a pixel coordinate relative to the [origin pixel](#map-getpixelorigin),\n * returns the corresponding pixel coordinate relative to the map container.\n * \n * @param {L.Point|number[]} point Pixel coordinate in layer-point space.\n * \n * @returns {L.Point} Corresponding pixel coordinate in the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n layerPointToContainerPoint(point) {\n if (!this._rotate) {\n return mapProto.layerPointToContainerPoint.apply(this, arguments);\n }\n if (this._pitch) {\n return this._transformPitchPoint(point, this._pitchTransform).add(this._getMapPanePos());\n }\n return toPoint(point)\n .add(this._getRotatePanePos())\n .rotateFrom(this._bearing, this._getRotatePanePos())\n .add(this._getMapPanePos());\n },\n\n /**\n * Converts a coordinate from the rotated pane reference system\n * to the reference system of the not rotated map pane.\n * \n * (rotatePane) --> (mapPane)\n * (rotatePane) --> (norotatePane)\n * \n * @param {L.Point|number[]} point Point in the rotated pane.\n * \n * @returns {L.Point} Corresponding point in map-pane coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotatedPointToMapPanePoint(point) {\n if (this._pitch) {\n return this._transformPitchPoint(point, this._pitchTransform);\n }\n return toPoint(point)\n .rotate(this._bearing)\n ._add(this._getRotatePanePos());\n },\n\n /**\n * Converts a coordinate from the not rotated map pane reference system\n * to the reference system of the rotated pane.\n * \n * (mapPane) --> (rotatePane)\n * (norotatePane) --> (rotatePane)\n * \n * @param {L.Point|number[]} point Point in map-pane coordinates.\n * \n * @returns {L.Point} Corresponding point in the rotated pane.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n mapPanePointToRotatedPoint(point) {\n if (this._pitch) {\n return this._transformPitchPoint(point, this._pitchInverseTransform);\n }\n return toPoint(point)\n ._subtract(this._getRotatePanePos())\n .rotate(-this._bearing);\n },\n\n // latLngToLayerPoint(latlng) {\n // const projectedPoint = this.project(L.latLng(latlng))._round();\n // return projectedPoint._subtract(this.getPixelOrigin());\n // },\n\n // latLngToContainerPoint(latlng) {\n\t// \treturn this.layerPointToContainerPoint(this.latLngToLayerPoint(toLatLng(latlng)));\n\t// },\n\n /**\n * Given latlng bounds, returns the bounds in projected pixel\n * relative to the map container.\n * \n * @see https://github.com/ronikar/Leaflet/blob/5c480ef959b947c3beed7065425a5a36c486262b/src/map/Map.js#L1114-L1135\n * \n * @param {L.LatLngBounds} bounds Geographic bounds to project.\n * \n * @returns {L.Bounds} Axis-aligned bounds in container-pixel coordinates.\n * \n * @since leaflet-rotate (v0.2.0)\n */\n mapBoundsToContainerBounds(bounds) {\n if (!this._rotate && mapProto.mapBoundsToContainerBounds) {\n return mapProto.mapBoundsToContainerBounds.apply(this, arguments);\n }\n\n // const nw = this.latLngToContainerPoint(bounds.getNorthWest()),\n // ne = this.latLngToContainerPoint(bounds.getNorthEast()),\n // sw = this.latLngToContainerPoint(bounds.getSouthWest()),\n // se = this.latLngToContainerPoint(bounds.getSouthEast());\n\n // same as `this.latLngToContainerPoint(latlng)` but with floating point precision\n const origin = this.getPixelOrigin();\n const nw = this.layerPointToContainerPoint(this.project(bounds.getNorthWest())._subtract(origin)),\n ne = this.layerPointToContainerPoint(this.project(bounds.getNorthEast())._subtract(origin)),\n sw = this.layerPointToContainerPoint(this.project(bounds.getSouthWest())._subtract(origin)),\n se = this.layerPointToContainerPoint(this.project(bounds.getSouthEast())._subtract(origin));\n\n return new L.Bounds([\n new L.Point(Math.min(nw.x, ne.x, se.x, sw.x), Math.min(nw.y, ne.y, se.y, sw.y)), // [ minX, minY ]\n new L.Point(Math.max(nw.x, ne.x, se.x, sw.x), Math.max(nw.y, ne.y, se.y, sw.y)) // [ maxX, maxY ]\n ]);\n },\n\n /**\n * Return the geographic bounds of the current viewport, accounting for rotation and pitch.\n * \n * The result is the smallest geographic bounds containing all four viewport corners.\n * \n * @returns {L.LatLngBounds} Geographic bounds visible in the map viewport.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getBounds() {\n if (!this._rotate) {\n return mapProto.getBounds.apply(this, arguments);\n }\n\n // SEE: https://github.com/fnicollet/Leaflet/pull/22\n //\n // const bounds = this.getPixelBounds(),\n // sw = this.unproject(bounds.getBottomLeft()),\n // ne = this.unproject(bounds.getTopRight());\n // return new LatLngBounds(sw, ne);\n //\n\n // LatLngBounds' constructor automatically\n // extends the bounds to fit the passed points\n const [min, max] = this._getPitchedContainerBounds(0);\n return new L.LatLngBounds([\n this.containerPointToLatLng([min.x, min.y]), // topleft\n this.containerPointToLatLng([max.x, min.y]), // topright \n this.containerPointToLatLng([max.x, max.y]), // bottomright\n this.containerPointToLatLng([min.x, max.y]), // bottomleft\n ]);\n },\n\n /**\n * Return the container rectangle covering the visible map plane, optionally padded by a\n * fraction of the map size. When pitched, its top is cut at the far plane (see `pitchMaxDistance`)\n * so that it never reaches the horizon, where the plane would extend to infinity.\n * \n * @param {number} padding Padding as a fraction of the map size.\n * \n * @returns {L.Point[]} Top-left and bottom-right container points.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _getPitchedContainerBounds(padding) {\n const size = this.getSize(),\n min = size.multiplyBy(-padding),\n max = size.multiplyBy(1 + padding);\n if (this._pitch) {\n min.y = Math.min(Math.max(min.y, this._getPitchFarY()), max.y);\n }\n return [min, max];\n },\n\n /**\n * Return the container y coordinate of the far plane: points above it are farther than\n * `pitchMaxDistance` from the map center, or beyond the horizon.\n * \n * @returns {number} Container y coordinate (`-Infinity` when the whole map is close enough).\n * \n * @since leaflet-rotate (0.5.1)\n */\n _getPitchFarY() {\n const size = this.getSize(),\n inverse = this._pitchInverseTransform,\n panePos = this._getMapPanePos(),\n x = size.x / 2 - panePos.x,\n centerY = size.y / 2 - panePos.y,\n maxDistance = this.options.pitchMaxDistance * size.y,\n w = y => inverse.g * x + inverse.h * y + inverse.i,\n centerW = w(centerY),\n center = this._transformPitchPoint([x, centerY], inverse),\n // the horizon is horizontal on screen (bearing is applied before the pitch)\n isNear = y => w(y) * centerW > 0 && this._transformPitchPoint([x, y], inverse).distanceTo(center) <= maxDistance;\n\n let far = -size.y - panePos.y, near = centerY;\n if (isNear(far)) { return -Infinity; }\n for (let i = 0; i < 20; i++) {\n const mid = (far + near) / 2;\n if (isNear(mid)) { near = mid; } else { far = mid; }\n }\n return near + panePos.y;\n },\n\n /**\n * Returns the bounds of the current map view in projected pixel\n * coordinates (sometimes useful in layer and overlay implementations).\n * \n * @TODO find out if map bounds calculated by `L.Map::getPixelBounds()`\n * function should match the `rotatePane` or `norotatePane` bounds\n *\n * @see https://github.com/fnicollet/Leaflet/issues/7\n * \n * @returns {L.Bounds}\n */\n // getPixelBounds(center, zoom) {\n // // const topLeftPoint = map.containerPointToLayerPoint(this._getTopLeftPoint());\n // const topLeftPoint = this._getTopLeftPoint(center, zoom);\n // return new L.Bounds(topLeftPoint, topLeftPoint.add(this.getSize()));\n // },\n\n /**\n * Set the map bearing, optionally animating to the new value.\n * \n * @param {number} theta Target bearing in degrees; normalized to [0, 360).\n * @param {Object} [options] Animation options.\n * @param {boolean} [options.animate=false] Animate the change.\n * @param {number} [options.duration=0.25] Animation duration in seconds.\n * @param {number} [options.easeLinearity=0.5] Easing curve linearity.\n * \n * @returns {void}\n * \n * @fires L.Map#rotate\n * \n * @since leaflet-rotate (v0.1.0)\n */\n setBearing(theta, options) {\n if (!this._rotate) { return; }\n\n if (options && options.animate) {\n this._animatePitchBearing(this.getPitch(), theta, options);\n return;\n }\n\n this._stopPitchBearingAnimation();\n this._setBearing(theta);\n },\n\n /**\n * Animate pitch and bearing together (bearing follows the shortest path).\n * \n * @param {number} pitch Target pitch in degrees.\n * @param {number} bearing Target bearing in degrees.\n * @param {Object} [options] Animation options.\n * @param {number} [options.duration=0.25] Animation duration in seconds.\n * @param {number} [options.easeLinearity=0.5] Easing curve linearity.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _animatePitchBearing(pitch, bearing, options) {\n this._stopPitchBearingAnimation();\n const animationId = this._bearingAnimationId;\n\n const startBearing = this.getBearing(),\n startPitch = this.getPitch(),\n endBearing = L.Util.wrapNum(bearing, [0, 360]),\n endPitch = Math.max(0, Math.min(pitch, 85)),\n delta = ((endBearing - startBearing + 540) % 360) - 180,\n duration = Math.max(0, options.duration == null ? 0.25 : options.duration) * 1000,\n easeLinearity = Math.max(options.easeLinearity || 0.5, 0.2),\n startTime = performance.now();\n\n const animate = function() {\n if (!this._mapPane || this._bearingAnimationId !== animationId) {\n return;\n }\n\n const progress = duration ? Math.min((performance.now() - startTime) / duration, 1) : 1,\n eased = 1 - Math.pow(1 - progress, 1 / easeLinearity);\n\n if (progress < 1) {\n this._bearingAnimationFrame = requestAnimationFrame(animate.bind(this));\n } else {\n delete this._bearingAnimationFrame;\n }\n this._setPitchAndBearing(\n progress === 1 ? endPitch : startPitch + (endPitch - startPitch) * eased,\n progress === 1 ? endBearing : startBearing + delta * eased\n );\n };\n\n this._bearingAnimationFrame = requestAnimationFrame(animate.bind(this));\n },\n\n /**\n * Cancel a running pitch/bearing animation.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _stopPitchBearingAnimation() {\n this._bearingAnimationId = (this._bearingAnimationId || 0) + 1;\n if (this._bearingAnimationFrame) {\n cancelAnimationFrame(this._bearingAnimationFrame);\n delete this._bearingAnimationFrame;\n }\n },\n\n /**\n * Rotate the map back to north (bearing 0), animated by default.\n * \n * @param {Object} [options] Animation options (`animate`, `duration`, `easeLinearity`).\n * \n * @returns {L.Map} This map instance.\n * \n * @since leaflet-rotate (0.5.1)\n */\n resetNorth(options) {\n options = Object.assign({ animate: true, duration: 0.5 }, options);\n if (options.animate) {\n this._animatePitchBearing(this.getPitch(), 0, options);\n } else {\n this.setBearing(0);\n }\n return this;\n },\n\n /**\n * Rotate the map back to north and remove the pitch, animated by default.\n * \n * @param {Object} [options] Animation options (`animate`, `duration`, `easeLinearity`).\n * \n * @returns {L.Map} This map instance.\n * \n * @since leaflet-rotate (0.5.1)\n */\n resetNorthPitch(options) {\n options = Object.assign({ animate: true, duration: 0.5 }, options);\n if (options.animate) {\n this._animatePitchBearing(0, 0, options);\n } else {\n this._stopPitchBearingAnimation();\n this._setPitchAndBearing(0, 0);\n }\n return this;\n },\n\n /**\n * Apply a bearing immediately and update the rotated pane and map coordinates.\n * \n * @param {number} theta Bearing in degrees.\n * @param {L.LatLng} [mapCenter] Center to preserve while applying the change.\n * \n * @fires L.Map#rotate\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _setBearing(theta, mapCenter) {\n if (!mapCenter && this._loaded) {\n mapCenter = this.getCenter();\n }\n\n const bearing = L.Util.wrapNum(theta, [0, 360]) * (Math.PI / 180),\n center = this._getPixelCenter(),\n oldPos = this._getRotatePanePos().rotateFrom(-this._bearing, center),\n newPos = oldPos.rotateFrom(bearing, center);\n\n this._pivot = center;\n this._bearing = bearing;\n this._rotatePanePos = newPos;\n\n if (this._pitch) {\n this._rotatePane._leaflet_pos = oldPos;\n this._updatePitchTransform();\n } else {\n L.DomUtil.setPosition(this._rotatePane, oldPos, bearing, center);\n }\n\n if (mapCenter) {\n this._pixelOrigin = this.project(mapCenter, this._zoom)\n .subtract(this.containerPointToLayerPoint(this.getSize().divideBy(2)));\n delete this._lastCenter;\n this.fire('move');\n }\n\n this.fire('rotate');\n },\n\n /**\n * Transform a point with a projective matrix, accepting DOMMatrix or its 2D inverse.\n * \n * @param {L.Point|number[]} point Input pixel coordinate.\n * @param {DOMMatrix|Object} matrix Forward or inverse transformation matrix.\n * \n * @returns {L.Point} Transformed pixel coordinate.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _transformPitchPoint(point, matrix) {\n point = toPoint(point);\n if (!(matrix instanceof DOMMatrix)) {\n const denominator = matrix.g * point.x + matrix.h * point.y + matrix.i;\n return new L.Point(\n (matrix.a * point.x + matrix.b * point.y + matrix.c) / denominator,\n (matrix.d * point.x + matrix.e * point.y + matrix.f) / denominator\n );\n }\n const transformed = new DOMPoint(point.x, point.y).matrixTransform(matrix);\n return new L.Point(transformed.x / transformed.w, transformed.y / transformed.w);\n },\n\n /**\n * Apply the current pitch/bearing CSS transform and cache its forward and inverse matrices.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _updatePitchTransform() {\n if (!this._pitch || !this._rotatePane) { return; }\n\n const pivot = this._getPixelCenter(),\n size = this.getSize(),\n perspective = Math.max(1, size.y * 1.5),\n position = this._rotatePane._leaflet_pos || new L.Point(0, 0),\n transform = `translate3d(${pivot.x}px,${pivot.y}px,0) perspective(${perspective}px) rotateX(${this.getPitch()}deg) rotateZ(${this.getBearing()}deg) translate3d(${position.x - pivot.x}px,${position.y - pivot.y}px,0)`;\n\n this._rotatePane.style.transformOrigin = '0 0';\n this._rotatePane.style.transform = transform;\n // parse the transform directly: getComputedStyle() would force a style recalculation on every frame\n const matrix = this._pitchTransform = new DOMMatrix(transform),\n a = matrix.m11, b = matrix.m21, c = matrix.m41,\n d = matrix.m12, e = matrix.m22, f = matrix.m42,\n g = matrix.m14, h = matrix.m24, i = matrix.m44,\n determinant = a * (e * i - f * h) - b * (d * i - f * g) + c * (d * h - e * g);\n\n this._pitchInverseTransform = {\n a: (e * i - f * h) / determinant,\n b: (c * h - b * i) / determinant,\n c: (b * f - c * e) / determinant,\n d: (f * g - d * i) / determinant,\n e: (a * i - c * g) / determinant,\n f: (c * d - a * f) / determinant,\n g: (d * h - e * g) / determinant,\n h: (b * g - a * h) / determinant,\n i: (a * e - b * d) / determinant,\n };\n this._updatePitchSky();\n },\n\n /**\n * Fill the area above the far plane (where no tiles are loaded) with a sky gradient.\n * Style it through the `.leaflet-pitch-sky` class.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _updatePitchSky() {\n const farY = this._pitch && this._pitchInverseTransform ? this._getPitchFarY() : -Infinity;\n if (farY <= 0) {\n if (this._pitchSky) { this._pitchSky.style.display = 'none'; }\n return;\n }\n if (!this._pitchSky) {\n this._pitchSky = L.DomUtil.create('div', 'leaflet-pitch-sky', this._container);\n Object.assign(this._pitchSky.style, {\n position: 'absolute', left: 0, top: 0, width: '100%', zIndex: 0, pointerEvents: 'none',\n background: 'linear-gradient(#9ec5e8, #dfe9f0)',\n });\n }\n this._pitchSky.style.display = '';\n // overlap the far edge slightly to hide antialiasing gaps\n this._pitchSky.style.height = `${Math.ceil(farY) + 1}px`;\n },\n\n /**\n * Set the map pitch in degrees. Values are clamped to the range 0\u201385.\n *\n * @param {number} pitch Pitch angle in degrees; clamped to [0, 85].\n * @param {Object} [options] Animation options (`animate`, `duration`, `easeLinearity`).\n * \n * @returns {L.Map} This map instance.\n * \n * @fires L.Map#pitch\n * \n * @since leaflet-rotate (0.5.0)\n */\n setPitch(pitch, options) {\n if (options && options.animate) {\n this._animatePitchBearing(pitch, this.getBearing(), options);\n return this;\n }\n this._stopPitchBearingAnimation();\n this._setPitchAndBearing(pitch, this.getBearing());\n return this;\n },\n\n /**\n * Update pitch and bearing together, preserving the current map center.\n * Used by the Ctrl+drag handler to avoid applying two separate transforms.\n * \n * @param {number} pitch Pitch angle in degrees.\n * @param {number} bearing Bearing angle in degrees.\n * \n * @fires L.Map#pitch\n * @fires L.Map#rotate\n * \n * @since leaflet-rotate (0.5.0)\n */\n _setPitchAndBearing(pitch, bearing) {\n if (!this._rotate) { return; }\n\n const clampedPitch = Math.max(0, Math.min(pitch, 85)) * (Math.PI / 180),\n clampedBearing = L.Util.wrapNum(bearing, [0, 360]) * (Math.PI / 180),\n pitchChanged = clampedPitch !== this._pitch;\n if (!pitchChanged && clampedBearing === this._bearing) { return; }\n\n const mapCenter = this._loaded ? this.getCenter() : undefined;\n if (pitchChanged) {\n this._pitch = clampedPitch;\n this._rotatePane.style.transformOrigin = L.version.startsWith('2.') ? '0 0' : '';\n }\n this._setBearing(bearing, mapCenter);\n if (pitchChanged) {\n if (!this._pitch) { this._updatePitchSky(); }\n this.fire('pitch');\n }\n },\n\n /**\n * Get the current map pitch in degrees.\n * \n * @returns {number} Pitch angle in degrees.\n * \n * @since leaflet-rotate (0.5.0)\n */\n getPitch() {\n return (this._pitch || 0) * (180 / Math.PI);\n },\n\n /**\n * Zoom while keeping the given point fixed on screen, also when the map is pitched.\n *\n * Leaflet interpolates in container space, which is not linear under perspective;\n * interpolating in layer space keeps the point under the cursor.\n *\n * @param {L.LatLng|L.Point} latlng Geographic point or container point to keep fixed.\n * @param {number} zoom Target zoom level.\n * @param {Object} [options] Zoom options.\n *\n * @returns {L.Map} This map instance.\n *\n * @since leaflet-rotate (0.5.1)\n */\n setZoomAround(latlng, zoom, options) {\n if (!this._pitch) {\n return mapProto.setZoomAround.apply(this, arguments);\n }\n const scale = this.getZoomScale(zoom),\n size = this.getSize(),\n center = this.containerPointToLayerPoint(size.divideBy(2)),\n containerPoint = latlng instanceof L.Point ? latlng : this.latLngToContainerPoint(latlng),\n point = this.containerPointToLayerPoint(containerPoint),\n newCenter = this.layerPointToLatLng(center.add(point.subtract(center).multiplyBy(1 - 1 / scale)));\n options = Object.assign({}, options);\n // Leaflet skips the animation when the origin is \"far\" in layer space, which is always the case near the horizon.\n if (options.animate === undefined && new L.Bounds(new L.Point(0, 0), size).contains(containerPoint)) {\n options.animate = true;\n }\n return this.setView(newCenter, zoom, { zoom: options });\n },\n\n /**\n * Get the current map bearing. Enable the `rotate` map option before calling.\n * \n * @returns {number} Bearing in degrees, normalized to [0, 360).\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getBearing() {\n return this._bearing * (180 / Math.PI);\n },\n\n /**\n * Creates a new [map pane](#map-pane) with the given name if it doesn't\n * exist already, then returns it. The pane is created as a child of\n * `container`, or as a child of the main map pane if not set.\n * \n * @param {String} name leaflet pane\n * @param {HTMLElement} [container] parent element\n * \n * @returns {HTMLElement} pane container\n * \n * @since leaflet-rotate (v0.1.0)\n */\n // createPane(name, container) {\n // if (!this._rotate || name == 'mapPane') {\n // return mapProto.createPane.apply(this, arguments);\n // }\n // // init \"rotatePane\"\n // if (!this._rotatePane) {\n // // this._pivot = this.getSize().divideBy(2);\n // this._rotatePane = mapProto.createPane.call(this, 'rotatePane', this._mapPane);\n // L.DomUtil.setPosition(this._rotatePane, new L.Point(0, 0), this._bearing, this._pivot);\n // }\n // return mapProto.createPane.call(this, name, container || this._rotatePane);\n // },\n\n /**\n * Panes are DOM elements used to control the ordering of layers on\n * the map. You can access panes with [`map.getPane`](#map-getpane)\n * or [`map.getPanes`](#map-getpanes) methods. New panes can be created\n * with the [`map.createPane`](#map-createpane) method.\n * \n * Every map has the following default panes that differ only in zIndex:\n * \n * - mapPane [HTMLElement = 'auto'] - Pane that contains all other map panes\n * - tilePane [HTMLElement = 2] - Pane for tile layers\n * - overlayPane [HTMLElement = 4] - Pane for overlays like polylines and polygons\n * - shadowPane [HTMLElement = 5] - Pane for overlay shadows (e.g. marker shadows)\n * - markerPane [HTMLElement = 6] - Pane for marker icons\n * - tooltipPane [HTMLElement = 650] - Pane for tooltips.\n * - popupPane [HTMLElement = 700] - Pane for popups.\n */\n /**\n * Create the map's panes, placing tile/vector layers in the transformed pane\n * and markers/overlays in the pane that remains upright.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _initPanes() {\n const panes = this._panes = {};\n this._paneRenderers = {};\n\n this._mapPane = this.createPane('mapPane', this._container);\n L.DomUtil.setPosition(this._mapPane, new L.Point(0, 0));\n\n if (this._rotate) {\n this._rotatePane = this.createPane('rotatePane', this._mapPane);\n this._norotatePane = this.createPane('norotatePane', this._mapPane);\n if (L.version.startsWith('2.')) {\n this._rotatePane.style.transformOrigin = '0 0';\n }\n // rotatePane\n this.createPane('tilePane', this._rotatePane);\n this.createPane('overlayPane', this._rotatePane);\n // norotatePane\n this.createPane('shadowPane', this._norotatePane);\n this.createPane('markerPane', this._norotatePane);\n this.createPane('tooltipPane', this._norotatePane);\n this.createPane('popupPane', this._norotatePane);\n } else {\n this.createPane('tilePane');\n this.createPane('overlayPane');\n this.createPane('shadowPane');\n this.createPane('markerPane');\n this.createPane('tooltipPane');\n this.createPane('popupPane');\n }\n\n if (!this.options.markerZoomAnimation) {\n panes.markerPane.classList.add('leaflet-zoom-hide');\n panes.shadowPane.classList.add('leaflet-zoom-hide');\n }\n },\n\n /**\n * Pans the map the minimum amount to make the `latlng` visible. Use\n * padding options to fit the display to more restricted bounds.\n * If `latlng` is already within the (optionally padded) display bounds,\n * the map will not be panned.\n * \n * @see https://github.com/Raruto/leaflet-rotate/issues/18\n * \n * @param {L.LatLng} latlng Geographic point to keep visible.\n * @param {Object} [options={}] Padding options (`padding`, `paddingTopLeft`, `paddingBottomRight`).\n * \n * @returns {L.Map} current map instance\n * \n * @since leaflet-rotate (v0.1.4)\n */\n panInside(latlng, options) {\n if (!this._rotate || (!this._pitch && Math.abs(this._bearing).toFixed(1) < 0.1)) {\n return mapProto.panInside.apply(this, arguments);\n }\n\n options = options || {};\n\n const paddingTL = toPoint(options.paddingTopLeft || options.padding || [0, 0]),\n paddingBR = toPoint(options.paddingBottomRight || options.padding || [0, 0]),\n /** @TODO use mapProto.panInside */\n // pixelPoint = this.project(latlng),\n // pixelBounds = this.getPixelBounds(),\n // pixelCenter = this.project(this.getCenter()),\n pixelPoint = this.latLngToContainerPoint(latlng),\n pixelBounds = new L.Bounds([new L.Point(0, 0), this.getSize()]),\n pixelCenter = pixelBounds.getCenter(),\n //\n paddedBounds = new L.Bounds([pixelBounds.min.add(paddingTL), pixelBounds.max.subtract(paddingBR)]),\n paddedSize = paddedBounds.getSize();\n \n if (!paddedBounds.contains(pixelPoint)) {\n this._enforcingBounds = true;\n const centerOffset = pixelPoint.subtract(paddedBounds.getCenter());\n const offset = paddedBounds.extend(pixelPoint).getSize().subtract(paddedSize);\n pixelCenter.x += centerOffset.x < 0 ? -offset.x : offset.x;\n pixelCenter.y += centerOffset.y < 0 ? -offset.y : offset.y;\n /** @TODO use mapProto.panInside */\n // this.panTo(this.unproject(pixelCenter), options);\n this.panTo(this.containerPointToLatLng(pixelCenter), options);\n //\n this._enforcingBounds = false;\n }\n return this;\n },\n\n /**\n * Pans the map to the closest view that would lie inside the given bounds\n * (if it's not already), controlling the animation using the options specific,\n * if any.\n * \n * @TODO check if map bounds calculated by `L.Map::panInsideBounds()`\n * function should match the `rotatePane` or `norotatePane` bounds\n *\n * @see https://github.com/fnicollet/Leaflet/issues/7\n * \n * @param {L.LatLngBounds} bounds Geographic bounds to fit inside the viewport.\n * @param {Object} [options] Pan animation options.\n * \n * @returns {L.Map} This map instance.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n // panInsideBounds(bounds, options) {\n // this._enforcingBounds = true;\n // const center = this.getCenter(),\n // newCenter = this._limitCenter(center, this._zoom, L.latLngBounds(bounds));\n //\n // if (!center.equals(newCenter)) {\n // this.panTo(newCenter, options);\n // }\n //\n // this._enforcingBounds = false;\n // return this;\n // },\n\n // adjust center for view to get inside bounds\n // _limitCenter(center, zoom, bounds) {\n //\n // if (!bounds) { return center; }\n //\n // const centerPoint = this.project(center, zoom),\n // viewHalf = this.getSize().divideBy(2),\n // viewBounds = new Bounds(centerPoint.subtract(viewHalf), centerPoint.add(viewHalf)),\n // offset = this._getBoundsOffset(viewBounds, bounds, zoom);\n //\n // // If offset is less than a pixel, ignore.\n // // This prevents unstable projections from getting into\n // // an infinite loop of tiny offsets.\n // if (Math.abs(offset.x) <= 1 && Math.abs(offset.y) <= 1) {\n // return center;\n // }\n //\n // return this.unproject(centerPoint.add(offset), zoom);\n // },\n\n // @method flyToBounds(bounds: LatLngBounds, options?: fitBounds options): this\n // Sets the view of the map with a smooth animation like [`flyTo`](#map-flyto),\n // but takes a bounds parameter like [`fitBounds`](#map-fitbounds).\n // flyToBounds(bounds, options) {\n // const target = this._getBoundsCenterZoom(bounds, options);\n // return this.flyTo(target.center, target.zoom, options);\n // },\n\n // _getBoundsCenterZoom(bounds, options) {\n //\n // options = options || {};\n // bounds = bounds.getBounds ? bounds.getBounds() : toLatLngBounds(bounds);\n //\n // const paddingTL = L.point(options.paddingTopLeft || options.padding || [0, 0]),\n // paddingBR = L.point(options.paddingBottomRight || options.padding || [0, 0]);\n //\n // let zoom = this.getBoundsZoom(bounds, false, paddingTL.add(paddingBR));\n //\n // zoom = (typeof options.maxZoom === 'number') ? Math.min(options.maxZoom, zoom) : zoom;\n //\n // if (zoom === Infinity) {\n // return { center: bounds.getCenter(), zoom };\n // }\n //\n // return { center, zoom };\n //\n // },\n\n /**\n * Returns the maximum zoom level on which the given bounds fit to the map\n * view in its entirety. If `inside` (optional) is set to `true`, the method\n * instead returns the minimum zoom level on which the map view fits into\n * the given bounds in its entirety.\n * \n * @param {L.LatLngBounds} bounds Geographic bounds to fit.\n * @param {boolean} [inside=false] Fit the viewport inside bounds instead of bounds inside the viewport.\n * @param {L.Point|number[]} [padding=[0,0]] Pixel padding around the viewport.\n * \n * @returns {number} Zoom level satisfying the fit.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n getBoundsZoom(bounds, inside, padding) {\n if (!this._rotate || (!this._pitch && Math.abs(this._bearing).toFixed(1) < 0.1)) {\n return mapProto.getBoundsZoom.apply(this, arguments);\n }\n\n bounds = bounds instanceof L.LatLngBounds ? bounds : new L.LatLngBounds(bounds);\n padding = toPoint(padding || [0, 0]);\n\n let zoom = this.getZoom() || 0;\n const min = this.getMinZoom(),\n max = this.getMaxZoom(),\n /** @TODO use mapProto.getBoundsZoom */\n // nw = bounds.getNorthWest(),\n // se = bounds.getSouthEast(),\n // size = this.getSize().subtract(padding),\n // boundsSize = L.bounds(this.project(se, zoom), this.project(nw, zoom)).getSize(),\n size = this.getSize().subtract(padding),\n boundsSize = this.mapBoundsToContainerBounds(bounds).getSize(),\n snap = this.options.zoomSnap,\n scalex = size.x / boundsSize.x,\n scaley = size.y / boundsSize.y,\n scale = inside ? Math.max(scalex, scaley) : Math.min(scalex, scaley);\n\n zoom = this.getScaleZoom(scale, zoom);\n\n if (snap) {\n zoom = Math.round(zoom / (snap / 100)) * (snap / 100); // don't jump if within 1% of a snap level\n zoom = inside ? Math.ceil(zoom / snap) * snap : Math.floor(zoom / snap) * snap;\n }\n\n return Math.max(min, Math.min(max, zoom));\n },\n\n /**\n * Layer point of the current center\n * \n * @returns {L.Point} layer center\n */\n // _getCenterLayerPoint() {\n // return this.containerPointToLayerPoint(this.getSize()._divideBy(2));\n // },\n\n /**\n * Return the pixel offset from the current center to the given geographic point.\n * \n * @param {L.LatLng} latlng Geographic point.\n * \n * @returns {L.Point} Offset in container pixels (the map pane is panned in screen space), adjusted for bearing and pitch.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getCenterOffset(latlng) {\n if (!this._rotate) {\n return mapProto._getCenterOffset.apply(this, arguments);\n }\n return this.latLngToContainerPoint(latlng)._subtract(this.getSize()._divideBy(2));\n },\n\n /**\n * Return the current position of the rotated pane.\n * \n * @returns {L.Point} Rotated-pane position in map-pane coordinates.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getRotatePanePos() {\n return this._rotatePanePos || new L.Point(0, 0);\n // return L.DomUtil.getPosition(this._rotatePane) || new L.Point(0, 0);\n },\n\n // _latLngToNewLayerPoint(latlng, zoom, center) {\n // const topLeft = this._getNewPixelOrigin(center, zoom);\n // return this.project(latlng, zoom)._subtract(topLeft);\n //},\n\n /**\n * Calculate the pixel origin for a target view while preserving bearing-aware alignment.\n * \n * @param {L.LatLng} center Target center.\n * @param {number} zoom Target zoom level.\n * \n * @returns {L.Point} New pixel origin.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _getNewPixelOrigin(center, zoom) {\n if (!this._rotate) {\n return mapProto._getNewPixelOrigin.apply(this, arguments);\n }\n // the layer point under the view center doesn't depend on zoom (pane transforms only rotate/pitch around the pivot),\n // so this matches `_setBearing` also when the pivot is no longer the view center (eg. after panning)\n return this.project(center, zoom)\n ._subtract(this.containerPointToLayerPoint(this.getSize()._divideBy(2)))\n ._round();\n },\n\n /**\n * Calculate the pixel bounds needed to cover the transformed viewport.\n * \n * @param {L.LatLng} [center=this.getCenter()] Target center.\n * @param {number} [zoom=this.getZoom()] Target zoom level.\n * \n * @returns {L.Bounds} Pixel bounds in projected map coordinates.\n * \n * @since leaflet-rotate (v0.2.0)\n * \n * @see src\\layer\\tile\\GridLayer::_getTiledPixelBounds()\n */\n _getNewPixelBounds(center, zoom) {\n center = center || this.getCenter();\n zoom = zoom || this.getZoom();\n if (!this._rotate && mapProto._getNewPixelBounds) {\n return mapProto._getNewPixelBounds.apply(this, arguments);\n }\n const mapZoom = this._animatingZoom ? Math.max(this._animateToZoom, this.getZoom()) : this.getZoom(),\n scale = this.getZoomScale(mapZoom, zoom),\n pixelCenter = this.project(center, zoom).floor(),\n [min, max] = this._getPitchedContainerBounds(0),\n corners = [[min.x, min.y], [max.x, min.y], [min.x, max.y], [max.x, max.y]]\n .map(point => this.containerPointToLayerPoint(point));\n\n if (this._pitch) {\n // the pitched view is not symmetric: the far side covers much more than the near one\n const viewCenter = this.containerPointToLayerPoint(this.getSize()._divideBy(2));\n return new L.Bounds(corners.map(point => pixelCenter.add(point.subtract(viewCenter).divideBy(scale))));\n }\n\n const halfSize = new L.Bounds(corners.map(point => point.floor())).getSize().divideBy(scale * 2);\n\n return new L.Bounds(pixelCenter.subtract(halfSize), pixelCenter.add(halfSize));\n },\n\n /**\n * @since leaflet-rotate (v0.2.0)\n * \n * @returns {L.Point} Map pivot point in pixel coordinates.\n */\n _getPixelCenter() {\n if (!this._rotate && mapProto._getPixelCenter) {\n return mapProto._getPixelCenter.apply(this, arguments);\n }\n return this.getSize()._divideBy(2)._subtract(this._getMapPanePos());\n },\n\n /**\n * @see src\\layer\\vector\\Renderer::_update()\n * \n * @param {number} padding Bounds padding as a fraction of map size.\n * \n * @returns {L.Bounds} Padded bounds in layer-point coordinates.\n * \n * @since leaflet-rotate (v0.2.0)\n */\n _getPaddedPixelBounds(padding) {\n if (!this._rotate && mapProto._getPaddedPixelBounds) {\n return mapProto._getPaddedPixelBounds.apply(this, arguments);\n }\n const [padMin, padMax] = this._getPitchedContainerBounds(padding);\n\n return new L.Bounds([\n this.containerPointToLayerPoint([padMin.x, padMin.y]).floor(),\n this.containerPointToLayerPoint([padMin.x, padMax.y]).floor(),\n this.containerPointToLayerPoint([padMax.x, padMin.y]).floor(),\n this.containerPointToLayerPoint([padMax.x, padMax.y]).floor()\n ]);\n },\n\n /**\n * Build and fire Leaflet's location-found event, including the device heading.\n * \n * @param {GeolocationPosition} pos Browser geolocation result.\n * \n * @fires L.Map#locationfound\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _handleGeolocationResponse(pos) {\n if (!this._container._leaflet_id) { return; }\n\n const lat = pos.coords.latitude,\n lng = pos.coords.longitude,\n /** @TODO use mapProto._handleGeolocationResponse */\n hdg = pos.coords.heading,\n latlng = new L.LatLng(lat, lng),\n bounds = latlng.toBounds(pos.coords.accuracy),\n options = this._locateOptions;\n\n if (options.setView) {\n const zoom = this.getBoundsZoom(bounds);\n this.setView(latlng, options.maxZoom ? Math.min(zoom, options.maxZoom) : zoom);\n }\n\n const data = {\n latlng: latlng,\n bounds: bounds,\n timestamp: pos.timestamp,\n /** @TODO use mapProto._handleGeolocationResponse */\n heading: hdg\n };\n\n for (const i in pos.coords) {\n if (typeof pos.coords[i] === 'number') {\n data[i] = pos.coords[i];\n }\n }\n\n // @event locationfound: LocationEvent\n // Fired when geolocation (using the [`locate`](#map-locate) method)\n // went successfully.\n this.fire('locationfound', data);\n },\n\n /**\n * @see https://github.com/ronikar/Leaflet/blob/5c480ef959b947c3beed7065425a5a36c486262b/src/geo/LatLngBounds.js#L253-L264\n * \n * @param {L.Bounds} points \n * \n * @returns {L.Bounds}\n */\n // toCircumscribedBounds(points) {\n // const minX = points.reduce(function (pv, v) { return Math.min(pv, v.x); }, points[0].x),\n // maxX = points.reduce(function (pv, v) { return Math.max(pv, v.x); }, points[0].x),\n // minY = points.reduce(function (pv, v) { return Math.min(pv, v.y); }, points[0].y),\n // maxY = points.reduce(function (pv, v) { return Math.max(pv, v.y); }, points[0].y);\n //\n // return L.bounds(L.point(minX, minY), L.point(maxX, maxY));\n // },\n\n});\n", "/**\n * Sets map bearing from device orientation when the browser exposes compass data.\n * \n * @typedef L.Map.CompassBearing\n * @property {L.Map.CompassBearing} compassBearing Map handler, enabled to follow device heading.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.CompassBearing = L.Handler.extend({\n\n /**\n * @param {L.Map} map Map whose bearing follows device orientation.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(map) {\n this._map = map;\n /** @see https://caniuse.com/?search=DeviceOrientation */\n if ('ondeviceorientationabsolute' in window) {\n this.__deviceOrientationEvent = 'deviceorientationabsolute';\n } else if('ondeviceorientation' in window) {\n this.__deviceOrientationEvent = 'deviceorientation';\n }\n this._throttled = L.Util.throttle(this._onDeviceOrientation, 100, this);\n },\n\n /**\n * Subscribe to the supported device-orientation event, if available.\n * On iOS, permission is requested first (call `enable()` from a user gesture).\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n if (this._map._rotate && this.__deviceOrientationEvent) {\n L.DomEvent.on(window, this.__deviceOrientationEvent, this._throttled, this);\n const DOE = window.DeviceOrientationEvent;\n if (DOE && DOE.requestPermission) {\n DOE.requestPermission()\n .then(state => 'denied' === state && this.enabled() && this.disable())\n .catch(() => {});\n }\n } else {\n // L.Map.CompassBearing handler will be automatically\n // disabled if device orientation is not supported.\n this.disable();\n }\n },\n\n /**\n * Unsubscribe from device orientation when the handler is disabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n if (this._map._rotate && this.__deviceOrientationEvent) {\n L.DomEvent.off(window, this.__deviceOrientationEvent, this._throttled, this);\n }\n },\n\n /**\n * Apply a device orientation reading to the map bearing.\n *\n * `DeviceOrientationEvent.absolute` - Indicates whether the device is providing absolute\n * orientation values (relatives to Magnetic North) or\n * using some arbitrary frame determined by the device.\n * \n * `DeviceOrientationEvent.alpha` - Returns the rotation of the device around the Z axis;\n * that is, the number of degrees by which the device is\n * being twisted around the center of the screen.\n * \n * `window.orientation` - Returns the screen orientation in degrees (in 90-degree increments)\n * of the viewport relative to the device's natural orientation.\n * Its only possible values are -90, 0, 90, and 180. Positive\n * values are counterclockwise; negative values are clockwise.\n * \n * @see https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/absolute\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DeviceOrientationEvent/alpha\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Window/orientation\n *\n * @param {DeviceOrientationEvent} e Orientation reading from the browser.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onDeviceOrientation(e) {\n let angle = e.webkitCompassHeading != null ? e.webkitCompassHeading : e.alpha;\n let deviceOrientation = 0;\n\n if (!Number.isFinite(angle)) { return; }\n\n // Safari iOS\n if (!e.absolute && e.webkitCompassHeading) {\n angle = 360 - angle;\n }\n\n // Older browsers\n if (!e.absolute && 'undefined' !== typeof window.orientation) {\n deviceOrientation = window.orientation;\n }\n\n this._map.setBearing(angle - deviceOrientation);\n },\n\n});\n\n/**\n * Add Compass bearing handler to L.Map (disabled unless `window.DeviceOrientationEvent` is set).\n * \n * @property {L.Map.CompassBearing} compassBearing\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'compassBearing', L.Map.CompassBearing);\n", "/**\n * Calls `invalidateSize()` when the map container's inline style changes.\n * \n * @typedef L.Map.ContainerMutation\n * @property {boolean} [trackContainerMutation=false] Observe inline style changes on the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\n/**\n * @TODO check again this file after leaflet v1.9.3 (eg. L.Browser.mutation).\n * Mutation Observer support will likely be added by default in next releases.\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether the map uses mutation observers to\n * detect changes in its container and trigger\n * `invalidateSize`. Disabled by default due to\n * support not being available in all web browsers.\n *\n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n * \n * @see https://developer.mozilla.org/docs/Web/API/MutationObserver\n */\n trackContainerMutation: false\n\n});\n\nL.Map.ContainerMutation = L.Handler.extend({\n\n /**\n * Start observing the map container's style attribute.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n // if (!L.Browser.mutation) { return; }\n if (!this._observer) {\n this._observer = new MutationObserver(L.Util.bind(this._map.invalidateSize, this._map));\n }\n this._observer.observe(this._map.getContainer(), {\n childList: false,\n attributes: true,\n characterData: false,\n subtree: false,\n attributeFilter: ['style']\n });\n },\n\n /**\n * Stop observing container mutations.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n // if (!L.Browser.mutation) { return; }\n this._observer.disconnect();\n },\n\n});\n\n/**\n * Add Container mutation handler to L.Map (disabled unless `trackContainerMutation` is set).\n * \n * @property {L.Map.ContainerMutation} trackContainerMutation\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'trackContainerMutation', L.Map.ContainerMutation);\n", "/**\n * Shared implementation for two-finger pinch zoom and map rotation.\n * \n * @see https://github.com/fnicollet/Leaflet/commit/a77af51a6b10f308d1b9a16552091d1d0aee8834\n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/handler/Map.TouchZoom.js\n * \n * @typedef L.Map.TouchGestures\n * @property {boolean} [bounceAtZoomLimits] Whether pinch zoom may temporarily exceed zoom limits.\n * @property {boolean} zoom Whether pinch zoom is enabled.\n * @property {boolean} rotate Whether touch rotation is enabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\n/**\n * Convert a touch's client coordinates to coordinates relative to the map container.\n * \n * @param {L.Map} map\n * @param {Touch} touch\n * \n * @returns {L.Point}\n * \n * @since leaflet-rotate (v0.1.0)\n */\nfunction touchToContainerPoint(map, touch) {\n const container = map.getContainer(),\n rect = container.getBoundingClientRect();\n\n return new L.Point(\n touch.clientX - rect.left - container.clientLeft,\n touch.clientY - rect.top - container.clientTop,\n );\n}\n\nL.Map.mergeOptions({\n\n /**\n * Whether pinch zoom may temporarily exceed min/max zoom and bounce back.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n bounceAtZoomLimits: true,\n\n});\n\nL.Map.TouchGestures = L.Handler.extend({\n\n /**\n * Initialize the shared handler from the map's touch zoom/rotation options.\n * \n * @param {L.Map} map Map whose touch gestures are handled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(map) {\n this._map = map;\n this.rotate = !!this._map.options.touchRotate;\n this.zoom = !!this._map.options.touchZoom;\n this.pitch = !!this._map.options.touchPitch;\n },\n\n /**\n * Listen for the start of two-finger gestures on the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n L.DomEvent.on(this._map._container, 'touchstart', this._onTouchStart, this);\n },\n\n /**\n * Remove the touch-start listener.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n L.DomEvent.off(this._map._container, 'touchstart', this._onTouchStart, this);\n },\n\n /**\n * Record initial touch points and start tracking a two-finger gesture.\n * \n * @param {TouchEvent} e Touch-start event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onTouchStart(e) {\n const map = this._map;\n\n if (!e.touches || e.touches.length !== 2 || map._animatingZoom || this._zooming || this._rotating || this._gesture) { return; }\n\n const p1 = touchToContainerPoint(map, e.touches[0]),\n p2 = touchToContainerPoint(map, e.touches[1]),\n vector = p1.subtract(p2);\n\n // Two horizontally aligned fingers moving vertically together change the pitch\n const canPitch = this.pitch && map._rotate && Math.abs(vector.x) > Math.abs(vector.y);\n if (!canPitch && !this.zoom && !this.rotate) { return; }\n this._gesture = canPitch ? 'pending' : 'pinch';\n this._startP1 = p1;\n this._startP2 = p2;\n map._stopPitchBearingAnimation();\n\n this._centerPoint = map.getSize()._divideBy(2);\n this._startLatLng = map.containerPointToLatLng(this._centerPoint);\n\n if (this.zoom) {\n if (map.options.touchZoom !== 'center') {\n this._pinchStartLatLng = map.containerPointToLatLng(p1.add(p2)._divideBy(2));\n }\n this._startDist = p1.distanceTo(p2);\n this._startZoom = map.getZoom();\n this._zooming = true;\n } else {\n this._zooming = false;\n }\n\n if (this.rotate) {\n this._startTheta = Math.atan(vector.x / vector.y);\n this._startBearing = map.getBearing();\n if (vector.y < 0) { this._startBearing += 180; }\n this._rotating = true;\n } else {\n this._rotating = false;\n }\n\n this._moved = false;\n\n map._stop();\n\n L.DomEvent\n .on(document, 'touchmove', this._onTouchMove, this)\n .on(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n L.DomEvent.preventDefault(e);\n },\n\n /**\n * Update bearing and/or zoom while the two touch points move.\n * \n * @param {TouchEvent} e Touch-move event.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onTouchMove(e) {\n if (!e.touches || e.touches.length !== 2 || !this._gesture) { return; }\n\n const map = this._map,\n p1 = touchToContainerPoint(map, e.touches[0]),\n p2 = touchToContainerPoint(map, e.touches[1]),\n vector = p1.subtract(p2),\n scale = p1.distanceTo(p2) / this._startDist;\n let delta;\n\n if (this._gesture === 'pending') {\n const d1 = p1.subtract(this._startP1),\n d2 = p2.subtract(this._startP2);\n if (Math.max(d1.x * d1.x + d1.y * d1.y, d2.x * d2.x + d2.y * d2.y) < 25) {\n L.DomEvent.preventDefault(e);\n return;\n }\n const vertical = d => Math.abs(d.y) > Math.abs(d.x);\n if (vertical(d1) && vertical(d2) && Math.sign(d1.y) === Math.sign(d2.y)) {\n this._gesture = 'pitch';\n this._lastPitchY = (this._startP1.y + this._startP2.y) / 2;\n this._zooming = this._rotating = false;\n } else {\n this._gesture = 'pinch';\n }\n }\n\n if (this._gesture === 'pitch') {\n const y = (p1.y + p2.y) / 2;\n map._setPitchAndBearing(map.getPitch() - (y - this._lastPitchY) * 0.5, map.getBearing());\n this._lastPitchY = y;\n L.DomEvent.preventDefault(e);\n return;\n }\n\n if (!(this._zooming || this._rotating)) { return; }\n\n if (this._rotating) {\n const theta = Math.atan(vector.x / vector.y);\n let bearingDelta = (theta - this._startTheta) * (180 / Math.PI);\n if (vector.y < 0) { bearingDelta += 180; }\n if (bearingDelta) {\n /**\n * @TODO the pivot should be the last touch point,\n * but zoomAnimation manages to overwrite the rotate\n * pane position. Maybe related to #3529.\n * \n * @see https://github.com/Leaflet/Leaflet/pull/3529\n * @see https://github.com/fnicollet/Leaflet/commit/a77af51a6b10f308d1b9a16552091d1d0aee8834\n */\n map.setBearing(this._startBearing - bearingDelta);\n }\n }\n\n if (this._zooming) {\n this._zoom = map.getScaleZoom(scale, this._startZoom);\n\n if (!map.options.bounceAtZoomLimits && (\n (this._zoom < map.getMinZoom() && scale < 1) ||\n (this._zoom > map.getMaxZoom() && scale > 1))) {\n this._zoom = map._limitZoom(this._zoom);\n }\n\n if (map.options.touchZoom === 'center') {\n this._center = this._startLatLng;\n if (scale === 1) { return; }\n } else {\n // Get delta from pinch to center, so centerLatLng is delta applied to initial pinchLatLng\n delta = p1._add(p2)._divideBy(2)._subtract(this._centerPoint);\n if (scale === 1 && delta.x === 0 && delta.y === 0) { return; }\n\n const mapDelta = map._pitch\n ? map.containerPointToLayerPoint(this._centerPoint.add(delta))\n .subtract(map.containerPointToLayerPoint(this._centerPoint))\n : delta.rotate(-map.getBearing() * (Math.PI / 180));\n\n this._center = map.unproject(map.project(this._pinchStartLatLng).subtract(mapDelta));\n }\n\n }\n\n if (!this._moved) {\n map._moveStart(true, false);\n this._moved = true;\n }\n\n const moveFn = map._move.bind(map, this._center, this._zoom, { pinch: true, round: false }, undefined);\n moveFn();\n\n if (this.zoom) {\n if (map.options.zoomAnimation) {\n map._animateZoomNoDelay(this._center, map._limitZoom(this._zoom));\n } else {\n map._resetView(this._center, map._limitZoom(this._zoom));\n }\n }\n\n L.DomEvent.preventDefault(e);\n },\n\n /**\n * Finish the gesture, settle the zoom and remove document listeners.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onTouchEnd() {\n const gesture = this._gesture;\n delete this._gesture;\n if (gesture === 'pitch' || gesture === 'pending' || !this._moved || !(this._zooming || this._rotating)) {\n this._zooming = false;\n this._rotating = false;\n L.DomEvent\n .off(document, 'touchmove', this._onTouchMove, this)\n .off(document, 'touchend touchcancel', this._onTouchEnd, this);\n return;\n }\n\n this._zooming = false;\n this._rotating = false;\n L.DomEvent\n .off(document, 'touchmove', this._onTouchMove, this)\n .off(document, 'touchend touchcancel', this._onTouchEnd, this);\n\n if (this.zoom) {\n // Pinch updates GridLayers' levels only when zoomSnap is off, so zoomSnap becomes noUpdate.\n if (this._map.options.zoomAnimation) {\n this._map._animateZoom(this._center, this._map._limitZoom(this._zoom), true, this._map.options.zoomSnap);\n } else {\n this._map._resetView(this._center, this._map._limitZoom(this._zoom));\n }\n }\n },\n\n});\n\n/**\n * Add the shared touch gesture handler to the map.\n * \n * @property {L.Map.TouchGestures} touchGestures\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'touchGestures', L.Map.TouchGestures);\n", "/**\n * Enables two-finger rotation through the shared touch-gesture handler.\n * \n * @typedef L.Map.TouchRotate\n * @property {boolean} [touchRotate=false] Enable two-finger map rotation.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether the map can be rotated with a two-finger rotation gesture\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n touchRotate: false,\n\n});\n\nL.Map.TouchRotate = L.Handler.extend({\n\n /**\n * Enable rotation handling in the map's shared touch gesture handler.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n this._map.touchGestures.enable();\n this._map.touchGestures.rotate = true;\n },\n\n /**\n * Disable rotation handling without affecting pinch zoom.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n this._map.touchGestures.rotate = false;\n },\n\n});\n\n/**\n * Add Touch Rotate handler (disabled unless `touchGestures` is set).\n * \n * @property {L.Map.TouchGestures} touchGestures\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'touchRotate', L.Map.TouchRotate);\n", "/**\n * Enables MapLibre-like two-finger pitch (both fingers dragged vertically) through the shared touch-gesture handler.\n * \n * @typedef L.Map.TouchPitch\n * @property {boolean} [touchPitch=false] Enable two-finger map pitch (vertical drag).\n * \n * @since leaflet-rotate (0.5.1)\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether the map can be pitched by dragging two fingers vertically\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (0.5.1)\n */\n touchPitch: false,\n\n});\n\nL.Map.TouchPitch = L.Handler.extend({\n\n /**\n * Enable pitch handling in the map's shared touch gesture handler.\n * \n * @since leaflet-rotate (0.5.1)\n */\n addHooks() {\n this._map.touchGestures.enable();\n this._map.touchGestures.pitch = true;\n },\n\n /**\n * Disable pitch handling without affecting pinch zoom and rotation.\n * \n * @since leaflet-rotate (0.5.1)\n */\n removeHooks() {\n this._map.touchGestures.pitch = false;\n },\n\n});\n\n/**\n * Add Touch Pitch handler (disabled unless `touchGestures` is set).\n * \n * @property {L.Map.TouchGestures} touchGestures\n * \n * @since leaflet-rotate (0.5.1)\n */\nL.Map.addInitHook('addHandler', 'touchPitch', L.Map.TouchPitch);\n", "\n/**\n * Handles Shift+wheel bearing changes and Ctrl+drag / right-drag bearing/pitch changes.\n * \n * @typedef L.Map.ShiftKeyRotate\n * @property {boolean} [shiftKeyRotate=true] Enable Shift+wheel bearing rotation.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether Shift+wheel changes the map bearing.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n shiftKeyRotate: true,\n\n /**\n * Whether Ctrl+drag (or right-button drag) changes bearing and pitch.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (0.5.0)\n */\n pitchDrag: true,\n\n});\n\nL.Map.ShiftKeyRotate = L.Handler.extend({\n\n /**\n * @param {L.Map} map Map controlled by this handler.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n initialize(map) {\n this._map = map;\n this._onMouseDownBound = this._onMouseDown.bind(this);\n this._onMouseMoveBound = this._onMouseMove.bind(this);\n this._onMouseUpBound = this._onMouseUp.bind(this);\n this._onContextMenuBound = this._onContextMenu.bind(this);\n this._applyBound = this._apply.bind(this);\n },\n\n /**\n * Attach enabled wheel and pointer/mouse gesture listeners.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n if (this._map.options.shiftKeyRotate) {\n L.DomEvent.on(this._map._container, \"wheel\", this._handleShiftScroll, this);\n }\n if (this._map.options.pitchDrag) {\n this.addPitchHooks();\n }\n },\n\n /**\n * Detach gesture listeners and cancel any active drag.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n L.DomEvent.off(this._map._container, \"wheel\", this._handleShiftScroll, this);\n this.removePitchHooks();\n },\n\n /**\n * Listen for the start of Ctrl+drag pitch gestures.\n * \n * @since leaflet-rotate (0.5.0)\n */\n addPitchHooks() {\n if (this._pitchHooksAdded) { return; }\n this._pitchEvents = L.version.startsWith('2.')\n ? ['pointerdown', 'pointermove', 'pointerup pointercancel']\n : ['mousedown', 'mousemove', 'mouseup'];\n this._map._container.addEventListener(this._pitchEvents[0], this._onMouseDownBound, true);\n this._map._container.addEventListener('contextmenu', this._onContextMenuBound, true);\n this._pitchHooksAdded = true;\n },\n\n /**\n * Stop listening for pitch gestures and remove active document listeners.\n * \n * @since leaflet-rotate (0.5.0)\n */\n removePitchHooks() {\n if (!this._pitchHooksAdded) { return; }\n this._map._container.removeEventListener(this._pitchEvents[0], this._onMouseDownBound, true);\n this._map._container.removeEventListener('contextmenu', this._onContextMenuBound, true);\n this._onMouseUp();\n delete this._pitchEvents;\n this._pitchHooksAdded = false;\n },\n\n /**\n * Rotate the map in fixed increments while Shift is held during wheel input.\n * \n * @param {WheelEvent} e Wheel event from the map container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _handleShiftScroll(e) {\n if (e.shiftKey) {\n e.preventDefault();\n this._map.scrollWheelZoom.disable();\n this._map.setBearing(this._map.getBearing() + Math.sign(e.deltaY) * 5);\n } else {\n this._map.scrollWheelZoom.enable();\n }\n },\n\n /**\n * Start Ctrl+drag (or right-button drag) and capture subsequent movement outside the map.\n * \n * @param {MouseEvent|PointerEvent} e Gesture start event.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _onMouseDown(e) {\n if (this._dragging) { return; }\n this._moved = false;\n if (!this._map._rotate || !this._map.options.pitchDrag || !(e.button === 2 || (e.ctrlKey && e.button === 0))) { return; }\n\n const scrollWheelZoom = this._map.scrollWheelZoom;\n if (scrollWheelZoom && scrollWheelZoom._timer) {\n clearTimeout(scrollWheelZoom._timer);\n scrollWheelZoom._timer = null;\n scrollWheelZoom._delta = 0;\n scrollWheelZoom._startTime = null;\n }\n\n e.preventDefault();\n e.stopPropagation();\n e.stopImmediatePropagation();\n this._map._stopPitchBearingAnimation();\n this._dragging = true;\n this._lastX = e.clientX;\n this._lastY = e.clientY;\n this._pitchDelta = this._bearingDelta = 0;\n document.addEventListener(this._pitchEvents[1], this._onMouseMoveBound);\n for (const event of this._pitchEvents[2].split(' ')) {\n document.addEventListener(event, this._onMouseUpBound);\n }\n },\n\n /**\n * Accumulate pointer movement as pitch (vertical) and bearing (horizontal).\n * Far from the horizontal center line the bearing follows the pointer angle\n * around the map center.\n * \n * @param {MouseEvent|PointerEvent} e Gesture movement event.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _onMouseMove(e) {\n const rect = this._map._container.getBoundingClientRect(),\n cx = rect.left + rect.width / 2,\n cy = rect.top + rect.height / 2,\n x = e.clientX,\n y = e.clientY;\n\n this._pitchDelta += (this._lastY - y) * 0.5;\n this._bearingDelta += Math.abs(cy - this._lastY) > 100\n ? (Math.atan2(y - cy, x - cx) - Math.atan2(y - cy, this._lastX - cx)) * (180 / Math.PI)\n : (x - this._lastX) * 0.8 * (y < cy ? 1 : -1);\n this._lastX = x;\n this._lastY = y;\n this._moved = true;\n if (!this._frame) {\n this._frame = requestAnimationFrame(this._applyBound);\n }\n e.preventDefault();\n },\n\n /**\n * Apply accumulated movement once per animation frame.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _apply() {\n this._frame = null;\n if (!this._pitchDelta && !this._bearingDelta) { return; }\n this._map._setPitchAndBearing(this._map.getPitch() + this._pitchDelta, this._map.getBearing() + this._bearingDelta);\n this._pitchDelta = this._bearingDelta = 0;\n },\n\n /**\n * Suppress the context menu that follows a right-button drag.\n * \n * @param {MouseEvent} e Context menu event.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _onContextMenu(e) {\n if (this._dragging || this._moved) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n\n /**\n * End Ctrl+drag, flush pending movement and clear document-level listeners.\n * \n * @since leaflet-rotate (0.5.0)\n */\n _onMouseUp() {\n if (!this._pitchEvents || !this._dragging) { return; }\n document.removeEventListener(this._pitchEvents[1], this._onMouseMoveBound);\n for (const event of this._pitchEvents[2].split(' ')) {\n document.removeEventListener(event, this._onMouseUpBound);\n }\n cancelAnimationFrame(this._frame);\n if (this._map._mapPane) { this._apply(); }\n this._frame = null;\n this._dragging = false;\n delete this._lastX;\n delete this._lastY;\n },\n\n});\n\n/**\n * Create the handler when either desktop rotation gesture is enabled.\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook(function() {\n if (this.options.shiftKeyRotate) {\n this.shiftKeyRotate = new L.Map.ShiftKeyRotate(this);\n this.shiftKeyRotate.enable();\n } else if (this.options.pitchDrag) {\n this.shiftKeyRotate = new L.Map.ShiftKeyRotate(this);\n this.shiftKeyRotate.addPitchHooks();\n this.on('unload', this.shiftKeyRotate.removePitchHooks, this.shiftKeyRotate);\n }\n if (this.scrollWheelZoom.enabled() && this.options.shiftKeyRotate) {\n this.scrollWheelZoom.disable();\n this.scrollWheelZoom.enable();\n }\n});\n", "/**\n * Adds pinch zoom support through the shared touch-gesture handler.\n * \n * @see https://github.com/Leaflet/Leaflet/blob/v1.9.3/src/map/handler/Map.TouchZoom.js\n * \n * @external L.Map.TouchZoom\n * @property {boolean|string} [touchZoom=L.Browser.touch] Enable pinch zoom; `'center'` zooms around the view center.\n * @property {boolean} [bounceAtZoomLimits=false] Allow pinch zoom to exceed zoom limits before settling.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Map.mergeOptions({\n\n /**\n * Whether the map can be zoomed by touch-dragging\n * with two fingers. If passed `'center'`, it will\n * zoom to the center of the view regardless of\n * where the touch events (fingers) were. Enabled\n * for touch-capable web browsers.\n * \n * @type {(Boolean|String)}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n touchZoom: L.Browser.touch,\n\n /**\n * @TODO check if this is a duplicate of `L.Map.TouchGestures::bounceAtZoomLimits`\n * \n * Set it to false if you don't want the map to\n * zoom beyond min/max zoom and then bounce back\n * when pinch-zooming.\n * \n * @type {Boolean}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n bounceAtZoomLimits: false,\n\n});\n\nL.Map.TouchZoom = L.Handler.extend({\n\n /**\n * Enable pinch zoom handling and mark the shared touch handler as active.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n addHooks() {\n this._map._container.classList.add('leaflet-touch-zoom');\n this._map.touchGestures.enable();\n this._map.touchGestures.zoom = true;\n },\n\n /**\n * Disable pinch zoom handling while preserving touch rotation state.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n removeHooks() {\n this._map._container.classList.remove('leaflet-touch-zoom');\n this._map.touchGestures.zoom = false;\n },\n\n});\n\n/**\n * Add Touch Zoom handler (disabled unless `L.Browser.touch` is set).\n * \n * @property {L.Map.TouchGestures} touchGestures\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook('addHandler', 'touchZoom', L.Map.TouchZoom);\n", "/**\n * Leaflet control showing the map bearing and pitch, MapLibre-like (`NavigationControl` compass):\n * \n * - Click: animate back to north (and to zero pitch when `visualizePitch` is enabled).\n * - Drag: horizontal movement changes the bearing, vertical movement changes the pitch.\n * \n * Touch rotation and compass bearing are configured with the `touchRotate` and `compassBearing`\n * map handlers (eg. `map.compassBearing.enable()`).\n * \n * @class L.Control.Rotate\n * \n * @extends L.Control\n * \n * @property {string} [position='topleft'] Leaflet control position.\n * @property {boolean} [closeOnZeroBearing=true] Hide the control when both bearing and pitch are zero.\n * @property {boolean} [visualizePitch=true] Tilt the icon with the pitch, reset the pitch on click and change it on drag.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n\nL.Control.Rotate = L.Control.extend({\n\n options: {\n position: 'topleft',\n closeOnZeroBearing: true,\n visualizePitch: true,\n },\n\n /**\n * Create the control element and subscribe to map rotation and pitch.\n * \n * @param {L.Map} map\n * \n * @returns {HTMLElement} Control container.\n * \n * @since leaflet-rotate (v0.1.0)\n */\n onAdd(map) {\n const container = this._container = L.DomUtil.create('div', 'leaflet-control-rotate leaflet-bar');\n\n const arrow = this._arrow = L.DomUtil.create('span', 'leaflet-control-rotate-arrow');\n\n arrow.style.backgroundImage = `url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='29' height='29' viewBox='0 0 29 29' xmlns='http://www.w3.org/2000/svg' fill='%23333'%3E%3Cpath d='M10.5 14l4-8 4 8h-8z'/%3E%3Cpath d='M10.5 16l4 8 4-8h-8z' fill='%23ccc'/%3E%3C/svg%3E\")`;\n arrow.style.display = 'block';\n arrow.style.width = '100%';\n arrow.style.height = '100%';\n arrow.style.backgroundRepeat = 'no-repeat';\n arrow.style.backgroundPosition = '50%';\n arrow.style.pointerEvents = 'none';\n\n const link = this._link = L.DomUtil.create('a', 'leaflet-control-rotate-toggle', container);\n link.appendChild(arrow);\n link.href = '#';\n link.title = this.options.visualizePitch ? 'Reset bearing and pitch' : 'Reset bearing to north';\n link.setAttribute('role', 'button');\n link.setAttribute('aria-label', link.title);\n link.style.cursor = 'grab';\n link.style.touchAction = 'none';\n\n this._onPointerMoveBound = this._onPointerMove.bind(this);\n this._onPointerUpBound = this._onPointerUp.bind(this);\n\n L.DomEvent\n .on(link, 'dblclick contextmenu', L.DomEvent.stop)\n .on(link, 'click', L.DomEvent.stop)\n .on(link, 'click', this._onClick, this)\n .on(link, 'click', this._refocusOnMap, this);\n link.addEventListener('pointerdown', this._onPointerDown.bind(this));\n\n map.on('rotate pitch', this._restyle, this);\n this._map = map;\n this._restyle();\n\n return container;\n },\n\n /**\n * Remove the map event listener when the control is detached.\n * \n * @param {L.Map} map\n * \n * @since leaflet-rotate (v0.1.0)\n */\n onRemove(map) {\n this._onPointerUp();\n map.off('rotate pitch', this._restyle, this);\n },\n\n /**\n * Reset bearing (and pitch) unless the click ends a drag.\n * \n * @since leaflet-rotate (0.5.1)\n */\n _onClick() {\n if (this._moved) {\n this._moved = false;\n return;\n }\n if (!this._map || !this._map._rotate) { return; }\n if (this.options.visualizePitch) {\n this._map.resetNorthPitch();\n } else {\n this._map.resetNorth();\n }\n },\n\n /**\n * Start dragging the control (mouse, pen or touch).\n * \n * @param {PointerEvent} e\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onPointerDown(e) {\n if (!this._map || !this._map._rotate || e.button > 0 || this._pointerId != null) { return; }\n e.preventDefault();\n e.stopPropagation();\n this._pointerId = e.pointerId;\n this._startX = this._lastX = e.clientX;\n this._startY = this._lastY = e.clientY;\n this._moved = false;\n this._link.style.cursor = 'grabbing';\n document.addEventListener('pointermove', this._onPointerMoveBound);\n document.addEventListener('pointerup', this._onPointerUpBound);\n document.addEventListener('pointercancel', this._onPointerUpBound);\n },\n\n /**\n * Horizontal movement changes the bearing, vertical movement the pitch.\n * \n * @param {PointerEvent} e\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onPointerMove(e) {\n if (e.pointerId !== this._pointerId) { return; }\n e.preventDefault();\n if (!this._moved && Math.hypot(e.clientX - this._startX, e.clientY - this._startY) < 3) { return; }\n if (!this._moved) {\n this._moved = true;\n this._map._stopPitchBearingAnimation();\n }\n const map = this._map,\n pitch = this.options.visualizePitch ? map.getPitch() + (this._lastY - e.clientY) * 0.5 : map.getPitch();\n map._setPitchAndBearing(pitch, map.getBearing() + (e.clientX - this._lastX) * 0.8);\n this._lastX = e.clientX;\n this._lastY = e.clientY;\n },\n\n /**\n * Stop dragging and remove document listeners.\n * \n * @param {PointerEvent} [e]\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _onPointerUp(e) {\n if (e && e.pointerId !== this._pointerId) { return; }\n document.removeEventListener('pointermove', this._onPointerMoveBound);\n document.removeEventListener('pointerup', this._onPointerUpBound);\n document.removeEventListener('pointercancel', this._onPointerUpBound);\n // a drag ending outside the button produces no click\n if (e && this._moved && !this._link.contains(e.target)) { this._moved = false; }\n delete this._pointerId;\n if (this._link) {\n this._link.style.cursor = 'grab';\n this._restyle();\n }\n },\n\n /**\n * Update the icon (bearing and pitch) and the control visibility.\n * \n * @listens L.Map#rotate\n * @listens L.Map#pitch\n * \n * @since leaflet-rotate (v0.1.0)\n */\n _restyle() {\n const map = this._map;\n if (!map) { return; }\n if (!map.options.rotate) {\n this._link.classList.add('leaflet-disabled');\n return;\n }\n\n const bearing = map.getBearing(),\n pitch = map.getPitch();\n\n this._arrow.style.transform = this.options.visualizePitch && pitch\n ? `scale(${1 / Math.sqrt(Math.cos(pitch * Math.PI / 180))}) rotateX(${pitch}deg) rotate(${bearing}deg)`\n : `rotate(${bearing}deg)`;\n\n if (this.options.closeOnZeroBearing) {\n const hidden = !bearing && !(this.options.visualizePitch && pitch) && this._pointerId == null;\n this._container.style.display = hidden ? 'none' : 'block';\n }\n },\n\n});\nif (L.control) {\n L.control.rotate = options => new L.Control.Rotate(options);\n}\n\nL.Map.mergeOptions({\n /**\n * Add the rotation control automatically. Set to `false` to disable,\n * or pass an options object to configure the control.\n * \n * @type {boolean|Object}\n * \n * @since leaflet-rotate (v0.1.0)\n */\n rotateControl: true,\n});\n\n/**\n * Add the configured rotation control to each newly initialized map.\n * \n * @since leaflet-rotate (v0.1.0)\n */\nL.Map.addInitHook(function() {\n if (this.options.rotateControl) {\n const options = typeof this.options.rotateControl === 'object' ? this.options.rotateControl : {};\n this.rotateControl = new L.Control.Rotate(options);\n this.addControl(this.rotateControl);\n }\n});\n\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACMA,MAAM,eAAe,OAAO,OAAO,CAAC,GAAG,EAAE,OAAO;AAEhD,SAAO,OAAO,EAAE,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAerB,aAAa,IAAI,QAAQ,OAAO,SAAS,OAAO;AAC5C,UAAI,MAAM,UAAU,IAAI,EAAE,MAAM,GAAG,CAAC;AAEpC,UAAI,CAAC,SAAS;AACV,eAAO,aAAa,aAAa,IAAI,IAAI,OAAO,GAAG,KAAK;AAAA,MAC5D;AAEA,YAAM,IAAI,WAAW,SAAS,KAAK;AACnC,SAAG,MAAM,YACL,iBAAiB,IAAI,IAAI,QAAQ,IAAI,IAAI,WACxC,QAAQ,YAAY,QAAQ,MAAM,MACnC,aAAa,UAAU;AAAA,IAC/B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAgBA,YAAY,IAAI,OAAO,SAAS,OAAO,OAAO;AAC1C,UAAI,CAAC,SAAS;AACV,eAAO,aAAa,YAAY,IAAI,KAAK;AAAA,MAC7C;AAEA,SAAG,eAAe;AAClB,QAAE,QAAQ,aAAa,IAAI,OAAO,OAAO,SAAS,KAAK;AAAA,IAC3D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAWA,YAAY,IAAI;AACZ,aAAO,GAAG,gBAAgB,aAAa,YAAY,EAAE;AAAA,IACzD;AAAA,EACJ,CAAC;;;ACvDD,IAAE,UAAU,QAAQ;AAAA;AAAA;AAAA;A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