maplair 4.1.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/dist/esm/Maplair.js +5 -4
  3. package/dist/esm/Maplair.js.map +1 -1
  4. package/dist/esm/_virtual/_rolldown/runtime.js +1 -2
  5. package/dist/esm/control/AttributionControl.js +1 -2
  6. package/dist/esm/control/ButtonControl.js +1 -2
  7. package/dist/esm/control/ContextMenu.js +1 -2
  8. package/dist/esm/control/Control.js +1 -2
  9. package/dist/esm/control/FullscreenControl.js +1 -2
  10. package/dist/esm/control/LayersControl.js +27 -31
  11. package/dist/esm/control/LayersControl.js.map +1 -1
  12. package/dist/esm/control/LegendControl.js +1 -2
  13. package/dist/esm/control/MiniMapControl.js +1 -2
  14. package/dist/esm/control/RotateControl.js +1 -2
  15. package/dist/esm/control/ScaleControl.js +1 -2
  16. package/dist/esm/control/SearchControl.js +1 -2
  17. package/dist/esm/control/SideBySideControl.js +1 -2
  18. package/dist/esm/control/TextControl.js +1 -2
  19. package/dist/esm/control/TimeControl.js +1 -2
  20. package/dist/esm/control/ZoomControl.js +18 -29
  21. package/dist/esm/control/ZoomControl.js.map +1 -1
  22. package/dist/esm/core/Class.js +2 -9
  23. package/dist/esm/core/Class.js.map +1 -1
  24. package/dist/esm/core/Events.js +2 -2
  25. package/dist/esm/core/Events.js.map +1 -1
  26. package/dist/esm/core/Handler.js +10 -3
  27. package/dist/esm/core/Handler.js.map +1 -1
  28. package/dist/esm/core/I18n.js +1 -2
  29. package/dist/esm/core/Util.js +2 -3
  30. package/dist/esm/core/Util.js.map +1 -1
  31. package/dist/esm/dom/DomEvent.DoubleTap.js +1 -2
  32. package/dist/esm/dom/DomEvent.PointerEvents.js +1 -2
  33. package/dist/esm/dom/DomEvent.js +10 -18
  34. package/dist/esm/dom/DomEvent.js.map +1 -1
  35. package/dist/esm/dom/DomUtil.js +1 -2
  36. package/dist/esm/dom/Draggable.js +4 -3
  37. package/dist/esm/dom/Draggable.js.map +1 -1
  38. package/dist/esm/dom/PosAnimation.js +1 -2
  39. package/dist/esm/geo/LatLng.js +1 -2
  40. package/dist/esm/geo/LatLngBounds.js +9 -15
  41. package/dist/esm/geo/LatLngBounds.js.map +1 -1
  42. package/dist/esm/geo/crs/CRS.js +1 -2
  43. package/dist/esm/geo/crs/EPSG3395.js +4 -5
  44. package/dist/esm/geo/crs/EPSG3395.js.map +1 -1
  45. package/dist/esm/geo/crs/EPSG3857.js +4 -5
  46. package/dist/esm/geo/crs/EPSG3857.js.map +1 -1
  47. package/dist/esm/geo/crs/EPSG4326.js +3 -4
  48. package/dist/esm/geo/crs/EPSG4326.js.map +1 -1
  49. package/dist/esm/geo/crs/EarthCRS.js +1 -2
  50. package/dist/esm/geo/crs/SimpleCRS.js +3 -4
  51. package/dist/esm/geo/crs/SimpleCRS.js.map +1 -1
  52. package/dist/esm/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +4 -5
  53. package/dist/esm/geo/projection/LonLatProjection.js.map +1 -0
  54. package/dist/esm/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +3 -4
  55. package/dist/esm/geo/projection/MercatorProjection.js.map +1 -0
  56. package/dist/esm/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +4 -5
  57. package/dist/esm/geo/projection/SphericalMercatorProjection.js.map +1 -0
  58. package/dist/esm/geometry/Bounds.js +10 -14
  59. package/dist/esm/geometry/Bounds.js.map +1 -1
  60. package/dist/esm/geometry/LineUtil.js +2 -3
  61. package/dist/esm/geometry/LineUtil.js.map +1 -1
  62. package/dist/esm/geometry/Point.js +1 -2
  63. package/dist/esm/geometry/PolyUtil.js +17 -25
  64. package/dist/esm/geometry/PolyUtil.js.map +1 -1
  65. package/dist/esm/geometry/Transformation.js +1 -2
  66. package/dist/esm/layer/BlanketOverlay.js +1 -2
  67. package/dist/esm/layer/Classification.js +1 -2
  68. package/dist/esm/layer/DivOverlay.js +2 -3
  69. package/dist/esm/layer/DivOverlay.js.map +1 -1
  70. package/dist/esm/layer/FeatureGroup.js +5 -4
  71. package/dist/esm/layer/FeatureGroup.js.map +1 -1
  72. package/dist/esm/layer/GeoJSON.Load.js +1 -2
  73. package/dist/esm/layer/GeoJSON.js +8 -10
  74. package/dist/esm/layer/GeoJSON.js.map +1 -1
  75. package/dist/esm/layer/GeoJSONUtil.js +1 -2
  76. package/dist/esm/layer/HeatLayer.js +2 -3
  77. package/dist/esm/layer/HeatLayer.js.map +1 -1
  78. package/dist/esm/layer/ImageOverlay.js +2 -3
  79. package/dist/esm/layer/ImageOverlay.js.map +1 -1
  80. package/dist/esm/layer/Layer.js +1 -2
  81. package/dist/esm/layer/LayerGroup.js +2 -3
  82. package/dist/esm/layer/LayerGroup.js.map +1 -1
  83. package/dist/esm/layer/Popup.js +9 -16
  84. package/dist/esm/layer/Popup.js.map +1 -1
  85. package/dist/esm/layer/SVGOverlay.js +1 -2
  86. package/dist/esm/layer/Tooltip.js +16 -17
  87. package/dist/esm/layer/Tooltip.js.map +1 -1
  88. package/dist/esm/layer/VideoOverlay.js +1 -2
  89. package/dist/esm/layer/marker/DefaultIcon.js +29 -7
  90. package/dist/esm/layer/marker/DefaultIcon.js.map +1 -1
  91. package/dist/esm/layer/marker/DivIcon.js +1 -2
  92. package/dist/esm/layer/marker/Icon.js +2 -2
  93. package/dist/esm/layer/marker/Icon.js.map +1 -1
  94. package/dist/esm/layer/marker/Marker.Drag.js +43 -4
  95. package/dist/esm/layer/marker/Marker.Drag.js.map +1 -1
  96. package/dist/esm/layer/marker/Marker.Move.js +4 -6
  97. package/dist/esm/layer/marker/Marker.Move.js.map +1 -1
  98. package/dist/esm/layer/marker/Marker.js +54 -14
  99. package/dist/esm/layer/marker/Marker.js.map +1 -1
  100. package/dist/esm/layer/marker/MarkerClusterGroup.js +1 -2
  101. package/dist/esm/layer/marker/SvgIcon.js +1 -2
  102. package/dist/esm/layer/tile/GridLayer.js +4 -4
  103. package/dist/esm/layer/tile/GridLayer.js.map +1 -1
  104. package/dist/esm/layer/tile/TileLayer.js +8 -8
  105. package/dist/esm/layer/tile/TileLayer.js.map +1 -1
  106. package/dist/esm/layer/tile/WMSTileLayer.js +5 -4
  107. package/dist/esm/layer/tile/WMSTileLayer.js.map +1 -1
  108. package/dist/esm/layer/vector/Canvas.js +7 -14
  109. package/dist/esm/layer/vector/Canvas.js.map +1 -1
  110. package/dist/esm/layer/vector/Circle.js +5 -3
  111. package/dist/esm/layer/vector/Circle.js.map +1 -1
  112. package/dist/esm/layer/vector/CircleMarker.js +2 -3
  113. package/dist/esm/layer/vector/CircleMarker.js.map +1 -1
  114. package/dist/esm/layer/vector/Path.DashAnimation.js +1 -2
  115. package/dist/esm/layer/vector/Path.ZoomStyles.js +1 -2
  116. package/dist/esm/layer/vector/Path.js +1 -2
  117. package/dist/esm/layer/vector/Polygon.js +2 -3
  118. package/dist/esm/layer/vector/Polygon.js.map +1 -1
  119. package/dist/esm/layer/vector/Polyline.Decorations.js +1 -2
  120. package/dist/esm/layer/vector/Polyline.js +2 -3
  121. package/dist/esm/layer/vector/Polyline.js.map +1 -1
  122. package/dist/esm/layer/vector/Rectangle.js +1 -2
  123. package/dist/esm/layer/vector/Renderer.getRenderer.js +4 -5
  124. package/dist/esm/layer/vector/Renderer.getRenderer.js.map +1 -1
  125. package/dist/esm/layer/vector/Renderer.js +1 -2
  126. package/dist/esm/layer/vector/SVG.js +7 -4
  127. package/dist/esm/layer/vector/SVG.js.map +1 -1
  128. package/dist/esm/map/Hash.js +1 -2
  129. package/dist/esm/map/Map.Rotation.js +31 -16
  130. package/dist/esm/map/Map.Rotation.js.map +1 -1
  131. package/dist/esm/map/Map.js +10 -17
  132. package/dist/esm/map/Map.js.map +1 -1
  133. package/dist/esm/map/MapSync.js +1 -2
  134. package/dist/esm/map/handler/BoxZoomHandler.js +20 -40
  135. package/dist/esm/map/handler/BoxZoomHandler.js.map +1 -1
  136. package/dist/esm/map/handler/DisplaceHandler.js +1 -2
  137. package/dist/esm/map/handler/DoubleClickZoomHandler.js +1 -2
  138. package/dist/esm/map/handler/DragHandler.js +1 -2
  139. package/dist/esm/map/handler/KeyboardHandler.js +23 -43
  140. package/dist/esm/map/handler/KeyboardHandler.js.map +1 -1
  141. package/dist/esm/map/handler/PinchZoomHandler.js +1 -2
  142. package/dist/esm/map/handler/ScrollWheelZoomHandler.js +1 -2
  143. package/dist/esm/map/handler/TapDragZoomHandler.js +1 -2
  144. package/dist/esm/map/handler/TapHoldHandler.js +1 -2
  145. package/dist/esm/package.js +2 -3
  146. package/dist/maplair-global-src.js +489 -613
  147. package/dist/maplair-global-src.js.map +1 -1
  148. package/dist/maplair-global.js +2 -2
  149. package/dist/maplair-global.js.map +1 -1
  150. package/dist/maplair-src.js +485 -609
  151. package/dist/maplair-src.js.map +1 -1
  152. package/dist/maplair.css +1 -1263
  153. package/dist/maplair.js +2 -2
  154. package/dist/maplair.js.map +1 -1
  155. package/package.json +4 -8
  156. package/src/Maplair.all.js +0 -1
  157. package/src/control/LayersControl.js +39 -52
  158. package/src/control/ZoomControl.js +17 -31
  159. package/src/core/Class.js +5 -14
  160. package/src/core/Events.js +2 -0
  161. package/src/core/Handler.js +11 -1
  162. package/src/core/Util.js +1 -1
  163. package/src/dom/DomEvent.js +9 -19
  164. package/src/dom/Draggable.js +5 -1
  165. package/src/geo/LatLngBounds.js +8 -15
  166. package/src/geo/crs/EPSG3395.js +3 -3
  167. package/src/geo/crs/EPSG3857.js +3 -3
  168. package/src/geo/crs/EPSG4326.js +2 -2
  169. package/src/geo/crs/SimpleCRS.js +2 -2
  170. package/src/geo/index.js +1 -2
  171. package/src/geo/projection/{Projection.LonLat.js → LonLatProjection.js} +1 -1
  172. package/src/geo/projection/{Projection.Mercator.js → MercatorProjection.js} +1 -1
  173. package/src/geo/projection/{Projection.SphericalMercator.js → SphericalMercatorProjection.js} +1 -1
  174. package/src/geo/projection/index.js +5 -5
  175. package/src/geometry/Bounds.js +12 -17
  176. package/src/geometry/LineUtil.js +1 -1
  177. package/src/geometry/PolyUtil.js +23 -31
  178. package/src/layer/DivOverlay.js +1 -1
  179. package/src/layer/FeatureGroup.js +8 -2
  180. package/src/layer/GeoJSON.js +10 -13
  181. package/src/layer/HeatLayer.js +1 -1
  182. package/src/layer/ImageOverlay.js +2 -2
  183. package/src/layer/LayerGroup.js +1 -1
  184. package/src/layer/Popup.js +9 -19
  185. package/src/layer/Tooltip.js +19 -17
  186. package/src/layer/marker/DefaultIcon.js +33 -5
  187. package/src/layer/marker/Icon.js +2 -0
  188. package/src/layer/marker/Marker.Drag.js +53 -5
  189. package/src/layer/marker/Marker.Move.js +3 -4
  190. package/src/layer/marker/Marker.js +64 -13
  191. package/src/layer/tile/GridLayer.js +5 -2
  192. package/src/layer/tile/TileLayer.js +9 -6
  193. package/src/layer/tile/WMSTileLayer.js +5 -2
  194. package/src/layer/vector/Canvas.js +10 -14
  195. package/src/layer/vector/Circle.js +7 -1
  196. package/src/layer/vector/CircleMarker.js +2 -1
  197. package/src/layer/vector/Polygon.js +1 -1
  198. package/src/layer/vector/Polyline.js +1 -1
  199. package/src/layer/vector/Renderer.getRenderer.js +4 -3
  200. package/src/layer/vector/SVG.js +12 -2
  201. package/src/map/Map.Rotation.js +28 -4
  202. package/src/map/Map.js +17 -21
  203. package/src/map/handler/BoxZoomHandler.js +21 -42
  204. package/src/map/handler/KeyboardHandler.js +34 -53
  205. package/src/maplair.css +5 -0
  206. package/dist/esm/geo/projection/Projection.LonLat.js.map +0 -1
  207. package/dist/esm/geo/projection/Projection.Mercator.js.map +0 -1
  208. package/dist/esm/geo/projection/Projection.SphericalMercator.js.map +0 -1
  209. package/dist/esm/geo/projection/index.js +0 -14
  210. package/dist/esm/geo/projection/index.js.map +0 -1
  211. package/dist/esm/layer/marker/Marker.Rotation.js +0 -70
  212. package/dist/esm/layer/marker/Marker.Rotation.js.map +0 -1
  213. package/src/layer/marker/Marker.Rotation.js +0 -103
@@ -4,7 +4,7 @@ import { Point } from "../geometry/Point.js";
4
4
  import { addDoubleTapListener, removeDoubleTapListener } from "./DomEvent.DoubleTap.js";
5
5
  import { DomEvent_PointerEvents_exports } from "./DomEvent.PointerEvents.js";
6
6
  import { getScale } from "./DomUtil.js";
7
- //#region src/dom/DomEvent.js
7
+ // src/dom/DomEvent.js
8
8
  var DomEvent_exports = /* @__PURE__ */ __exportAll({
9
9
  PointerEvents: () => DomEvent_PointerEvents_exports,
10
10
  disableClickPropagation: () => disableClickPropagation,
@@ -30,12 +30,11 @@ var DomEvent_exports = /* @__PURE__ */ __exportAll({
30
30
  * @param {string|Record<string, (ev: any) => void>} types
31
31
  * @param {((ev: any) => void)|object} [fn]
32
32
  * @param {object} [context]
33
- * @returns {typeof import('./DomEvent.js')}
33
+ * @returns {void}
34
34
  */
35
35
  function on(obj, types, fn, context) {
36
36
  if (types && typeof types === "object") for (const [type, listener] of Object.entries(types)) addOne(obj, type, listener, fn);
37
37
  else for (const type of splitWords(types)) addOne(obj, type, fn, context);
38
- return this;
39
38
  }
40
39
  const eventsKey = "_maplair_events";
41
40
  /**
@@ -49,7 +48,7 @@ const eventsKey = "_maplair_events";
49
48
  * @param {string|Record<string, (ev: any) => void>} [types]
50
49
  * @param {((ev: any) => void)|object} [fn]
51
50
  * @param {object} [context]
52
- * @returns {typeof import('./DomEvent.js')}
51
+ * @returns {void}
53
52
  */
54
53
  function off(obj, types, fn, context) {
55
54
  if (arguments.length === 1) {
@@ -61,7 +60,6 @@ function off(obj, types, fn, context) {
61
60
  if (arguments.length === 2) batchRemove(obj, (type) => types.includes(type));
62
61
  else for (const type of types) removeOne(obj, type, fn, context);
63
62
  }
64
- return this;
65
63
  }
66
64
  const DIGIT_RE = /\d/;
67
65
  function batchRemove(obj, filterFn) {
@@ -72,7 +70,7 @@ function batchRemove(obj, filterFn) {
72
70
  }
73
71
  function addOne(obj, type, fn, context) {
74
72
  const id = type + stamp(fn) + (context ? `_${stamp(context)}` : "");
75
- if (obj[eventsKey] && obj[eventsKey][id]) return this;
73
+ if (obj[eventsKey] && obj[eventsKey][id]) return;
76
74
  let handler = function(e) {
77
75
  return fn.call(context || obj, e);
78
76
  };
@@ -84,7 +82,7 @@ function addOne(obj, type, fn, context) {
84
82
  function removeOne(obj, type, fn, context, id) {
85
83
  id ??= type + stamp(fn) + (context ? `_${stamp(context)}` : "");
86
84
  const handler = obj[eventsKey] && obj[eventsKey][id];
87
- if (!handler) return this;
85
+ if (!handler) return;
88
86
  if (type === "dblclick") removeDoubleTapListener(obj, handler);
89
87
  else obj.removeEventListener(type, handler, false);
90
88
  obj[eventsKey][id] = null;
@@ -97,22 +95,20 @@ function removeOne(obj, type, fn, context, id) {
97
95
  * ```
98
96
  * Also accepts a Maplair event with an `originalEvent`.
99
97
  * @param {Event|{originalEvent: Event}} e
100
- * @returns {typeof import('./DomEvent.js')}
98
+ * @returns {void}
101
99
  */
102
100
  function stopPropagation(e) {
103
101
  if (e.stopPropagation) e.stopPropagation();
104
102
  else if (e.originalEvent) e.originalEvent._stopped = true;
105
103
  else console.debug("Unsupported event", e);
106
- return this;
107
104
  }
108
105
  /**
109
106
  * Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants).
110
107
  * @param {HTMLElement} el
111
- * @returns {typeof import('./DomEvent.js')}
108
+ * @returns {void}
112
109
  */
113
110
  function disableScrollPropagation(el) {
114
111
  addOne(el, "wheel", stopPropagation);
115
- return this;
116
112
  }
117
113
  /**
118
114
  * Adds `stopPropagation` to the element's `'dblclick'`, `'contextmenu'`
@@ -120,12 +116,11 @@ function disableScrollPropagation(el) {
120
116
  * For `'click'` events, prevents the map from handling the click
121
117
  * while still allowing the native DOM click event to propagate normally.
122
118
  * @param {HTMLElement} el
123
- * @returns {typeof import('./DomEvent.js')}
119
+ * @returns {void}
124
120
  */
125
121
  function disableClickPropagation(el) {
126
122
  on(el, "pointerdown dblclick contextmenu", stopPropagation);
127
123
  el["_maplair_disable_click"] = true;
128
- return this;
129
124
  }
130
125
  /**
131
126
  * Prevents the default action of the DOM Event `e` from happening (such as
@@ -133,21 +128,19 @@ function disableClickPropagation(el) {
133
128
  * with page reload when a `<form>` is submitted).
134
129
  * Use it inside listener functions.
135
130
  * @param {Event} e
136
- * @returns {typeof import('./DomEvent.js')}
131
+ * @returns {void}
137
132
  */
138
133
  function preventDefault(e) {
139
134
  e.preventDefault?.();
140
- return this;
141
135
  }
142
136
  /**
143
137
  * Does `stopPropagation` and `preventDefault` at the same time.
144
138
  * @param {Event} e
145
- * @returns {typeof import('./DomEvent.js')}
139
+ * @returns {void}
146
140
  */
147
141
  function stop(e) {
148
142
  preventDefault(e);
149
143
  stopPropagation(e);
150
- return this;
151
144
  }
152
145
  /**
153
146
  * Gets normalized pointer position from a DOM event relative to the
@@ -190,7 +183,6 @@ function getWheelDelta(e) {
190
183
  function isExternalTarget(el, e) {
191
184
  return !el.contains(e.relatedTarget);
192
185
  }
193
- //#endregion
194
186
  export { DomEvent_exports, DomEvent_PointerEvents_exports as PointerEvents, disableClickPropagation, disableScrollPropagation, getPointerPosition, getWheelDelta, getWheelPxFactor, isExternalTarget, off, on, preventDefault, stop, stopPropagation };
195
187
 
196
188
  //# sourceMappingURL=DomEvent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DomEvent.js","names":["Util.splitWords","Util.stamp"],"sources":["../../../src/dom/DomEvent.js"],"sourcesContent":["import {Point} from '../geometry/Point.js';\nimport * as Util from '../core/Util.js';\nimport {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap.js';\nimport {getScale} from './DomUtil.js';\n\nimport * as PointerEvents from './DomEvent.PointerEvents.js';\nexport {PointerEvents};\n\n// DomEvent: utility functions to work with the\n// [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Maplair\n// internally. The functions return the `DomEvent` namespace for chaining.\n\n// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\n\n/**\n * Adds a listener function (`fn`) to a particular DOM event type of the\n * element `obj`. You can optionally specify the context of the listener\n * (object the `this` keyword will point to). You can also pass several\n * space-separated types (e.g. `'click dblclick'`). Alternatively, adds a set of\n * type/listener pairs, e.g. `{click: onClick, pointermove: onPointerMove}`, with the\n * context as third argument.\n * @param {EventTarget} obj\n * @param {string|Record<string, (ev: any) => void>} types\n * @param {((ev: any) => void)|object} [fn]\n * @param {object} [context]\n * @returns {typeof import('./DomEvent.js')}\n */\nexport function on(obj, types, fn, context) {\n\n\tif (types && typeof types === 'object') {\n\t\tfor (const [type, listener] of Object.entries(types)) {\n\t\t\taddOne(obj, type, listener, fn);\n\t\t}\n\t} else {\n\t\tfor (const type of Util.splitWords(types)) {\n\t\t\taddOne(obj, type, fn, context);\n\t\t}\n\t}\n\n\treturn this;\n}\n\nconst eventsKey = '_maplair_events';\n\n/**\n * Removes a previously added listener function.\n * Note that if you passed a custom context to on, you must pass the same\n * context to `off` in order to remove the listener. Alternatively, removes a set of\n * type/listener pairs, e.g. `{click: onClick, pointermove: onPointerMove}`; with\n * `types` only, removes all previously added listeners of given types; with the\n * element only, removes all previously added listeners from the given element.\n * @param {EventTarget} obj\n * @param {string|Record<string, (ev: any) => void>} [types]\n * @param {((ev: any) => void)|object} [fn]\n * @param {object} [context]\n * @returns {typeof import('./DomEvent.js')}\n */\nexport function off(obj, types, fn, context) {\n\n\tif (arguments.length === 1) {\n\t\tbatchRemove(obj);\n\t\tdelete obj[eventsKey];\n\n\t} else if (types && typeof types === 'object') {\n\t\tfor (const [type, listener] of Object.entries(types)) {\n\t\t\tremoveOne(obj, type, listener, fn);\n\t\t}\n\n\t} else {\n\t\ttypes = Util.splitWords(types);\n\n\t\tif (arguments.length === 2) {\n\t\t\tbatchRemove(obj, type => types.includes(type));\n\t\t} else {\n\t\t\tfor (const type of types) {\n\t\t\t\tremoveOne(obj, type, fn, context);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn this;\n}\n\nconst DIGIT_RE = /\\d/;\n\nfunction batchRemove(obj, filterFn) {\n\tfor (const id of Object.keys(obj[eventsKey] ?? {})) {\n\t\tconst type = id.split(DIGIT_RE)[0];\n\t\tif (!filterFn || filterFn(type)) {\n\t\t\tremoveOne(obj, type, null, null, id);\n\t\t}\n\t}\n}\n\nfunction addOne(obj, type, fn, context) {\n\tconst id = type + Util.stamp(fn) + (context ? `_${Util.stamp(context)}` : '');\n\n\tif (obj[eventsKey] && obj[eventsKey][id]) { return this; }\n\n\tlet handler = function (e) {\n\t\treturn fn.call(context || obj, e);\n\t};\n\n\tif (type === 'dblclick') {\n\t\thandler = addDoubleTapListener(obj, handler);\n\t} else {\n\t\tobj.addEventListener(type, handler, type === 'wheel' ? {passive: false} : false);\n\t}\n\n\tobj[eventsKey] ??= {};\n\tobj[eventsKey][id] = handler;\n}\n\nfunction removeOne(obj, type, fn, context, id) {\n\tid ??= type + Util.stamp(fn) + (context ? `_${Util.stamp(context)}` : '');\n\tconst handler = obj[eventsKey] && obj[eventsKey][id];\n\n\tif (!handler) { return this; }\n\n\tif (type === 'dblclick') {\n\t\tremoveDoubleTapListener(obj, handler);\n\t} else {\n\t\tobj.removeEventListener(type, handler, false);\n\t}\n\n\tobj[eventsKey][id] = null;\n}\n\n/**\n * Stop the given event from propagation to parent elements. Used inside the listener\n * functions:\n * ```js\n * DomEvent.on(div, 'click', DomEvent.stopPropagation);\n * ```\n * Also accepts a Maplair event with an `originalEvent`.\n * @param {Event|{originalEvent: Event}} e\n * @returns {typeof import('./DomEvent.js')}\n */\nexport function stopPropagation(e) {\n\n\t// feature detection rather than `instanceof Event`, which fails for events from other windows (e.g. iframes)\n\tif (e.stopPropagation) {\n\t\te.stopPropagation();\n\t} else if (e.originalEvent) { // In case of Maplair event.\n\t\te.originalEvent._stopped = true;\n\t} else {\n\t\t// custom Maplair event\n\t\tconsole.debug('Unsupported event', e);\n\t}\n\n\treturn this;\n}\n\n/**\n * Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants).\n * @param {HTMLElement} el\n * @returns {typeof import('./DomEvent.js')}\n */\nexport function disableScrollPropagation(el) {\n\taddOne(el, 'wheel', stopPropagation);\n\treturn this;\n}\n\n/**\n * Adds `stopPropagation` to the element's `'dblclick'`, `'contextmenu'`\n * and `'pointerdown'` events (plus browser variants).\n * For `'click'` events, prevents the map from handling the click\n * while still allowing the native DOM click event to propagate normally.\n * @param {HTMLElement} el\n * @returns {typeof import('./DomEvent.js')}\n */\nexport function disableClickPropagation(el) {\n\ton(el, 'pointerdown dblclick contextmenu', stopPropagation);\n\tel['_maplair_disable_click'] = true;\n\treturn this;\n}\n\n/**\n * Prevents the default action of the DOM Event `e` from happening (such as\n * following a link in the href of the a element, or doing a POST request\n * with page reload when a `<form>` is submitted).\n * Use it inside listener functions.\n * @param {Event} e\n * @returns {typeof import('./DomEvent.js')}\n */\nexport function preventDefault(e) {\n\te.preventDefault?.();\n\treturn this;\n}\n\n/**\n * Does `stopPropagation` and `preventDefault` at the same time.\n * @param {Event} e\n * @returns {typeof import('./DomEvent.js')}\n */\nexport function stop(e) {\n\tpreventDefault(e);\n\tstopPropagation(e);\n\treturn this;\n}\n\n/**\n * Gets normalized pointer position from a DOM event relative to the\n * `container` (border excluded) or to the whole page if not specified.\n * @param {MouseEvent|Touch} e\n * @param {HTMLElement} [container]\n * @returns {Point}\n */\nexport function getPointerPosition(e, container) {\n\tif (!container) {\n\t\treturn new Point(e.clientX, e.clientY);\n\t}\n\n\tconst scale = getScale(container),\n\toffset = scale.boundingClientRect; // left and top values are in page scale (like the event clientX/Y)\n\n\treturn new Point(\n\t\t// offset.left/top values are in page scale (like clientX/Y),\n\t\t// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\n\t\t(e.clientX - offset.left) / scale.x - container.clientLeft,\n\t\t(e.clientY - offset.top) / scale.y - container.clientTop\n\t);\n}\n\n/**\n * Gets the wheel pixel factor based on the devicePixelRatio.\n * @returns {number}\n */\nexport function getWheelPxFactor() {\n\t// We need double the scroll pixels (see #7403 and #4538)\n\treturn window.devicePixelRatio * 2;\n}\n\n/**\n * Gets normalized wheel delta from a wheel DOM event, in vertical\n * pixels scrolled (negative if scrolling down).\n * Events from pointing devices without precise scrolling are mapped to\n * a best guess of 60 pixels.\n * @param {WheelEvent} e\n * @returns {number}\n */\nexport function getWheelDelta(e) {\n\treturn (e.deltaY && e.deltaMode === 0) ? -e.deltaY / getWheelPxFactor() : // Pixels\n\t\t(e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\n\t\t(e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\n\t\t(e.deltaX || e.deltaZ) ? 0 :\t// Skip horizontal/depth wheel events\n\t\t0;\n}\n\n/**\n * Checks if the pointer really left/entered the element `el` (for\n * `pointerover`/`pointerout`).\n * @internal\n * @param {Node} el\n * @param {MouseEvent} e\n * @returns {boolean}\n */\nexport function isExternalTarget(el, e) {\n\treturn !el.contains(e.relatedTarget);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,GAAG,KAAK,OAAO,IAAI,SAAS;CAE3C,IAAI,SAAS,OAAO,UAAU,UAC7B,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAClD,OAAO,KAAK,MAAM,UAAU,EAAE;MAG/B,KAAK,MAAM,QAAQA,WAAgB,KAAK,GACvC,OAAO,KAAK,MAAM,IAAI,OAAO;CAI/B,OAAO;AACR;AAEA,MAAM,YAAY;;;;;;;;;;;;;;AAelB,SAAgB,IAAI,KAAK,OAAO,IAAI,SAAS;CAE5C,IAAI,UAAU,WAAW,GAAG;EAC3B,YAAY,GAAG;EACf,OAAO,IAAI;CAEZ,OAAO,IAAI,SAAS,OAAO,UAAU,UACpC,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAClD,UAAU,KAAK,MAAM,UAAU,EAAE;MAG5B;EACN,QAAQA,WAAgB,KAAK;EAE7B,IAAI,UAAU,WAAW,GACxB,YAAY,MAAK,SAAQ,MAAM,SAAS,IAAI,CAAC;OAE7C,KAAK,MA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AqB,CAAC;CAGrC,OAAO;AACR;;;;;;AAOA,SAAgB,yBAAyB,IAAI;CAC5C,OAAO,IAAI,SAAS,eAAe;CACnC,OAAO;AACR;;;;;;;;;AAUA,SAAgB,wBAAwB,IAAI;CAC3C,GAAG,IAAI,oCAAoC,eAAe;CAC1D,GAAG,4BAA4B;CAC/B,OAAO;AACR;;;;;;;;;AAUA,SAAgB,eAAe,GAAG;CACjC,EAAE,iBAAiB;CACnB,OAAO;AACR;;;;;;AAOA,SAAgB,KAAK,GAAG;CACvB,eAAe,CAAC;CAChB,gBAAgB,CAAC;CACjB,OAAO;AACR;;;;;;;;AASA,SAAgB,mBAAmB,GAAG,WAAW;CAChD,IAAI,CAAC,WACJ,OAAO,IAAI,MAAM,EAAE,SAAS,EAAE,OAAO;CAGtC,MAAM,QAAQ,SAAS,SAAS,GAChC,SAAS,MAAM;CAEf,OAAO,IAAI,OAGT,EAAE,UAAU,OAAO,QAAQ,MAAM,IAAI,UAAU,aAC/C,EAAE,UAAU,OAAO,OAAO,MAAM,IAAI,UAAU,SAChD;AACD;;;;;AAMA,SAAgB,mBAAmB;CAElC,OAAO,OAAO,mBAAmB;AAClC;;;;;;;;;AAUA,SAAgB,cAAc,GAAG;CAChC,OAAQ,EAAE,UAAU,EAAE,cAAc,IAAK,CAAC,EAAE,SAAS,iBAAiB,IACpE,EAAE,UAAU,EAAE,cAAc,IAAK,CAAC,EAAE,SAAS,KAC7C,EAAE,UAAU,EAAE,cAAc,IAAK,CAAC,EAAE,SAAS,KAC7C,EAAE,UAAU,EAAE,SAAU,IACzB;AACF;;;;;;;;;AAUA,SAAgB,iBAAiB,IAAI,GAAG;CACvC,OAAO,CAAC,GAAG,SAAS,EAAE,aAAa;AACpC"}
1
+ {"version":3,"file":"DomEvent.js","names":["Util.splitWords","Util.stamp"],"sources":["../../../src/dom/DomEvent.js"],"sourcesContent":["import {Point} from '../geometry/Point.js';\nimport * as Util from '../core/Util.js';\nimport {addDoubleTapListener, removeDoubleTapListener} from './DomEvent.DoubleTap.js';\nimport {getScale} from './DomUtil.js';\n\nimport * as PointerEvents from './DomEvent.PointerEvents.js';\nexport {PointerEvents};\n\n// DomEvent: utility functions to work with the\n// [DOM events](https://developer.mozilla.org/docs/Web/API/Event), used by Maplair\n// internally. The functions return the `DomEvent` namespace for chaining.\n\n// Inspired by John Resig, Dean Edwards and YUI addEvent implementations.\n\n/**\n * Adds a listener function (`fn`) to a particular DOM event type of the\n * element `obj`. You can optionally specify the context of the listener\n * (object the `this` keyword will point to). You can also pass several\n * space-separated types (e.g. `'click dblclick'`). Alternatively, adds a set of\n * type/listener pairs, e.g. `{click: onClick, pointermove: onPointerMove}`, with the\n * context as third argument.\n * @param {EventTarget} obj\n * @param {string|Record<string, (ev: any) => void>} types\n * @param {((ev: any) => void)|object} [fn]\n * @param {object} [context]\n * @returns {void}\n */\nexport function on(obj, types, fn, context) {\n\n\tif (types && typeof types === 'object') {\n\t\tfor (const [type, listener] of Object.entries(types)) {\n\t\t\taddOne(obj, type, listener, fn);\n\t\t}\n\t} else {\n\t\tfor (const type of Util.splitWords(types)) {\n\t\t\taddOne(obj, type, fn, context);\n\t\t}\n\t}\n}\n\nconst eventsKey = '_maplair_events';\n\n/**\n * Removes a previously added listener function.\n * Note that if you passed a custom context to on, you must pass the same\n * context to `off` in order to remove the listener. Alternatively, removes a set of\n * type/listener pairs, e.g. `{click: onClick, pointermove: onPointerMove}`; with\n * `types` only, removes all previously added listeners of given types; with the\n * element only, removes all previously added listeners from the given element.\n * @param {EventTarget} obj\n * @param {string|Record<string, (ev: any) => void>} [types]\n * @param {((ev: any) => void)|object} [fn]\n * @param {object} [context]\n * @returns {void}\n */\nexport function off(obj, types, fn, context) {\n\n\tif (arguments.length === 1) {\n\t\tbatchRemove(obj);\n\t\tdelete obj[eventsKey];\n\n\t} else if (types && typeof types === 'object') {\n\t\tfor (const [type, listener] of Object.entries(types)) {\n\t\t\tremoveOne(obj, type, listener, fn);\n\t\t}\n\n\t} else {\n\t\ttypes = Util.splitWords(types);\n\n\t\tif (arguments.length === 2) {\n\t\t\tbatchRemove(obj, type => types.includes(type));\n\t\t} else {\n\t\t\tfor (const type of types) {\n\t\t\t\tremoveOne(obj, type, fn, context);\n\t\t\t}\n\t\t}\n\t}\n}\n\nconst DIGIT_RE = /\\d/;\n\nfunction batchRemove(obj, filterFn) {\n\tfor (const id of Object.keys(obj[eventsKey] ?? {})) {\n\t\tconst type = id.split(DIGIT_RE)[0];\n\t\tif (!filterFn || filterFn(type)) {\n\t\t\tremoveOne(obj, type, null, null, id);\n\t\t}\n\t}\n}\n\nfunction addOne(obj, type, fn, context) {\n\tconst id = type + Util.stamp(fn) + (context ? `_${Util.stamp(context)}` : '');\n\n\tif (obj[eventsKey] && obj[eventsKey][id]) { return; }\n\n\tlet handler = function (e) {\n\t\treturn fn.call(context || obj, e);\n\t};\n\n\tif (type === 'dblclick') {\n\t\thandler = addDoubleTapListener(obj, handler);\n\t} else {\n\t\tobj.addEventListener(type, handler, type === 'wheel' ? {passive: false} : false);\n\t}\n\n\tobj[eventsKey] ??= {};\n\tobj[eventsKey][id] = handler;\n}\n\nfunction removeOne(obj, type, fn, context, id) {\n\tid ??= type + Util.stamp(fn) + (context ? `_${Util.stamp(context)}` : '');\n\tconst handler = obj[eventsKey] && obj[eventsKey][id];\n\n\tif (!handler) { return; }\n\n\tif (type === 'dblclick') {\n\t\tremoveDoubleTapListener(obj, handler);\n\t} else {\n\t\tobj.removeEventListener(type, handler, false);\n\t}\n\n\tobj[eventsKey][id] = null;\n}\n\n/**\n * Stop the given event from propagation to parent elements. Used inside the listener\n * functions:\n * ```js\n * DomEvent.on(div, 'click', DomEvent.stopPropagation);\n * ```\n * Also accepts a Maplair event with an `originalEvent`.\n * @param {Event|{originalEvent: Event}} e\n * @returns {void}\n */\nexport function stopPropagation(e) {\n\n\t// feature detection rather than `instanceof Event`, which fails for events from other windows (e.g. iframes)\n\tif (e.stopPropagation) {\n\t\te.stopPropagation();\n\t} else if (e.originalEvent) { // In case of Maplair event.\n\t\te.originalEvent._stopped = true;\n\t} else {\n\t\t// custom Maplair event\n\t\tconsole.debug('Unsupported event', e);\n\t}\n}\n\n/**\n * Adds `stopPropagation` to the element's `'wheel'` events (plus browser variants).\n * @param {HTMLElement} el\n * @returns {void}\n */\nexport function disableScrollPropagation(el) {\n\taddOne(el, 'wheel', stopPropagation);\n}\n\n/**\n * Adds `stopPropagation` to the element's `'dblclick'`, `'contextmenu'`\n * and `'pointerdown'` events (plus browser variants).\n * For `'click'` events, prevents the map from handling the click\n * while still allowing the native DOM click event to propagate normally.\n * @param {HTMLElement} el\n * @returns {void}\n */\nexport function disableClickPropagation(el) {\n\ton(el, 'pointerdown dblclick contextmenu', stopPropagation);\n\tel['_maplair_disable_click'] = true;\n}\n\n/**\n * Prevents the default action of the DOM Event `e` from happening (such as\n * following a link in the href of the a element, or doing a POST request\n * with page reload when a `<form>` is submitted).\n * Use it inside listener functions.\n * @param {Event} e\n * @returns {void}\n */\nexport function preventDefault(e) {\n\te.preventDefault?.();\n}\n\n/**\n * Does `stopPropagation` and `preventDefault` at the same time.\n * @param {Event} e\n * @returns {void}\n */\nexport function stop(e) {\n\tpreventDefault(e);\n\tstopPropagation(e);\n}\n\n/**\n * Gets normalized pointer position from a DOM event relative to the\n * `container` (border excluded) or to the whole page if not specified.\n * @param {MouseEvent|Touch} e\n * @param {HTMLElement} [container]\n * @returns {Point}\n */\nexport function getPointerPosition(e, container) {\n\tif (!container) {\n\t\treturn new Point(e.clientX, e.clientY);\n\t}\n\n\tconst scale = getScale(container),\n\toffset = scale.boundingClientRect; // left and top values are in page scale (like the event clientX/Y)\n\n\treturn new Point(\n\t\t// offset.left/top values are in page scale (like clientX/Y),\n\t\t// whereas clientLeft/Top (border width) values are the original values (before CSS scale applies).\n\t\t(e.clientX - offset.left) / scale.x - container.clientLeft,\n\t\t(e.clientY - offset.top) / scale.y - container.clientTop\n\t);\n}\n\n/**\n * Gets the wheel pixel factor based on the devicePixelRatio.\n * @returns {number}\n */\nexport function getWheelPxFactor() {\n\t// We need double the scroll pixels (see #7403 and #4538)\n\treturn window.devicePixelRatio * 2;\n}\n\n/**\n * Gets normalized wheel delta from a wheel DOM event, in vertical\n * pixels scrolled (negative if scrolling down).\n * Events from pointing devices without precise scrolling are mapped to\n * a best guess of 60 pixels.\n * @param {WheelEvent} e\n * @returns {number}\n */\nexport function getWheelDelta(e) {\n\treturn (e.deltaY && e.deltaMode === 0) ? -e.deltaY / getWheelPxFactor() : // Pixels\n\t\t(e.deltaY && e.deltaMode === 1) ? -e.deltaY * 20 : // Lines\n\t\t(e.deltaY && e.deltaMode === 2) ? -e.deltaY * 60 : // Pages\n\t\t(e.deltaX || e.deltaZ) ? 0 :\t// Skip horizontal/depth wheel events\n\t\t0;\n}\n\n/**\n * Checks if the pointer really left/entered the element `el` (for\n * `pointerover`/`pointerout`).\n * @internal\n * @param {Node} el\n * @param {MouseEvent} e\n * @returns {boolean}\n */\nexport function isExternalTarget(el, e) {\n\treturn !el.contains(e.relatedTarget);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2BA,SAAgB,GAAG,KAAK,OAAO,IAAI,SAAS;CAE3C,IAAI,SAAS,OAAO,UAAU,UAC7B,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAClD,OAAO,KAAK,MAAM,UAAU,EAAE;MAG/B,KAAK,MAAM,QAAQA,WAAgB,KAAK,GACvC,OAAO,KAAK,MAAM,IAAI,OAAO;AAGhC;AAEA,MAAM,YAAY;;;;;;;;;;;;;;AAelB,SAAgB,IAAI,KAAK,OAAO,IAAI,SAAS;CAE5C,IAAI,UAAU,WAAW,GAAG;EAC3B,YAAY,GAAG;EACf,OAAO,IAAI;CAEZ,OAAO,IAAI,SAAS,OAAO,UAAU,UACpC,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,KAAK,GAClD,UAAU,KAAK,MAAM,UAAU,EAAE;MAG5B;EACN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,iBACL,EAAE,gBAAgB;MACZ,IAAI,EAAE,eACZ,EAAE,cAAc,WAAW;MAG3B,QAAQ,MAAM,qBAAqB,CAAC;AAEtC;;;;;;AAOA,SAAgB,yBAAyB,IAAI;CAC5C,OAAO,IAAI,SAAS,eAAe;AACpC;;;;;;;;;AAUA,SAAgB,wBAAwB,IAAI;CAC3C,GAAG,IAAI,oCAAoC,eAAe;CAC1D,GAAG,4BAA4B;AAChC;;;;;;;;;AAUA,SAAgB,eAAe,GAAG;CACjC,EAAE,iBAAiB;AACpB;;;;;;AAOA,SAAgB,KAAK,GAAG;CACvB,eAAe,CAAC;CAChB,gBAAgB,CAAC;AAClB;;;;;;;;AASA,SAAgB,mBAAmB,GAAG,WAAW;CAChD,IAAI,CAAC,WACJ,OAAO,IAAI,MAAM,EAAE,SAAS,EAAE,OAAO;CAGtC,MAAM,QAAQ,SAAS,SAAS,GAChC,SAAS,MAAM;CAEf,OAAO,IAAI,OAGT,EAAE,UAAU,OAAO,QAAQ,MAAM,IAAI,UAAU,aAC/C,EAAE,UAAU,OAAO,OAAO,MAAM,IAAI,UAAU,SAChD;AACD;;;;;AAMA,SAAgB,mBAAmB;CAElC,OAAO,OAAO,mBAAmB;AAClC;;;;;;;;;AAUA,SAAgB,cAAc,GAAG;CAChC,OAAQ,EAAE,UAAU,EAAE,cAAc,IAAK,CAAC,EAAE,SAAS,iBAAiB,IACpE,EAAE,UAAU,EAAE,cAAc,IAAK,CAAC,EAAE,SAAS,KAC7C,EAAE,UAAU,EAAE,cAAc,IAAK,CAAC,EAAE,SAAS,KAC7C,EAAE,UAAU,EAAE,SAAU,IACzB;AACF;;;;;;;;;AAUA,SAAgB,iBAAiB,IAAI,GAAG;CACvC,OAAO,CAAC,GAAG,SAAS,EAAE,aAAa;AACpC"}
@@ -1,7 +1,7 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import { Point } from "../geometry/Point.js";
3
3
  import { off, on, preventDefault } from "./DomEvent.js";
4
- //#region src/dom/DomUtil.js
4
+ // src/dom/DomUtil.js
5
5
  var DomUtil_exports = /* @__PURE__ */ __exportAll({
6
6
  create: () => create,
7
7
  disableImageDrag: () => disableImageDrag,
@@ -141,7 +141,6 @@ function getScale(element) {
141
141
  boundingClientRect: rect
142
142
  };
143
143
  }
144
- //#endregion
145
144
  export { DomUtil_exports, create, disableImageDrag, enableImageDrag, get, getPosition, getScale, getSizedParentNode, setPosition, setTransform, toBack, toFront };
146
145
 
147
146
  //# sourceMappingURL=DomUtil.js.map
@@ -4,7 +4,7 @@ import { getPointers } from "./DomEvent.PointerEvents.js";
4
4
  import { off, on } from "./DomEvent.js";
5
5
  import { disableImageDrag, enableImageDrag, getPosition, getScale, getSizedParentNode, setPosition } from "./DomUtil.js";
6
6
  import { Evented } from "../core/Events.js";
7
- //#region src/dom/Draggable.js
7
+ // src/dom/Draggable.js
8
8
  /** @import {MaplairEvent, DragEndEvent} from '../core/Events.js' */
9
9
  /**
10
10
  * Options of `Draggable`.
@@ -77,7 +77,8 @@ var Draggable = class Draggable extends Evented {
77
77
  _onDown(e) {
78
78
  this._moved = false;
79
79
  if (this._element.classList.contains("maplair-zoom-anim")) return;
80
- if (getPointers().length !== 1) {
80
+ const pointers = getPointers().length;
81
+ if (pointers > 1) {
81
82
  if (Draggable._dragging === this) this.finishDrag();
82
83
  return;
83
84
  }
@@ -85,6 +86,7 @@ var Draggable = class Draggable extends Evented {
85
86
  Draggable._dragging = this;
86
87
  disableImageDrag();
87
88
  if (this._moving) return;
89
+ if (!pointers && e.isTrusted) e.target.setPointerCapture(e.pointerId);
88
90
  this.fire("down");
89
91
  const sizedParent = getSizedParentNode(this._element);
90
92
  this._startPoint = new Point(e.clientX, e.clientY);
@@ -154,7 +156,6 @@ var Draggable = class Draggable extends Evented {
154
156
  });
155
157
  }
156
158
  };
157
- //#endregion
158
159
  export { Draggable };
159
160
 
160
161
  //# sourceMappingURL=Draggable.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Draggable.js","names":["PointerEvents.getPointers","DomUtil.getSizedParentNode","DomUtil.getPosition","DomUtil.getScale"],"sources":["../../../src/dom/Draggable.js"],"sourcesContent":["import {Evented} from '../core/Events.js';\nimport * as DomEvent from './DomEvent.js';\nimport * as DomUtil from './DomUtil.js';\nimport * as Util from '../core/Util.js';\nimport {Point} from '../geometry/Point.js';\nimport * as PointerEvents from './DomEvent.PointerEvents.js';\n/** @import {MaplairEvent, DragEndEvent} from '../core/Events.js' */\n\n/**\n * Options of `Draggable`.\n * @typedef {object} DraggableOptions\n * @property {number} [clickTolerance=3] The max number of pixels a user can shift the\n * pointer during a click for it to be considered a valid click (as opposed to a\n * pointer drag).\n */\n\n/**\n * The event object of `dragstart`, `predrag` and `drag` of `Draggable`.\n * @typedef {object} DraggableEvent\n * @property {PointerEvent} originalEvent The DOM event of the pointer which drags.\n * @extends MaplairEvent\n */\n\n/**\n * A class for making DOM elements draggable.\n * Used internally for map and marker dragging. Works on any DOM element.\n *\n * @example\n * ```js\n * const draggable = new Draggable(elementToDrag);\n * draggable.enable();\n * ```\n *\n * @fires down {MaplairEvent} Fired when a drag is about to start.\n * @fires dragstart {DraggableEvent} Fired when a drag starts.\n * @fires predrag {DraggableEvent} Fired continuously during dragging *before* each\n * corresponding update of the element's position.\n * @fires drag {DraggableEvent} Fired continuously during dragging.\n * @fires dragend {DragEndEvent} Fired when the drag ends (with `noInertia: true` if\n * the drag was finished without inertia, e.g. by disabling the draggable).\n */\nexport class Draggable extends Evented {\n\n\tstatic defaultOptions = {\n\t\tclickTolerance: 3\n\t};\n\n\t/**\n\t * Creates a `Draggable` object for moving `element` when you start dragging the\n\t * `dragStartTarget` element (equals `element` itself by default).\n\t * @param {HTMLElement} element\n\t * @param {HTMLElement} [dragStartTarget]\n\t * @param {DraggableOptions} [options]\n\t */\n\tconstructor(element, dragStartTarget, options) {\n\t\tif (typeof options === 'boolean') {\n\t\t\tthrow new Error('Draggable: the preventOutline argument is removed in Maplair. Pass options as the third argument.');\n\t\t}\n\t\tsuper();\n\t\tUtil.setOptions(this, options);\n\n\t\tthis._element = element;\n\t\tthis._dragStartTarget = dragStartTarget ?? element;\n\n\t\tthis.callInitHooks(Draggable);\n\t}\n\n\t/**\n\t * Enables the dragging ability.\n\t * @returns {void}\n\t */\n\tenable() {\n\t\tif (this._enabled) { return; }\n\n\t\tDomEvent.on(this._dragStartTarget, 'pointerdown', this._onDown, this);\n\n\t\tthis._enabled = true;\n\t}\n\n\t/**\n\t * Disables the dragging ability.\n\t * @returns {void}\n\t */\n\tdisable() {\n\t\tif (!this._enabled) { return; }\n\n\t\t// If we're currently dragging this draggable,\n\t\t// disabling it counts as first ending the drag.\n\t\tif (Draggable._dragging === this) {\n\t\t\tthis.finishDrag(true);\n\t\t}\n\n\t\tDomEvent.off(this._dragStartTarget, 'pointerdown', this._onDown, this);\n\n\t\tthis._enabled = false;\n\t\tthis._moved = false;\n\t}\n\n\t_onDown(e) {\n\t\tthis._moved = false;\n\n\t\tif (this._element.classList.contains('maplair-zoom-anim')) { return; }\n\n\t\tif (PointerEvents.getPointers().length !== 1) {\n\t\t\t// Finish dragging to avoid conflict with touchZoom\n\t\t\tif (Draggable._dragging === this) {\n\t\t\t\tthis.finishDrag();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (Draggable._dragging || e.shiftKey || (e.button !== 0 && e.pointerType !== 'touch')) { return; }\n\t\tDraggable._dragging = this; // Prevent dragging multiple objects at once.\n\n\t\tDomUtil.disableImageDrag();\n\n\t\tif (this._moving) { return; }\n\n\t\tthis.fire('down');\n\n\t\tconst sizedParent = DomUtil.getSizedParentNode(this._element);\n\n\t\tthis._startPoint = new Point(e.clientX, e.clientY);\n\t\tthis._startPos = DomUtil.getPosition(this._element);\n\n\t\t// Cache the scale, so that we can continuously compensate for it during drag (_onMove).\n\t\tthis._parentScale = DomUtil.getScale(sizedParent);\n\n\t\tDomEvent.on(this._dragStartTarget, 'pointermove', this._onMove, this);\n\t\tDomEvent.on(this._dragStartTarget, 'pointerup pointercancel lostpointercapture', this._onUp, this);\n\t}\n\n\t_onMove(e) {\n\t\tif (PointerEvents.getPointers().length > 1) {\n\t\t\tthis._moved = true;\n\t\t\treturn;\n\t\t}\n\n\t\tconst offset = new Point(e.clientX, e.clientY)._subtract(this._startPoint);\n\n\t\t// once the drag has started, the pointer must be followed even when it comes back near the start point\n\t\tconst dist = Math.abs(offset.x) + Math.abs(offset.y);\n\t\tif (!this._moved && (!dist || dist < this.options.clickTolerance)) { return; }\n\n\t\t// We assume that the parent container's position, border and scale do not change for the duration of the drag.\n\t\t// Therefore there is no need to account for the position and border (they are eliminated by the subtraction)\n\t\t// and we can use the cached value for the scale.\n\t\toffset.x /= this._parentScale.x;\n\t\toffset.y /= this._parentScale.y;\n\n\t\tif (e.cancelable) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (!this._moved) {\n\t\t\tthis.fire('dragstart', {originalEvent: e});\n\n\t\t\tthis._moved = true;\n\n\t\t\t// on the map container rather than the body, so that toggling it doesn't restyle the whole page\n\t\t\tthis._draggingContainer = this._element.closest('.maplair-container') ?? this._element;\n\t\t\tthis._draggingContainer.classList.add('maplair-dragging');\n\n\t\t\tthis._lastTarget = e.target;\n\t\t\tthis._lastTarget.classList.add('maplair-drag-target');\n\t\t}\n\n\t\tthis._newPos = this._startPos.add(offset);\n\t\tthis._moving = true;\n\n\t\tthis._lastEvent = e;\n\t\tthis._updatePosition();\n\t}\n\n\t_updatePosition() {\n\t\tconst e = {originalEvent: this._lastEvent};\n\n\t\tthis.fire('predrag', e);\n\n\t\t// pointer events can have fractional coordinates; snap them to device pixels, since an edge in the middle of\n\t\t// one is drawn partly transparent on both sides and shows a seam between tiles\n\t\tconst dpr = window.devicePixelRatio;\n\t\tthis._newPos = this._newPos.multiplyBy(dpr)._round()._divideBy(dpr);\n\t\tDomUtil.setPosition(this._element, this._newPos);\n\n\t\tthis.fire('drag', e);\n\t}\n\n\t_onUp(e) {\n\t\t// releasing the button outside the window may fire no pointerup, only a lostpointercapture with no buttons;\n\t\t// capture lost while the button is still held (e.g. the pressed element was removed) shouldn't end the drag\n\t\tif (e.type === 'lostpointercapture' && e.buttons) { return; }\n\t\tthis.finishDrag();\n\t}\n\n\t/**\n\t * Ends the current drag.\n\t * @internal\n\t * @param {boolean} [noInertia]\n\t * @returns {void}\n\t */\n\tfinishDrag(noInertia) {\n\t\tthis._draggingContainer?.classList.remove('maplair-dragging');\n\t\tthis._draggingContainer = null;\n\n\t\tif (this._lastTarget) {\n\t\t\tthis._lastTarget.classList.remove('maplair-drag-target');\n\t\t\tthis._lastTarget = null;\n\t\t}\n\n\t\tDomEvent.off(this._dragStartTarget, 'pointermove', this._onMove, this);\n\t\tDomEvent.off(this._dragStartTarget, 'pointerup pointercancel lostpointercapture', this._onUp, this);\n\n\t\tDomUtil.enableImageDrag();\n\n\t\tconst fireDragend = this._moved && this._moving;\n\n\t\tthis._moving = false;\n\t\tDraggable._dragging = false;\n\n\t\tif (fireDragend) {\n\t\t\tthis.fire('dragend', {\n\t\t\t\tnoInertia,\n\t\t\t\tdistance: this._newPos.distanceTo(this._startPos)\n\t\t\t});\n\t\t}\n\t}\n\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,YAAb,MAAa,kBAAkB,QAAQ;CAEtC,OAAO,iBAAiB,EACvB,gBAAgB,EACjB;;;;;;;;CASA,YAAY,SAAS,iBAAiB,SAAS;EAC9C,IAAI,OAAO,YAAY,WACtB,MAAM,IAAI,MAAM,mGAAmG;EAEpH,MAAM;EACN,WAAgB,MAAM,OAAO;EAE7B,KAAK,WAAW;EAChB,KAAK,mBAAmB,mBAAmB;EAE3C,KAAK,cAAc,SAAS;CAC7B;;;;;CAMA,SAAS;EACR,IAAI,KAAK,UAAY;EAErB,GAAY,KAAK,kBAAkB,eAAe,KAAK,SAAS,IAAI;EAEpE,KAAK,WAAW;CACjB;;;;;CAMA,UAAU;EACT,IAAI,CAAC,K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izedParentNode","DomUtil.getPosition","DomUtil.getScale"],"sources":["../../../src/dom/Draggable.js"],"sourcesContent":["import {Evented} from '../core/Events.js';\nimport * as DomEvent from './DomEvent.js';\nimport * as DomUtil from './DomUtil.js';\nimport * as Util from '../core/Util.js';\nimport {Point} from '../geometry/Point.js';\nimport * as PointerEvents from './DomEvent.PointerEvents.js';\n/** @import {MaplairEvent, DragEndEvent} from '../core/Events.js' */\n\n/**\n * Options of `Draggable`.\n * @typedef {object} DraggableOptions\n * @property {number} [clickTolerance=3] The max number of pixels a user can shift the\n * pointer during a click for it to be considered a valid click (as opposed to a\n * pointer drag).\n */\n\n/**\n * The event object of `dragstart`, `predrag` and `drag` of `Draggable`.\n * @typedef {object} DraggableEvent\n * @property {PointerEvent} originalEvent The DOM event of the pointer which drags.\n * @extends MaplairEvent\n */\n\n/**\n * A class for making DOM elements draggable.\n * Used internally for map and marker dragging. Works on any DOM element.\n *\n * @example\n * ```js\n * const draggable = new Draggable(elementToDrag);\n * draggable.enable();\n * ```\n *\n * @fires down {MaplairEvent} Fired when a drag is about to start.\n * @fires dragstart {DraggableEvent} Fired when a drag starts.\n * @fires predrag {DraggableEvent} Fired continuously during dragging *before* each\n * corresponding update of the element's position.\n * @fires drag {DraggableEvent} Fired continuously during dragging.\n * @fires dragend {DragEndEvent} Fired when the drag ends (with `noInertia: true` if\n * the drag was finished without inertia, e.g. by disabling the draggable).\n */\nexport class Draggable extends Evented {\n\n\tstatic defaultOptions = {\n\t\tclickTolerance: 3\n\t};\n\n\t/**\n\t * Creates a `Draggable` object for moving `element` when you start dragging the\n\t * `dragStartTarget` element (equals `element` itself by default).\n\t * @param {HTMLElement} element\n\t * @param {HTMLElement} [dragStartTarget]\n\t * @param {DraggableOptions} [options]\n\t */\n\tconstructor(element, dragStartTarget, options) {\n\t\tif (typeof options === 'boolean') {\n\t\t\tthrow new Error('Draggable: the preventOutline argument is removed in Maplair. Pass options as the third argument.');\n\t\t}\n\t\tsuper();\n\t\tUtil.setOptions(this, options);\n\n\t\tthis._element = element;\n\t\tthis._dragStartTarget = dragStartTarget ?? element;\n\n\t\tthis.callInitHooks(Draggable);\n\t}\n\n\t/**\n\t * Enables the dragging ability.\n\t * @returns {void}\n\t */\n\tenable() {\n\t\tif (this._enabled) { return; }\n\n\t\tDomEvent.on(this._dragStartTarget, 'pointerdown', this._onDown, this);\n\n\t\tthis._enabled = true;\n\t}\n\n\t/**\n\t * Disables the dragging ability.\n\t * @returns {void}\n\t */\n\tdisable() {\n\t\tif (!this._enabled) { return; }\n\n\t\t// If we're currently dragging this draggable,\n\t\t// disabling it counts as first ending the drag.\n\t\tif (Draggable._dragging === this) {\n\t\t\tthis.finishDrag(true);\n\t\t}\n\n\t\tDomEvent.off(this._dragStartTarget, 'pointerdown', this._onDown, this);\n\n\t\tthis._enabled = false;\n\t\tthis._moved = false;\n\t}\n\n\t_onDown(e) {\n\t\tthis._moved = false;\n\n\t\tif (this._element.classList.contains('maplair-zoom-anim')) { return; }\n\n\t\tconst pointers = PointerEvents.getPointers().length;\n\t\tif (pointers > 1) {\n\t\t\t// Finish dragging to avoid conflict with touchZoom\n\t\t\tif (Draggable._dragging === this) {\n\t\t\t\tthis.finishDrag();\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tif (Draggable._dragging || e.shiftKey || (e.button !== 0 && e.pointerType !== 'touch')) { return; }\n\t\tDraggable._dragging = this; // Prevent dragging multiple objects at once.\n\n\t\tDomUtil.disableImageDrag();\n\n\t\tif (this._moving) { return; }\n\n\t\t// outside a map, nothing tracks pointers or captures them, so capture this one to keep its moves coming\n\t\tif (!pointers && e.isTrusted) { e.target.setPointerCapture(e.pointerId); }\n\n\t\tthis.fire('down');\n\n\t\tconst sizedParent = DomUtil.getSizedParentNode(this._element);\n\n\t\tthis._startPoint = new Point(e.clientX, e.clientY);\n\t\tthis._startPos = DomUtil.getPosition(this._element);\n\n\t\t// Cache the scale, so that we can continuously compensate for it during drag (_onMove).\n\t\tthis._parentScale = DomUtil.getScale(sizedParent);\n\n\t\tDomEvent.on(this._dragStartTarget, 'pointermove', this._onMove, this);\n\t\tDomEvent.on(this._dragStartTarget, 'pointerup pointercancel lostpointercapture', this._onUp, this);\n\t}\n\n\t_onMove(e) {\n\t\tif (PointerEvents.getPointers().length > 1) {\n\t\t\tthis._moved = true;\n\t\t\treturn;\n\t\t}\n\n\t\tconst offset = new Point(e.clientX, e.clientY)._subtract(this._startPoint);\n\n\t\t// once the drag has started, the pointer must be followed even when it comes back near the start point\n\t\tconst dist = Math.abs(offset.x) + Math.abs(offset.y);\n\t\tif (!this._moved && (!dist || dist < this.options.clickTolerance)) { return; }\n\n\t\t// We assume that the parent container's position, border and scale do not change for the duration of the drag.\n\t\t// Therefore there is no need to account for the position and border (they are eliminated by the subtraction)\n\t\t// and we can use the cached value for the scale.\n\t\toffset.x /= this._parentScale.x;\n\t\toffset.y /= this._parentScale.y;\n\n\t\tif (e.cancelable) {\n\t\t\te.preventDefault();\n\t\t}\n\n\t\tif (!this._moved) {\n\t\t\tthis.fire('dragstart', {originalEvent: e});\n\n\t\t\tthis._moved = true;\n\n\t\t\t// on the map container rather than the body, so that toggling it doesn't restyle the whole page\n\t\t\tthis._draggingContainer = this._element.closest('.maplair-container') ?? this._element;\n\t\t\tthis._draggingContainer.classList.add('maplair-dragging');\n\n\t\t\tthis._lastTarget = e.target;\n\t\t\tthis._lastTarget.classList.add('maplair-drag-target');\n\t\t}\n\n\t\tthis._newPos = this._startPos.add(offset);\n\t\tthis._moving = true;\n\n\t\tthis._lastEvent = e;\n\t\tthis._updatePosition();\n\t}\n\n\t_updatePosition() {\n\t\tconst e = {originalEvent: this._lastEvent};\n\n\t\tthis.fire('predrag', e);\n\n\t\t// pointer events can have fractional coordinates; snap them to device pixels, since an edge in the middle of\n\t\t// one is drawn partly transparent on both sides and shows a seam between tiles\n\t\tconst dpr = window.devicePixelRatio;\n\t\tthis._newPos = this._newPos.multiplyBy(dpr)._round()._divideBy(dpr);\n\t\tDomUtil.setPosition(this._element, this._newPos);\n\n\t\tthis.fire('drag', e);\n\t}\n\n\t_onUp(e) {\n\t\t// releasing the button outside the window may fire no pointerup, only a lostpointercapture with no buttons;\n\t\t// capture lost while the button is still held (e.g. the pressed element was removed) shouldn't end the drag\n\t\tif (e.type === 'lostpointercapture' && e.buttons) { return; }\n\t\tthis.finishDrag();\n\t}\n\n\t/**\n\t * Ends the current drag.\n\t * @internal\n\t * @param {boolean} [noInertia]\n\t * @returns {void}\n\t */\n\tfinishDrag(noInertia) {\n\t\tthis._draggingContainer?.classList.remove('maplair-dragging');\n\t\tthis._draggingContainer = null;\n\n\t\tif (this._lastTarget) {\n\t\t\tthis._lastTarget.classList.remove('maplair-drag-target');\n\t\t\tthis._lastTarget = null;\n\t\t}\n\n\t\tDomEvent.off(this._dragStartTarget, 'pointermove', this._onMove, this);\n\t\tDomEvent.off(this._dragStartTarget, 'pointerup pointercancel lostpointercapture', this._onUp, this);\n\n\t\tDomUtil.enableImageDrag();\n\n\t\tconst fireDragend = this._moved && this._moving;\n\n\t\tthis._moving = false;\n\t\tDraggable._dragging = false;\n\n\t\tif (fireDragend) {\n\t\t\tthis.fire('dragend', {\n\t\t\t\tnoInertia,\n\t\t\t\tdistance: this._newPos.distanceTo(this._startPos)\n\t\t\t});\n\t\t}\n\t}\n\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,YAAb,MAAa,kBAAkB,QAAQ;CAEtC,OAAO,iBAAiB,EACvB,gBAAgB,EACjB;;;;;;;;CASA,YAAY,SAAS,iBAAiB,SAAS;EAC9C,IAAI,OAAO,YAAY,WACtB,MAAM,IAAI,MAAM,mGAAmG;EAEpH,MAAM;EACN,WAAgB,MAAM,OAAO;EAE7B,KAAK,WAAW;EAChB,KAAK,mBAAmB,mBAAmB;EAE3C,KAAK,cAAc,SAAS;CAC7B;;;;;CAMA,SAAS;EACR,IAAI,KAAK,UAAY;EAErB,GAAY,KAAK,kBAAkB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UAAU,YAAY;EAEtB,IAAI,aACH,KAAK,KAAK,WAAW;GACpB;GACA,UAAU,KAAK,QAAQ,WAAW,KAAK,SAAS;EACjD,CAAC;CAEH;AAED"}
@@ -1,6 +1,6 @@
1
1
  import { getPosition, setPosition } from "./DomUtil.js";
2
2
  import { Evented } from "../core/Events.js";
3
- //#region src/dom/PosAnimation.js
3
+ // src/dom/PosAnimation.js
4
4
  /** @import {Point} from '../geometry/Point.js' */
5
5
  /** @import {MaplairEvent} from '../core/Events.js' */
6
6
  /**
@@ -76,7 +76,6 @@ var PosAnimation = class PosAnimation extends Evented {
76
76
  return 1 - (1 - t) ** this._easeOutPower;
77
77
  }
78
78
  };
79
- //#endregion
80
79
  export { PosAnimation };
81
80
 
82
81
  //# sourceMappingURL=PosAnimation.js.map
@@ -1,6 +1,6 @@
1
1
  import { formatNum, wrapNum } from "../core/Util.js";
2
2
  import { LatLngBounds } from "./LatLngBounds.js";
3
- //#region src/geo/LatLng.js
3
+ // src/geo/LatLng.js
4
4
  const coordinate = String.raw`([+-]?\d+(?:\.\d+)?)\s*°?`;
5
5
  const separator = String.raw`(?:\s*[,;]\s*|\s+)`;
6
6
  const plainRe = new RegExp(`^${coordinate}${separator}${coordinate}$`);
@@ -220,7 +220,6 @@ function haversineDistance(latlng1, latlng2, R) {
220
220
  const rad = Math.PI / 180, lat1 = latlng1.lat * rad, lat2 = latlng2.lat * rad, sinDLat = Math.sin((latlng2.lat - latlng1.lat) * rad / 2), sinDLon = Math.sin((latlng2.lng - latlng1.lng) * rad / 2), a = sinDLat * sinDLat + Math.cos(lat1) * Math.cos(lat2) * sinDLon * sinDLon;
221
221
  return R * (2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a)));
222
222
  }
223
- //#endregion
224
223
  export { LatLng, haversineDistance };
225
224
 
226
225
  //# sourceMappingURL=LatLng.js.map
@@ -1,5 +1,5 @@
1
1
  import { LatLng } from "./LatLng.js";
2
- //#region src/geo/LatLngBounds.js
2
+ // src/geo/LatLngBounds.js
3
3
  /** @import {LatLngExpression} from './LatLng.js' */
4
4
  /**
5
5
  * A geographical area: a `LatLngBounds`, or an array of geographical points (usually
@@ -79,19 +79,14 @@ var LatLngBounds = class LatLngBounds {
79
79
  extend(obj) {
80
80
  const sw = this._southWest, ne = this._northEast;
81
81
  let sw2, ne2;
82
- if (obj instanceof LatLng) {
83
- sw2 = obj;
84
- ne2 = obj;
85
- } else if (obj instanceof LatLngBounds) {
86
- sw2 = obj._southWest;
87
- ne2 = obj._northEast;
88
- if (!sw2 || !ne2) return this;
89
- } else {
90
- if (!obj) return this;
91
- if (LatLng.validate(obj)) return this.extend(LatLng.from(obj));
92
- return this.extend(LatLngBounds.from(obj));
93
- }
94
- if (!sw && !ne) {
82
+ if (obj instanceof LatLng) sw2 = ne2 = obj;
83
+ else if (obj instanceof LatLngBounds) {
84
+ ({_southWest: sw2, _northEast: ne2} = obj);
85
+ if (!sw2) return this;
86
+ } else if (!obj) return this;
87
+ else if (LatLng.validate(obj)) sw2 = ne2 = LatLng.from(obj);
88
+ else return this.extend(LatLngBounds.from(obj));
89
+ if (!sw) {
95
90
  this._southWest = new LatLng(sw2.lat, sw2.lng);
96
91
  this._northEast = new LatLng(ne2.lat, ne2.lng);
97
92
  } else {
@@ -249,7 +244,6 @@ var LatLngBounds = class LatLngBounds {
249
244
  return !!(this._southWest && this._northEast);
250
245
  }
251
246
  };
252
- //#endregion
253
247
  export { LatLngBounds };
254
248
 
255
249
  //# sourceMappingURL=LatLngBounds.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LatLngBounds.js","names":[],"sources":["../../../src/geo/LatLngBounds.js"],"sourcesContent":["import {LatLng} from './LatLng.js';\n/** @import {LatLngExpression} from './LatLng.js' */\n\n/**\n * A geographical area: a `LatLngBounds`, or an array of geographical points (usually\n * two diagonally opposite corners), e.g. `[[40.712, -74.227], [40.774, -74.125]]`.\n * Accepted by all Maplair methods which accept `LatLngBounds` objects (unless noted\n * otherwise).\n * @typedef {LatLngBounds|LatLngExpression[]} LatLngBoundsExpression\n */\n\n// TODO International date line?\n\n/**\n * Represents a rectangular geographical area on a map.\n *\n * @example\n * ```js\n * const corner1 = new LatLng(40.712, -74.227),\n * corner2 = new LatLng(40.774, -74.125),\n * bounds = new LatLngBounds(corner1, corner2);\n * ```\n *\n * All Maplair methods that accept LatLngBounds objects also accept them in a simple\n * Array form (unless noted otherwise), so the bounds example above can be passed like\n * this:\n *\n * ```js\n * map.fitBounds([\n * \t[40.712, -74.227],\n * \t[40.774, -74.125]\n * ]);\n * ```\n *\n * Caution: if the area crosses the antimeridian (often confused with the International\n * Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.\n *\n * Note that `LatLngBounds` does not inherit from Maplair's `Class` object,\n * which means new classes can't inherit from it, and new methods\n * can't be added to it with the `include` function.\n */\nexport class LatLngBounds {\n\t/**\n\t * Creates a `LatLngBounds` object by defining two diagonally opposite corners of the\n\t * rectangle. Alternatively, creates a `LatLngBounds` object defined by the\n\t * geographical points it contains (very useful for zooming the map to fit a\n\t * particular set of locations with [`fitBounds`](#map-fitbounds)), or a copy of the\n\t * given `LatLngBounds` object.\n\t * @param {LatLngExpression|LatLngBoundsExpression} [corner1] The first corner, the\n\t * points or the bounds to copy.\n\t * @param {LatLngExpression} [corner2] The opposite corner.\n\t */\n\tconstructor(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\n\t\tif (!corner1) { return; }\n\n\t\tif (corner1 instanceof LatLngBounds) {\n\t\t\tif (corner1.isValid()) {\n\t\t\t\tthis._southWest = new LatLng(corner1._southWest);\n\t\t\t\tthis._northEast = new LatLng(corner1._northEast);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst latlngs = corner2 ? [corner1, corner2] : corner1;\n\n\t\tfor (const latlng of latlngs) {\n\t\t\tthis.extend(latlng);\n\t\t}\n\t}\n\n\t/**\n\t * Returns the given `LatLngBounds` object as it is, or else a new `LatLngBounds`\n\t * object created from the given arguments (the same as of the constructor) — unlike\n\t * the constructor, which always creates a new object.\n\t * @param {LatLngExpression|LatLngBoundsExpression} [corner1] The first corner, the\n\t * points or the bounds.\n\t * @param {LatLngExpression} [corner2] The opposite corner.\n\t * @returns {LatLngBounds}\n\t */\n\tstatic from(corner1, corner2) {\n\t\treturn corner1 instanceof LatLngBounds ? corner1 : new LatLngBounds(corner1, corner2);\n\t}\n\n\t/**\n\t * Extend the bounds to contain the given point or bounds.\n\t * @param {LatLngExpression|LatLngBoundsExpression} obj\n\t * @returns {this}\n\t */\n\textend(obj) {\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast;\n\t\tlet sw2, ne2;\n\n\t\tif (obj instanceof LatLng) {\n\t\t\tsw2 = obj;\n\t\t\tne2 = obj;\n\n\t\t} else if (obj instanceof LatLngBounds) {\n\t\t\tsw2 = obj._southWest;\n\t\t\tne2 = obj._northEast;\n\n\t\t\tif (!sw2 || !ne2) { return this; }\n\n\t\t} else {\n\t\t\tif (!obj) {\n\t\t\t\treturn this;\n\t\t\t}\n\t\t\tif (LatLng.validate(obj)) {\n\t\t\t\treturn this.extend(LatLng.from(obj));\n\t\t\t}\n\t\t\treturn this.extend(LatLngBounds.from(obj));\n\t\t}\n\n\t\tif (!sw && !ne) {\n\t\t\tthis._southWest = new LatLng(sw2.lat, sw2.lng);\n\t\t\tthis._northEast = new LatLng(ne2.lat, ne2.lng);\n\t\t} else {\n\t\t\tsw.lat = Math.min(sw2.lat, sw.lat);\n\t\t\tsw.lng = Math.min(sw2.lng, sw.lng);\n\t\t\tne.lat = Math.max(ne2.lat, ne.lat);\n\t\t\tne.lng = Math.max(ne2.lng, ne.lng);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns bounds created by extending or retracting the current bounds by a given\n\t * ratio in each direction. For example, a ratio of 0.5 extends the bounds by 50% in\n\t * each direction. Negative values will retract the bounds.\n\t * @param {number} bufferRatio\n\t * @returns {LatLngBounds}\n\t */\n\tpad(bufferRatio) {\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast,\n\t\theightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\n\t\twidthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\n\n\t\treturn new LatLngBounds(\n\t\t\tnew LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\n\t\t\tnew LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\n\t}\n\n\t/**\n\t * Returns the center point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetCenter() {\n\t\treturn new LatLng(\n\t\t\t(this._southWest.lat + this._northEast.lat) / 2,\n\t\t\t(this._southWest.lng + this._northEast.lng) / 2);\n\t}\n\n\t/**\n\t * Returns the south-west point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetSouthWest() {\n\t\treturn this._southWest;\n\t}\n\n\t/**\n\t * Returns the north-east point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetNorthEast() {\n\t\treturn this._northEast;\n\t}\n\n\t/**\n\t * Returns the north-west point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetNorthWest() {\n\t\treturn new LatLng(this.getNorth(), this.getWest());\n\t}\n\n\t/**\n\t * Returns the south-east point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetSouthEast() {\n\t\treturn new LatLng(this.getSouth(), this.getEast());\n\t}\n\n\t/**\n\t * Returns the west longitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetWest() {\n\t\treturn this._southWest.lng;\n\t}\n\n\t/**\n\t * Returns the south latitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetSouth() {\n\t\treturn this._southWest.lat;\n\t}\n\n\t/**\n\t * Returns the east longitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetEast() {\n\t\treturn this._northEast.lng;\n\t}\n\n\t/**\n\t * Returns the north latitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetNorth() {\n\t\treturn this._northEast.lat;\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle contains the given bounds or point.\n\t * @param {LatLngBoundsExpression|LatLngExpression} obj\n\t * @returns {boolean}\n\t */\n\tcontains(obj) { // (LatLngBounds) or (LatLng) -> Boolean\n\t\tif (LatLng.validate(obj)) {\n\t\t\tobj = LatLng.from(obj);\n\t\t} else {\n\t\t\tobj = LatLngBounds.from(obj);\n\t\t}\n\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast;\n\t\tlet sw2, ne2;\n\n\t\tif (obj instanceof LatLngBounds) {\n\t\t\tsw2 = obj.getSouthWest();\n\t\t\tne2 = obj.getNorthEast();\n\t\t} else {\n\t\t\tsw2 = ne2 = obj;\n\t\t}\n\n\t\treturn (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\n\t\t (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle intersects the given bounds. Two bounds intersect\n\t * if they have at least one point in common.\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {boolean}\n\t */\n\tintersects(bounds) {\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast,\n\t\tsw2 = bounds.getSouthWest(),\n\t\tne2 = bounds.getNorthEast(),\n\n\t\tlatIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\n\t\tlngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\n\n\t\treturn latIntersects && lngIntersects;\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if\n\t * their intersection is an area.\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {boolean}\n\t */\n\toverlaps(bounds) {\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast,\n\t\tsw2 = bounds.getSouthWest(),\n\t\tne2 = bounds.getNorthEast(),\n\n\t\tlatOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\n\t\tlngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\n\n\t\treturn latOverlaps && lngOverlaps;\n\t}\n\n\t/**\n\t * Returns a string with bounding box coordinates in a\n\t * 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for\n\t * sending requests to web services that return geo data.\n\t * @returns {string}\n\t */\n\ttoBBoxString() {\n\t\treturn [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle is equivalent (within a small margin of error) to\n\t * the given bounds. The margin of error can be overridden by setting `maxMargin` to\n\t * a small number.\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {number} [maxMargin]\n\t * @returns {boolean}\n\t */\n\tequals(bounds, maxMargin) {\n\t\tif (!bounds) { return false; }\n\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\treturn this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\n\t\t this._northEast.equals(bounds.getNorthEast(), maxMargin);\n\t}\n\n\t/**\n\t * Returns `true` if the bounds are properly initialized.\n\t * @returns {boolean}\n\t */\n\tisValid() {\n\t\treturn !!(this._southWest && this._northEast);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,eAAb,MAAa,aAAa;;;;;;;;;;;CAWzB,YAAY,SAAS,SAAS;EAC7B,IAAI,CAAC,SAAW;EAEhB,IAAI,mBAAmB,cAAc;GACpC,IAAI,QAAQ,QAAQ,GAAG;IACtB,KAAK,aAAa,IAAI,OAAO,QAAQ,UAAU;IAC/C,KAAK,aAAa,IAAI,OAAO,QAAQ,UAAU;GAChD;GACA;EACD;EAEA,MAAM,UAAU,UAAU,CAAC,SAAS,OAAO,IAAI;EAE/C,KAAK,MAAM,UAAU,SACpB,KAAK,OAAO,MAAM;CAEpB;;;;;;;;;;CAWA,OAAO,KAAK,SAAS,SAAS;EAC7B,OAAO,mBAAmB,eAAe,UAAU,IAAI,aAAa,SAAS,OAAO;CACrF;;;;;;CAOA,OAAO,KAAK;EACX,MAA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E1B,cAAe,IAAI,MAAM,GAAG,OAAS,IAAI,MAAM,GAAG,KAClD,cAAe,IAAI,MAAM,GAAG,OAAS,IAAI,MAAM,GAAG;EAElD,OAAO,eAAe;CACvB;;;;;;;CAQA,eAAe;EACd,OAAO;GAAC,KAAK,QAAQ;GAAG,KAAK,SAAS;GAAG,KAAK,QAAQ;GAAG,KAAK,SAAS;EAAC,CAAC,CAAC,KAAK,GAAG;CACnF;;;;;;;;;CAUA,OAAO,QAAQ,WAAW;EACzB,IAAI,CAAC,QAAU,OAAO;EAEtB,SAAS,aAAa,KAAK,MAAM;EAEjC,OAAO,KAAK,WAAW,OAAO,OAAO,aAAa,GAAG,SAAS,KACvD,KAAK,WAAW,OAAO,OAAO,aAAa,GAAG,SAAS;CAC/D;;;;;CAMA,UAAU;EACT,OAAO,CAAC,EAAE,KAAK,cAAc,KAAK;CACnC;AACD"}
1
+ {"version":3,"file":"LatLngBounds.js","names":[],"sources":["../../../src/geo/LatLngBounds.js"],"sourcesContent":["import {LatLng} from './LatLng.js';\n/** @import {LatLngExpression} from './LatLng.js' */\n\n/**\n * A geographical area: a `LatLngBounds`, or an array of geographical points (usually\n * two diagonally opposite corners), e.g. `[[40.712, -74.227], [40.774, -74.125]]`.\n * Accepted by all Maplair methods which accept `LatLngBounds` objects (unless noted\n * otherwise).\n * @typedef {LatLngBounds|LatLngExpression[]} LatLngBoundsExpression\n */\n\n// TODO International date line?\n\n/**\n * Represents a rectangular geographical area on a map.\n *\n * @example\n * ```js\n * const corner1 = new LatLng(40.712, -74.227),\n * corner2 = new LatLng(40.774, -74.125),\n * bounds = new LatLngBounds(corner1, corner2);\n * ```\n *\n * All Maplair methods that accept LatLngBounds objects also accept them in a simple\n * Array form (unless noted otherwise), so the bounds example above can be passed like\n * this:\n *\n * ```js\n * map.fitBounds([\n * \t[40.712, -74.227],\n * \t[40.774, -74.125]\n * ]);\n * ```\n *\n * Caution: if the area crosses the antimeridian (often confused with the International\n * Date Line), you must specify corners _outside_ the [-180, 180] degrees longitude range.\n *\n * Note that `LatLngBounds` does not inherit from Maplair's `Class` object,\n * which means new classes can't inherit from it, and new methods\n * can't be added to it with the `include` function.\n */\nexport class LatLngBounds {\n\t/**\n\t * Creates a `LatLngBounds` object by defining two diagonally opposite corners of the\n\t * rectangle. Alternatively, creates a `LatLngBounds` object defined by the\n\t * geographical points it contains (very useful for zooming the map to fit a\n\t * particular set of locations with [`fitBounds`](#map-fitbounds)), or a copy of the\n\t * given `LatLngBounds` object.\n\t * @param {LatLngExpression|LatLngBoundsExpression} [corner1] The first corner, the\n\t * points or the bounds to copy.\n\t * @param {LatLngExpression} [corner2] The opposite corner.\n\t */\n\tconstructor(corner1, corner2) { // (LatLng, LatLng) or (LatLng[])\n\t\tif (!corner1) { return; }\n\n\t\tif (corner1 instanceof LatLngBounds) {\n\t\t\tif (corner1.isValid()) {\n\t\t\t\tthis._southWest = new LatLng(corner1._southWest);\n\t\t\t\tthis._northEast = new LatLng(corner1._northEast);\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tconst latlngs = corner2 ? [corner1, corner2] : corner1;\n\n\t\tfor (const latlng of latlngs) {\n\t\t\tthis.extend(latlng);\n\t\t}\n\t}\n\n\t/**\n\t * Returns the given `LatLngBounds` object as it is, or else a new `LatLngBounds`\n\t * object created from the given arguments (the same as of the constructor) — unlike\n\t * the constructor, which always creates a new object.\n\t * @param {LatLngExpression|LatLngBoundsExpression} [corner1] The first corner, the\n\t * points or the bounds.\n\t * @param {LatLngExpression} [corner2] The opposite corner.\n\t * @returns {LatLngBounds}\n\t */\n\tstatic from(corner1, corner2) {\n\t\treturn corner1 instanceof LatLngBounds ? corner1 : new LatLngBounds(corner1, corner2);\n\t}\n\n\t/**\n\t * Extend the bounds to contain the given point or bounds.\n\t * @param {LatLngExpression|LatLngBoundsExpression} obj\n\t * @returns {this}\n\t */\n\textend(obj) {\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast;\n\t\tlet sw2, ne2;\n\n\t\tif (obj instanceof LatLng) {\n\t\t\tsw2 = ne2 = obj;\n\t\t} else if (obj instanceof LatLngBounds) {\n\t\t\t({_southWest: sw2, _northEast: ne2} = obj);\n\t\t\tif (!sw2) { return this; }\n\t\t} else if (!obj) {\n\t\t\treturn this;\n\t\t} else if (LatLng.validate(obj)) {\n\t\t\tsw2 = ne2 = LatLng.from(obj);\n\t\t} else {\n\t\t\treturn this.extend(LatLngBounds.from(obj));\n\t\t}\n\n\t\tif (!sw) {\n\t\t\tthis._southWest = new LatLng(sw2.lat, sw2.lng);\n\t\t\tthis._northEast = new LatLng(ne2.lat, ne2.lng);\n\t\t} else {\n\t\t\tsw.lat = Math.min(sw2.lat, sw.lat);\n\t\t\tsw.lng = Math.min(sw2.lng, sw.lng);\n\t\t\tne.lat = Math.max(ne2.lat, ne.lat);\n\t\t\tne.lng = Math.max(ne2.lng, ne.lng);\n\t\t}\n\n\t\treturn this;\n\t}\n\n\t/**\n\t * Returns bounds created by extending or retracting the current bounds by a given\n\t * ratio in each direction. For example, a ratio of 0.5 extends the bounds by 50% in\n\t * each direction. Negative values will retract the bounds.\n\t * @param {number} bufferRatio\n\t * @returns {LatLngBounds}\n\t */\n\tpad(bufferRatio) {\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast,\n\t\theightBuffer = Math.abs(sw.lat - ne.lat) * bufferRatio,\n\t\twidthBuffer = Math.abs(sw.lng - ne.lng) * bufferRatio;\n\n\t\treturn new LatLngBounds(\n\t\t\tnew LatLng(sw.lat - heightBuffer, sw.lng - widthBuffer),\n\t\t\tnew LatLng(ne.lat + heightBuffer, ne.lng + widthBuffer));\n\t}\n\n\t/**\n\t * Returns the center point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetCenter() {\n\t\treturn new LatLng(\n\t\t\t(this._southWest.lat + this._northEast.lat) / 2,\n\t\t\t(this._southWest.lng + this._northEast.lng) / 2);\n\t}\n\n\t/**\n\t * Returns the south-west point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetSouthWest() {\n\t\treturn this._southWest;\n\t}\n\n\t/**\n\t * Returns the north-east point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetNorthEast() {\n\t\treturn this._northEast;\n\t}\n\n\t/**\n\t * Returns the north-west point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetNorthWest() {\n\t\treturn new LatLng(this.getNorth(), this.getWest());\n\t}\n\n\t/**\n\t * Returns the south-east point of the bounds.\n\t * @returns {LatLng}\n\t */\n\tgetSouthEast() {\n\t\treturn new LatLng(this.getSouth(), this.getEast());\n\t}\n\n\t/**\n\t * Returns the west longitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetWest() {\n\t\treturn this._southWest.lng;\n\t}\n\n\t/**\n\t * Returns the south latitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetSouth() {\n\t\treturn this._southWest.lat;\n\t}\n\n\t/**\n\t * Returns the east longitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetEast() {\n\t\treturn this._northEast.lng;\n\t}\n\n\t/**\n\t * Returns the north latitude of the bounds.\n\t * @returns {number}\n\t */\n\tgetNorth() {\n\t\treturn this._northEast.lat;\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle contains the given bounds or point.\n\t * @param {LatLngBoundsExpression|LatLngExpression} obj\n\t * @returns {boolean}\n\t */\n\tcontains(obj) { // (LatLngBounds) or (LatLng) -> Boolean\n\t\tif (LatLng.validate(obj)) {\n\t\t\tobj = LatLng.from(obj);\n\t\t} else {\n\t\t\tobj = LatLngBounds.from(obj);\n\t\t}\n\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast;\n\t\tlet sw2, ne2;\n\n\t\tif (obj instanceof LatLngBounds) {\n\t\t\tsw2 = obj.getSouthWest();\n\t\t\tne2 = obj.getNorthEast();\n\t\t} else {\n\t\t\tsw2 = ne2 = obj;\n\t\t}\n\n\t\treturn (sw2.lat >= sw.lat) && (ne2.lat <= ne.lat) &&\n\t\t (sw2.lng >= sw.lng) && (ne2.lng <= ne.lng);\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle intersects the given bounds. Two bounds intersect\n\t * if they have at least one point in common.\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {boolean}\n\t */\n\tintersects(bounds) {\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast,\n\t\tsw2 = bounds.getSouthWest(),\n\t\tne2 = bounds.getNorthEast(),\n\n\t\tlatIntersects = (ne2.lat >= sw.lat) && (sw2.lat <= ne.lat),\n\t\tlngIntersects = (ne2.lng >= sw.lng) && (sw2.lng <= ne.lng);\n\n\t\treturn latIntersects && lngIntersects;\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle overlaps the given bounds. Two bounds overlap if\n\t * their intersection is an area.\n\t * @param {LatLngBoundsExpression} bounds\n\t * @returns {boolean}\n\t */\n\toverlaps(bounds) {\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\tconst sw = this._southWest,\n\t\tne = this._northEast,\n\t\tsw2 = bounds.getSouthWest(),\n\t\tne2 = bounds.getNorthEast(),\n\n\t\tlatOverlaps = (ne2.lat > sw.lat) && (sw2.lat < ne.lat),\n\t\tlngOverlaps = (ne2.lng > sw.lng) && (sw2.lng < ne.lng);\n\n\t\treturn latOverlaps && lngOverlaps;\n\t}\n\n\t/**\n\t * Returns a string with bounding box coordinates in a\n\t * 'southwest_lng,southwest_lat,northeast_lng,northeast_lat' format. Useful for\n\t * sending requests to web services that return geo data.\n\t * @returns {string}\n\t */\n\ttoBBoxString() {\n\t\treturn [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(',');\n\t}\n\n\t/**\n\t * Returns `true` if the rectangle is equivalent (within a small margin of error) to\n\t * the given bounds. The margin of error can be overridden by setting `maxMargin` to\n\t * a small number.\n\t * @param {LatLngBoundsExpression} bounds\n\t * @param {number} [maxMargin]\n\t * @returns {boolean}\n\t */\n\tequals(bounds, maxMargin) {\n\t\tif (!bounds) { return false; }\n\n\t\tbounds = LatLngBounds.from(bounds);\n\n\t\treturn this._southWest.equals(bounds.getSouthWest(), maxMargin) &&\n\t\t this._northEast.equals(bounds.getNorthEast(), maxMargin);\n\t}\n\n\t/**\n\t * Returns `true` if the bounds are properly initialized.\n\t * @returns {boolean}\n\t */\n\tisValid() {\n\t\treturn !!(this._southWest && this._northEast);\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,eAAb,MAAa,aAAa;;;;;;;;;;;CAWzB,YAAY,SAAS,SAAS;EAC7B,IAAI,CAAC,SAAW;EAEhB,IAAI,mBAAmB,cAAc;GACpC,IAAI,QAAQ,QAAQ,GAAG;IACtB,KAAK,aAAa,IAAI,OAAO,QAAQ,UAAU;IAC/C,KAAK,aAAa,IAAI,OAAO,QAAQ,UAAU;GAChD;GACA;EACD;EAEA,MAAM,UAAU,UAAU,CAAC,SAAS,OAAO,IAAI;EAE/C,KAAK,MAAM,UAAU,SACpB,KAAK,OAAO,MAAM;CAEpB;;;;;;;;;;CAWA,OAAO,KAAK,SAAS,SAAS;EAC7B,OAAO,mBAAmB,eAAe,UAAU,IAAI,aAAa,SAAS,OAAO;CACrF;;;;;;CAOA,OAAO,KAAK;EACX,MAAM,KAAK,KAAK,YAChB,KAAK,KAAK;EACV,IAAI,KAAK;EAET,IAAI,eAAe,QAClB,MAAM,MAAM;OACN,IAAI,eAAe,cAAc;GACvC,CAAC,CAAC,YAAY,KAAK,YAAY,OAAO;GACtC,IAAI,CAAC,KAAO,OAAO;EACpB,OAAO,IAAI,CAAC,KACX,OAAO;OACD,IAAI,OAAO,SAAS,GAAG,GAC7B,MAAM,MAAM,OAAO,KAAK,GAAG;OAE3B,OAAO,KAAK,OAAO,aAAa,KAAK,GAAG,CAAC;EAG1C,IAAI,CAAC,IAAI;GACR,KAAK,aAAa,IAAI,OAAO,IAAI,KAAK,IAAI,GAAG;GAC7C,KAAK,aAAa,IAAI,OAAO,IAAI,KAAK,IAAI,GAAG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,cAAc,KAAK;CACnC;AACD"}
@@ -2,7 +2,7 @@ import { wrapNum } from "../../core/Util.js";
2
2
  import { Bounds } from "../../geometry/Bounds.js";
3
3
  import { LatLngBounds } from "../LatLngBounds.js";
4
4
  import { LatLng } from "../LatLng.js";
5
- //#region src/geo/crs/CRS.js
5
+ // src/geo/crs/CRS.js
6
6
  /** @import {LatLngExpression} from '../LatLng.js' */
7
7
  /** @import {LatLngBoundsExpression} from '../LatLngBounds.js' */
8
8
  /** @import {Point} from '../../geometry/Point.js' */
@@ -146,7 +146,6 @@ var CRS = class {
146
146
  return new LatLngBounds(newSw, newNe);
147
147
  }
148
148
  };
149
- //#endregion
150
149
  export { CRS };
151
150
 
152
151
  //# sourceMappingURL=CRS.js.map
@@ -1,7 +1,7 @@
1
1
  import { EarthCRS } from "./EarthCRS.js";
2
2
  import { Transformation } from "../../geometry/Transformation.js";
3
- import { Mercator } from "../projection/Projection.Mercator.js";
4
- //#region src/geo/crs/EPSG3395.js
3
+ import { MercatorProjection } from "../projection/MercatorProjection.js";
4
+ // src/geo/crs/EPSG3395.js
5
5
  /** @import {Projection} from '../projection/index.js' */
6
6
  /**
7
7
  * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.
@@ -10,14 +10,13 @@ var EPSG3395 = class extends EarthCRS {
10
10
  /** @type {string} */
11
11
  static code = "EPSG:3395";
12
12
  /** @type {Projection} */
13
- static projection = Mercator;
13
+ static projection = MercatorProjection;
14
14
  /** @type {Transformation} */
15
15
  static transformation = /* @__PURE__ */ (() => {
16
- const scale = .5 / (Math.PI * Mercator.R);
16
+ const scale = .5 / (Math.PI * MercatorProjection.R);
17
17
  return new Transformation(scale, .5, -scale, .5);
18
18
  })();
19
19
  };
20
- //#endregion
21
20
  export { EPSG3395 };
22
21
 
23
22
  //# sourceMappingURL=EPSG3395.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EPSG3395.js","names":[],"sources":["../../../../src/geo/crs/EPSG3395.js"],"sourcesContent":["import {EarthCRS} from './EarthCRS.js';\nimport {Mercator} from '../projection/Projection.Mercator.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.\n */\nexport class EPSG3395 extends EarthCRS {\n\t/** @type {string} */\n\tstatic code = 'EPSG:3395';\n\t/** @type {Projection} */\n\tstatic projection = Mercator;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ (() => {\n\t\tconst scale = 0.5 / (Math.PI * Mercator.R);\n\t\treturn new Transformation(scale, 0.5, -scale, 0.5);\n\t})();\n}\n"],"mappings":";;;;;;;;AAQA,IAAa,WAAb,cAA8B,SAAS;;CAEtC,OAAO,OAAO;;CAEd,OAAO,aAAa;;CAEpB,OAAO,iBAAiC,uBAAO;EAC9C,MAAM,QAAQ,MAAO,KAAK,KAAK,SAAS;EACxC,OAAO,IAAI,eAAe,OAAO,IAAK,CAAC,OAAO,EAAG;CAClD,EAAA,CAAG;AACJ"}
1
+ {"version":3,"file":"EPSG3395.js","names":[],"sources":["../../../../src/geo/crs/EPSG3395.js"],"sourcesContent":["import {EarthCRS} from './EarthCRS.js';\nimport {MercatorProjection} from '../projection/MercatorProjection.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * Rarely used by some commercial tile providers. Uses Elliptical Mercator projection.\n */\nexport class EPSG3395 extends EarthCRS {\n\t/** @type {string} */\n\tstatic code = 'EPSG:3395';\n\t/** @type {Projection} */\n\tstatic projection = MercatorProjection;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ (() => {\n\t\tconst scale = 0.5 / (Math.PI * MercatorProjection.R);\n\t\treturn new Transformation(scale, 0.5, -scale, 0.5);\n\t})();\n}\n"],"mappings":";;;;;;;;AAQA,IAAa,WAAb,cAA8B,SAAS;;CAEtC,OAAO,OAAO;;CAEd,OAAO,aAAa;;CAEpB,OAAO,iBAAiC,uBAAO;EAC9C,MAAM,QAAQ,MAAO,KAAK,KAAK,mBAAmB;EAClD,OAAO,IAAI,eAAe,OAAO,IAAK,CAAC,OAAO,EAAG;CAClD,EAAA,CAAG;AACJ"}
@@ -1,7 +1,7 @@
1
1
  import { EarthCRS } from "./EarthCRS.js";
2
- import { SphericalMercator } from "../projection/Projection.SphericalMercator.js";
2
+ import { SphericalMercatorProjection } from "../projection/SphericalMercatorProjection.js";
3
3
  import { Transformation } from "../../geometry/Transformation.js";
4
- //#region src/geo/crs/EPSG3857.js
4
+ // src/geo/crs/EPSG3857.js
5
5
  /** @import {Projection} from '../projection/index.js' */
6
6
  /**
7
7
  * The most common CRS for online maps, used by almost all free and commercial
@@ -12,10 +12,10 @@ var EPSG3857 = class extends EarthCRS {
12
12
  /** @type {string} */
13
13
  static code = "EPSG:3857";
14
14
  /** @type {Projection} */
15
- static projection = SphericalMercator;
15
+ static projection = SphericalMercatorProjection;
16
16
  /** @type {Transformation} */
17
17
  static transformation = /* @__PURE__ */ (() => {
18
- const scale = .5 / (Math.PI * SphericalMercator.R);
18
+ const scale = .5 / (Math.PI * SphericalMercatorProjection.R);
19
19
  return new Transformation(scale, .5, -scale, .5);
20
20
  })();
21
21
  };
@@ -26,7 +26,6 @@ var EPSG900913 = class extends EPSG3857 {
26
26
  /** @type {string} */
27
27
  static code = "EPSG:900913";
28
28
  };
29
- //#endregion
30
29
  export { EPSG3857, EPSG900913 };
31
30
 
32
31
  //# sourceMappingURL=EPSG3857.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EPSG3857.js","names":[],"sources":["../../../../src/geo/crs/EPSG3857.js"],"sourcesContent":["import {EarthCRS} from './EarthCRS.js';\nimport {SphericalMercator} from '../projection/Projection.SphericalMercator.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * The most common CRS for online maps, used by almost all free and commercial\n * tile providers. Uses Spherical Mercator projection. Set in by default in\n * Map's `crs` option.\n */\nexport class EPSG3857 extends EarthCRS {\n\t/** @type {string} */\n\tstatic code = 'EPSG:3857';\n\t/** @type {Projection} */\n\tstatic projection = SphericalMercator;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ (() => {\n\t\tconst scale = 0.5 / (Math.PI * SphericalMercator.R);\n\t\treturn new Transformation(scale, 0.5, -scale, 0.5);\n\t})();\n}\n\n/**\n * The same as `EPSG3857`, with its former unofficial code `EPSG:900913`.\n */\nexport class EPSG900913 extends EPSG3857 {\n\t/** @type {string} */\n\tstatic code = 'EPSG:900913';\n}\n"],"mappings":";;;;;;;;;;AAUA,IAAa,WAAb,cAA8B,SAAS;;CAEtC,OAAO,OAAO;;CAEd,OAAO,aAAa;;CAEpB,OAAO,iBAAiC,uBAAO;EAC9C,MAAM,QAAQ,MAAO,KAAK,KAAK,kBAAkB;EACjD,OAAO,IAAI,eAAe,OAAO,IAAK,CAAC,OAAO,EAAG;CAClD,EAAA,CAAG;AACJ;;;;AAKA,IAAa,aAAb,cAAgC,SAAS;;CAExC,OAAO,OAAO;AACf"}
1
+ {"version":3,"file":"EPSG3857.js","names":[],"sources":["../../../../src/geo/crs/EPSG3857.js"],"sourcesContent":["import {EarthCRS} from './EarthCRS.js';\nimport {SphericalMercatorProjection} from '../projection/SphericalMercatorProjection.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * The most common CRS for online maps, used by almost all free and commercial\n * tile providers. Uses Spherical Mercator projection. Set in by default in\n * Map's `crs` option.\n */\nexport class EPSG3857 extends EarthCRS {\n\t/** @type {string} */\n\tstatic code = 'EPSG:3857';\n\t/** @type {Projection} */\n\tstatic projection = SphericalMercatorProjection;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ (() => {\n\t\tconst scale = 0.5 / (Math.PI * SphericalMercatorProjection.R);\n\t\treturn new Transformation(scale, 0.5, -scale, 0.5);\n\t})();\n}\n\n/**\n * The same as `EPSG3857`, with its former unofficial code `EPSG:900913`.\n */\nexport class EPSG900913 extends EPSG3857 {\n\t/** @type {string} */\n\tstatic code = 'EPSG:900913';\n}\n"],"mappings":";;;;;;;;;;AAUA,IAAa,WAAb,cAA8B,SAAS;;CAEtC,OAAO,OAAO;;CAEd,OAAO,aAAa;;CAEpB,OAAO,iBAAiC,uBAAO;EAC9C,MAAM,QAAQ,MAAO,KAAK,KAAK,4BAA4B;EAC3D,OAAO,IAAI,eAAe,OAAO,IAAK,CAAC,OAAO,EAAG;CAClD,EAAA,CAAG;AACJ;;;;AAKA,IAAa,aAAb,cAAgC,SAAS;;CAExC,OAAO,OAAO;AACf"}
@@ -1,7 +1,7 @@
1
1
  import { EarthCRS } from "./EarthCRS.js";
2
2
  import { Transformation } from "../../geometry/Transformation.js";
3
- import { LonLat } from "../projection/Projection.LonLat.js";
4
- //#region src/geo/crs/EPSG4326.js
3
+ import { LonLatProjection } from "../projection/LonLatProjection.js";
4
+ // src/geo/crs/EPSG4326.js
5
5
  /** @import {Projection} from '../projection/index.js' */
6
6
  /**
7
7
  * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.
@@ -17,11 +17,10 @@ var EPSG4326 = class extends EarthCRS {
17
17
  /** @type {string} */
18
18
  static code = "EPSG:4326";
19
19
  /** @type {Projection} */
20
- static projection = LonLat;
20
+ static projection = LonLatProjection;
21
21
  /** @type {Transformation} */
22
22
  static transformation = /* @__PURE__ */ new Transformation(1 / 180, 1, -1 / 180, .5);
23
23
  };
24
- //#endregion
25
24
  export { EPSG4326 };
26
25
 
27
26
  //# sourceMappingURL=EPSG4326.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EPSG4326.js","names":[],"sources":["../../../../src/geo/crs/EPSG4326.js"],"sourcesContent":["import {EarthCRS} from './EarthCRS.js';\nimport {LonLat} from '../projection/Projection.LonLat.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.\n *\n * Maplair complies with the\n * [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic).\n * If you are using a `TileLayer` with this CRS, ensure that there are two 256x256\n * pixel tiles covering the whole earth at zoom level zero, and that the tile\n * coordinate origin is (-180,+90), or (-180,-90) for `TileLayer`s with\n * [the `tms` option](#tilelayer-tms) set.\n */\nexport class EPSG4326 extends EarthCRS {\n\t/** @type {string} */\n\tstatic code = 'EPSG:4326';\n\t/** @type {Projection} */\n\tstatic projection = LonLat;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ new Transformation(1 / 180, 1, -1 / 180, 0.5);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA,IAAa,WAAb,cAA8B,SAAS;;CAEtC,OAAO,OAAO;;CAEd,OAAO,aAAa;;CAEpB,OAAO,iCAAiC,IAAI,eAAe,IAAI,KAAK,GAAG,KAAK,KAAK,EAAG;AACrF"}
1
+ {"version":3,"file":"EPSG4326.js","names":[],"sources":["../../../../src/geo/crs/EPSG4326.js"],"sourcesContent":["import {EarthCRS} from './EarthCRS.js';\nimport {LonLatProjection} from '../projection/LonLatProjection.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * A common CRS among GIS enthusiasts. Uses simple Equirectangular projection.\n *\n * Maplair complies with the\n * [TMS coordinate scheme for EPSG:4326](https://wiki.osgeo.org/wiki/Tile_Map_Service_Specification#global-geodetic).\n * If you are using a `TileLayer` with this CRS, ensure that there are two 256x256\n * pixel tiles covering the whole earth at zoom level zero, and that the tile\n * coordinate origin is (-180,+90), or (-180,-90) for `TileLayer`s with\n * [the `tms` option](#tilelayer-tms) set.\n */\nexport class EPSG4326 extends EarthCRS {\n\t/** @type {string} */\n\tstatic code = 'EPSG:4326';\n\t/** @type {Projection} */\n\tstatic projection = LonLatProjection;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ new Transformation(1 / 180, 1, -1 / 180, 0.5);\n}\n"],"mappings":";;;;;;;;;;;;;;;AAeA,IAAa,WAAb,cAA8B,SAAS;;CAEtC,OAAO,OAAO;;CAEd,OAAO,aAAa;;CAEpB,OAAO,iCAAiC,IAAI,eAAe,IAAI,KAAK,GAAG,KAAK,KAAK,EAAG;AACrF"}
@@ -1,6 +1,6 @@
1
1
  import { haversineDistance } from "../LatLng.js";
2
2
  import { CRS } from "./CRS.js";
3
- //#region src/geo/crs/EarthCRS.js
3
+ // src/geo/crs/EarthCRS.js
4
4
  /** @import {LatLng} from '../LatLng.js' */
5
5
  /**
6
6
  * Serves as the base for CRS that are global such that they cover the earth.
@@ -32,7 +32,6 @@ var EarthCRS = class extends CRS {
32
32
  return haversineDistance(latlng1, latlng2, this.R);
33
33
  }
34
34
  };
35
- //#endregion
36
35
  export { EarthCRS };
37
36
 
38
37
  //# sourceMappingURL=EarthCRS.js.map
@@ -1,7 +1,7 @@
1
1
  import { CRS } from "./CRS.js";
2
2
  import { Transformation } from "../../geometry/Transformation.js";
3
- import { LonLat } from "../projection/Projection.LonLat.js";
4
- //#region src/geo/crs/SimpleCRS.js
3
+ import { LonLatProjection } from "../projection/LonLatProjection.js";
4
+ // src/geo/crs/SimpleCRS.js
5
5
  /** @import {LatLng} from '../LatLng.js' */
6
6
  /** @import {Projection} from '../projection/index.js' */
7
7
  /**
@@ -12,7 +12,7 @@ import { LonLat } from "../projection/Projection.LonLat.js";
12
12
  */
13
13
  var SimpleCRS = class extends CRS {
14
14
  /** @type {Projection} */
15
- static projection = LonLat;
15
+ static projection = LonLatProjection;
16
16
  /** @type {Transformation} */
17
17
  static transformation = /* @__PURE__ */ new Transformation(1, 0, -1, 0);
18
18
  /**
@@ -44,7 +44,6 @@ var SimpleCRS = class extends CRS {
44
44
  /** @type {boolean} */
45
45
  static infinite = true;
46
46
  };
47
- //#endregion
48
47
  export { SimpleCRS };
49
48
 
50
49
  //# sourceMappingURL=SimpleCRS.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SimpleCRS.js","names":[],"sources":["../../../../src/geo/crs/SimpleCRS.js"],"sourcesContent":["import {CRS} from './CRS.js';\nimport {LonLat} from '../projection/Projection.LonLat.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {LatLng} from '../LatLng.js' */\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * A simple CRS that maps longitude and latitude into `x` and `y` directly.\n * May be used for maps of flat surfaces (e.g. game maps). Note that the `y`\n * axis should still be inverted (going from bottom to top). `distance()` returns\n * simple euclidean distance.\n */\nexport class SimpleCRS extends CRS {\n\t/** @type {Projection} */\n\tstatic projection = LonLat;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ new Transformation(1, 0, -1, 0);\n\n\t/**\n\t * Returns `2^zoom`.\n\t * @param {number} zoom\n\t * @returns {number}\n\t */\n\tstatic scale(zoom) {\n\t\treturn 2 ** zoom;\n\t}\n\n\t/**\n\t * Inverse of `scale()`.\n\t * @param {number} scale\n\t * @returns {number}\n\t */\n\tstatic zoom(scale) {\n\t\treturn Math.log(scale) / Math.LN2;\n\t}\n\n\t/**\n\t * Returns the euclidean distance between two points.\n\t * @param {LatLng} latlng1\n\t * @param {LatLng} latlng2\n\t * @returns {number}\n\t */\n\tstatic distance(latlng1, latlng2) {\n\t\tconst dx = latlng2.lng - latlng1.lng,\n\t\tdy = latlng2.lat - latlng1.lat;\n\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t}\n\n\t/** @type {boolean} */\n\tstatic infinite = true;\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,YAAb,cAA+B,IAAI;;CAElC,OAAO,aAAa;;CAEpB,OAAO,iCAAiC,IAAI,eAAe,GAAG,GAAG,IAAI,CAAC;;;;;;CAOtE,OAAO,MAAM,MAAM;EAClB,OAAO,KAAK;CACb;;;;;;CAOA,OAAO,KAAK,OAAO;EAClB,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK;CAC/B;;;;;;;CAQA,OAAO,SAAS,SAAS,SAAS;EACjC,MAAM,KAAK,QAAQ,MAAM,QAAQ,KACjC,KAAK,QAAQ,MAAM,QAAQ;EAE3B,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK,EAAE;CACnC;;CAGA,OAAO,WAAW;AACnB"}
1
+ {"version":3,"file":"SimpleCRS.js","names":[],"sources":["../../../../src/geo/crs/SimpleCRS.js"],"sourcesContent":["import {CRS} from './CRS.js';\nimport {LonLatProjection} from '../projection/LonLatProjection.js';\nimport {Transformation} from '../../geometry/Transformation.js';\n/** @import {LatLng} from '../LatLng.js' */\n/** @import {Projection} from '../projection/index.js' */\n\n/**\n * A simple CRS that maps longitude and latitude into `x` and `y` directly.\n * May be used for maps of flat surfaces (e.g. game maps). Note that the `y`\n * axis should still be inverted (going from bottom to top). `distance()` returns\n * simple euclidean distance.\n */\nexport class SimpleCRS extends CRS {\n\t/** @type {Projection} */\n\tstatic projection = LonLatProjection;\n\t/** @type {Transformation} */\n\tstatic transformation = /* @__PURE__ */ new Transformation(1, 0, -1, 0);\n\n\t/**\n\t * Returns `2^zoom`.\n\t * @param {number} zoom\n\t * @returns {number}\n\t */\n\tstatic scale(zoom) {\n\t\treturn 2 ** zoom;\n\t}\n\n\t/**\n\t * Inverse of `scale()`.\n\t * @param {number} scale\n\t * @returns {number}\n\t */\n\tstatic zoom(scale) {\n\t\treturn Math.log(scale) / Math.LN2;\n\t}\n\n\t/**\n\t * Returns the euclidean distance between two points.\n\t * @param {LatLng} latlng1\n\t * @param {LatLng} latlng2\n\t * @returns {number}\n\t */\n\tstatic distance(latlng1, latlng2) {\n\t\tconst dx = latlng2.lng - latlng1.lng,\n\t\tdy = latlng2.lat - latlng1.lat;\n\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\t}\n\n\t/** @type {boolean} */\n\tstatic infinite = true;\n}\n"],"mappings":";;;;;;;;;;;;AAYA,IAAa,YAAb,cAA+B,IAAI;;CAElC,OAAO,aAAa;;CAEpB,OAAO,iCAAiC,IAAI,eAAe,GAAG,GAAG,IAAI,CAAC;;;;;;CAOtE,OAAO,MAAM,MAAM;EAClB,OAAO,KAAK;CACb;;;;;;CAOA,OAAO,KAAK,OAAO;EAClB,OAAO,KAAK,IAAI,KAAK,IAAI,KAAK;CAC/B;;;;;;;CAQA,OAAO,SAAS,SAAS,SAAS;EACjC,MAAM,KAAK,QAAQ,MAAM,QAAQ,KACjC,KAAK,QAAQ,MAAM,QAAQ;EAE3B,OAAO,KAAK,KAAK,KAAK,KAAK,KAAK,EAAE;CACnC;;CAGA,OAAO,WAAW;AACnB"}