@accelint/map-toolkit 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +3 -0
  3. package/catalog-info.yaml +4 -3
  4. package/dist/_virtual/rolldown_runtime.js +22 -0
  5. package/dist/camera/events.d.ts +15 -0
  6. package/dist/camera/events.js +29 -0
  7. package/dist/camera/events.js.map +1 -0
  8. package/dist/camera/index.d.ts +16 -0
  9. package/dist/camera/index.js +17 -0
  10. package/dist/camera/types.d.ts +84 -0
  11. package/dist/camera/types.js +12 -0
  12. package/dist/camera/use-camera-state.d.ts +153 -0
  13. package/dist/camera/use-camera-state.js +419 -0
  14. package/dist/camera/use-camera-state.js.map +1 -0
  15. package/dist/cursor-coordinates/use-cursor-coordinates.js +1 -1
  16. package/dist/deckgl/base-map/constants.d.ts +6 -1
  17. package/dist/deckgl/base-map/constants.js +6 -1
  18. package/dist/deckgl/base-map/constants.js.map +1 -1
  19. package/dist/deckgl/base-map/controls.d.ts +34 -0
  20. package/dist/deckgl/base-map/controls.js +50 -0
  21. package/dist/deckgl/base-map/controls.js.map +1 -0
  22. package/dist/deckgl/base-map/events.d.ts +4 -0
  23. package/dist/deckgl/base-map/events.js +5 -1
  24. package/dist/deckgl/base-map/events.js.map +1 -1
  25. package/dist/deckgl/base-map/index.d.ts +6 -21
  26. package/dist/deckgl/base-map/index.js +82 -42
  27. package/dist/deckgl/base-map/index.js.map +1 -1
  28. package/dist/deckgl/base-map/types.d.ts +43 -2
  29. package/dist/deckgl/index.d.ts +5 -4
  30. package/dist/deckgl/index.js +2 -1
  31. package/dist/deckgl/saved-viewports/index.d.ts +32 -0
  32. package/dist/deckgl/saved-viewports/index.js +52 -0
  33. package/dist/deckgl/saved-viewports/index.js.map +1 -0
  34. package/dist/deckgl/saved-viewports/storage.d.ts +21 -0
  35. package/dist/deckgl/saved-viewports/storage.js +39 -0
  36. package/dist/deckgl/saved-viewports/storage.js.map +1 -0
  37. package/dist/maplibre/hooks/use-maplibre.d.ts +2 -2
  38. package/dist/maplibre/hooks/use-maplibre.js +2 -2
  39. package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
  40. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js +21 -0
  41. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js.map +1 -0
  42. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js +63 -0
  43. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js.map +1 -0
  44. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fly-to-viewport.js +14 -0
  45. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js +20 -0
  46. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js.map +1 -0
  47. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/index.js +19 -0
  48. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js +25 -0
  49. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js.map +1 -0
  50. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/normalize-viewport-props.js +14 -0
  51. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-utils.js +59 -0
  52. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-utils.js.map +1 -0
  53. package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-viewport.js +16 -0
  54. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js +29 -0
  55. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js.map +1 -0
  56. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js +29 -0
  57. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js.map +1 -0
  58. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js +54 -0
  59. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js.map +1 -0
  60. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/layer.js +15 -0
  61. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js +29 -0
  62. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js.map +1 -0
  63. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/map.js +91 -0
  64. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/map.js.map +1 -0
  65. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/marker.js +88 -0
  66. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/marker.js.map +1 -0
  67. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js +29 -0
  68. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/navigation-control.js.map +1 -0
  69. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/popup.js +69 -0
  70. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/popup.js.map +1 -0
  71. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/scale-control.js +35 -0
  72. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/scale-control.js.map +1 -0
  73. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/source.js +15 -0
  74. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/terrain-control.js +29 -0
  75. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/terrain-control.js.map +1 -0
  76. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js +40 -0
  77. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-control.js.map +1 -0
  78. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js +23 -0
  79. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/use-map.js.map +1 -0
  80. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/index.js +27 -0
  81. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js +57 -0
  82. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/create-ref.js.map +1 -0
  83. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js +343 -0
  84. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/maplibre/maplibre.js.map +1 -0
  85. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js +28 -0
  86. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/apply-react-style.js.map +1 -0
  87. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js +31 -0
  88. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/compare-class-names.js.map +1 -0
  89. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js +57 -0
  90. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/deep-equal.js.map +1 -0
  91. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js +30 -0
  92. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/set-globals.js.map +1 -0
  93. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js +53 -0
  94. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/style-utils.js.map +1 -0
  95. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js +52 -0
  96. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/transform.js.map +1 -0
  97. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js +22 -0
  98. package/dist/node_modules/.pnpm/@vis.gl_react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/utils/use-isomorphic-layout-effect.js.map +1 -0
  99. package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js +812 -0
  100. package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js.map +1 -0
  101. package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js +35 -0
  102. package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js.map +1 -0
  103. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.development.js +195 -0
  104. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.development.js.map +1 -0
  105. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js +76 -0
  106. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/cjs/react-dom.production.js.map +1 -0
  107. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js +39 -0
  108. package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js.map +1 -0
  109. package/dist/node_modules/.pnpm/react-map-gl@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/react-map-gl/dist/maplibre.js +16 -0
  110. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/middleware/immer.js +27 -0
  111. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/middleware/immer.js.map +1 -0
  112. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/vanilla.js +45 -0
  113. package/dist/node_modules/.pnpm/zustand@5.0.9_@types_react@19.2.7_immer@10.2.0_react@19.2.3_use-sync-external-store@1.6.0_react@19.2.3_/node_modules/zustand/esm/vanilla.js.map +1 -0
  114. package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js +78 -0
  115. package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js.map +1 -0
  116. package/dist/packages/hotkey-manager/dist/constants.js +47 -0
  117. package/dist/packages/hotkey-manager/dist/constants.js.map +1 -0
  118. package/dist/packages/hotkey-manager/dist/enums/keycode.js +130 -0
  119. package/dist/packages/hotkey-manager/dist/enums/keycode.js.map +1 -0
  120. package/dist/packages/hotkey-manager/dist/lib/is-client/index.js +22 -0
  121. package/dist/packages/hotkey-manager/dist/lib/is-client/index.js.map +1 -0
  122. package/dist/packages/hotkey-manager/dist/lib/is-mac/index.js +24 -0
  123. package/dist/packages/hotkey-manager/dist/lib/is-mac/index.js.map +1 -0
  124. package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js +39 -0
  125. package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js.map +1 -0
  126. package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js +27 -0
  127. package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js.map +1 -0
  128. package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js +95 -0
  129. package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js.map +1 -0
  130. package/package.json +17 -6
@@ -0,0 +1,63 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { clamp, log2 } from "./math-utils.js";
15
+ import { assert } from "./assert.js";
16
+ import { MAX_LATITUDE, lngLatToWorld, worldToLngLat } from "./web-mercator-utils.js";
17
+
18
+ //#region ../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js
19
+ /**
20
+ * Returns map settings {latitude, longitude, zoom}
21
+ * that will contain the provided corners within the provided width.
22
+ *
23
+ * > _Note: Only supports non-perspective mode._
24
+ *
25
+ * @param options fit bounds parameters
26
+ * @returns - latitude, longitude and zoom
27
+ */
28
+ function fitBounds(options) {
29
+ const { width, height, bounds, minExtent = 0, maxZoom = 24, offset = [0, 0] } = options;
30
+ const [[west, south], [east, north]] = bounds;
31
+ const padding = getPaddingObject(options.padding);
32
+ const nw = lngLatToWorld([west, clamp(north, -MAX_LATITUDE, MAX_LATITUDE)]);
33
+ const se = lngLatToWorld([east, clamp(south, -MAX_LATITUDE, MAX_LATITUDE)]);
34
+ const size = [Math.max(Math.abs(se[0] - nw[0]), minExtent), Math.max(Math.abs(se[1] - nw[1]), minExtent)];
35
+ const targetSize = [width - padding.left - padding.right - Math.abs(offset[0]) * 2, height - padding.top - padding.bottom - Math.abs(offset[1]) * 2];
36
+ assert(targetSize[0] > 0 && targetSize[1] > 0);
37
+ const scaleX = targetSize[0] / size[0];
38
+ const scaleY = targetSize[1] / size[1];
39
+ const offsetX = (padding.right - padding.left) / 2 / scaleX;
40
+ const offsetY = (padding.top - padding.bottom) / 2 / scaleY;
41
+ const centerLngLat = worldToLngLat([(se[0] + nw[0]) / 2 + offsetX, (se[1] + nw[1]) / 2 + offsetY]);
42
+ const zoom = Math.min(maxZoom, log2(Math.abs(Math.min(scaleX, scaleY))));
43
+ assert(Number.isFinite(zoom));
44
+ return {
45
+ longitude: centerLngLat[0],
46
+ latitude: centerLngLat[1],
47
+ zoom
48
+ };
49
+ }
50
+ function getPaddingObject(padding = 0) {
51
+ if (typeof padding === "number") return {
52
+ top: padding,
53
+ bottom: padding,
54
+ left: padding,
55
+ right: padding
56
+ };
57
+ assert(Number.isFinite(padding.top) && Number.isFinite(padding.bottom) && Number.isFinite(padding.left) && Number.isFinite(padding.right));
58
+ return padding;
59
+ }
60
+
61
+ //#endregion
62
+ export { fitBounds };
63
+ //# sourceMappingURL=fit-bounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fit-bounds.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js"],"sourcesContent":["import { assert } from \"./assert.js\";\nimport { log2, clamp } from \"./math-utils.js\";\nimport { MAX_LATITUDE, lngLatToWorld, worldToLngLat } from \"./web-mercator-utils.js\";\n/**\n * Returns map settings {latitude, longitude, zoom}\n * that will contain the provided corners within the provided width.\n *\n * > _Note: Only supports non-perspective mode._\n *\n * @param options fit bounds parameters\n * @returns - latitude, longitude and zoom\n */\nexport function fitBounds(options) {\n const { width, height, bounds, minExtent = 0, // 0.01 would be about 1000 meters (degree is ~110KM)\n maxZoom = 24, // ~x4,000,000 => About 10 meter extents\n offset = [0, 0] } = options;\n const [[west, south], [east, north]] = bounds;\n const padding = getPaddingObject(options.padding);\n const nw = lngLatToWorld([west, clamp(north, -MAX_LATITUDE, MAX_LATITUDE)]);\n const se = lngLatToWorld([east, clamp(south, -MAX_LATITUDE, MAX_LATITUDE)]);\n // width/height on the Web Mercator plane\n const size = [\n Math.max(Math.abs(se[0] - nw[0]), minExtent),\n Math.max(Math.abs(se[1] - nw[1]), minExtent)\n ];\n const targetSize = [\n width - padding.left - padding.right - Math.abs(offset[0]) * 2,\n height - padding.top - padding.bottom - Math.abs(offset[1]) * 2\n ];\n assert(targetSize[0] > 0 && targetSize[1] > 0);\n // scale = screen pixels per unit on the Web Mercator plane\n const scaleX = targetSize[0] / size[0];\n const scaleY = targetSize[1] / size[1];\n // Find how much we need to shift the center\n const offsetX = (padding.right - padding.left) / 2 / scaleX;\n const offsetY = (padding.top - padding.bottom) / 2 / scaleY;\n const center = [(se[0] + nw[0]) / 2 + offsetX, (se[1] + nw[1]) / 2 + offsetY];\n const centerLngLat = worldToLngLat(center);\n const zoom = Math.min(maxZoom, log2(Math.abs(Math.min(scaleX, scaleY))));\n assert(Number.isFinite(zoom));\n return {\n longitude: centerLngLat[0],\n latitude: centerLngLat[1],\n zoom\n };\n}\n// Helpers\nfunction getPaddingObject(padding = 0) {\n if (typeof padding === 'number') {\n return {\n top: padding,\n bottom: padding,\n left: padding,\n right: padding\n };\n }\n // Make sure all the required properties are set\n assert(Number.isFinite(padding.top) &&\n Number.isFinite(padding.bottom) &&\n Number.isFinite(padding.left) &&\n Number.isFinite(padding.right));\n return padding;\n}\n//# sourceMappingURL=fit-bounds.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAgB,UAAU,SAAS;CAC/B,MAAM,EAAE,OAAO,QAAQ,QAAQ,YAAY,GAC3C,UAAU,IACV,SAAS,CAAC,GAAG,EAAE,KAAK;CACpB,MAAM,CAAC,CAAC,MAAM,QAAQ,CAAC,MAAM,UAAU;CACvC,MAAM,UAAU,iBAAiB,QAAQ,QAAQ;CACjD,MAAM,KAAK,cAAc,CAAC,MAAM,MAAM,OAAO,CAAC,cAAc,aAAa,CAAC,CAAC;CAC3E,MAAM,KAAK,cAAc,CAAC,MAAM,MAAM,OAAO,CAAC,cAAc,aAAa,CAAC,CAAC;CAE3E,MAAM,OAAO,CACT,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,GAAG,GAAG,EAAE,UAAU,EAC5C,KAAK,IAAI,KAAK,IAAI,GAAG,KAAK,GAAG,GAAG,EAAE,UAAU,CAC/C;CACD,MAAM,aAAa,CACf,QAAQ,QAAQ,OAAO,QAAQ,QAAQ,KAAK,IAAI,OAAO,GAAG,GAAG,GAC7D,SAAS,QAAQ,MAAM,QAAQ,SAAS,KAAK,IAAI,OAAO,GAAG,GAAG,EACjE;AACD,QAAO,WAAW,KAAK,KAAK,WAAW,KAAK,EAAE;CAE9C,MAAM,SAAS,WAAW,KAAK,KAAK;CACpC,MAAM,SAAS,WAAW,KAAK,KAAK;CAEpC,MAAM,WAAW,QAAQ,QAAQ,QAAQ,QAAQ,IAAI;CACrD,MAAM,WAAW,QAAQ,MAAM,QAAQ,UAAU,IAAI;CAErD,MAAM,eAAe,cADN,EAAE,GAAG,KAAK,GAAG,MAAM,IAAI,UAAU,GAAG,KAAK,GAAG,MAAM,IAAI,QAAQ,CACnC;CAC1C,MAAM,OAAO,KAAK,IAAI,SAAS,KAAK,KAAK,IAAI,KAAK,IAAI,QAAQ,OAAO,CAAC,CAAC,CAAC;AACxE,QAAO,OAAO,SAAS,KAAK,CAAC;AAC7B,QAAO;EACH,WAAW,aAAa;EACxB,UAAU,aAAa;EACvB;EACH;;AAGL,SAAS,iBAAiB,UAAU,GAAG;AACnC,KAAI,OAAO,YAAY,SACnB,QAAO;EACH,KAAK;EACL,QAAQ;EACR,MAAM;EACN,OAAO;EACV;AAGL,QAAO,OAAO,SAAS,QAAQ,IAAI,IAC/B,OAAO,SAAS,QAAQ,OAAO,IAC/B,OAAO,SAAS,QAAQ,KAAK,IAC7B,OAAO,SAAS,QAAQ,MAAM,CAAC;AACnC,QAAO"}
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import "./web-mercator-utils.js";
@@ -0,0 +1,20 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import "./web-mercator-utils.js";
15
+
16
+ //#region ../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js
17
+ const DEGREES_TO_RADIANS = Math.PI / 180;
18
+
19
+ //#endregion
20
+ //# sourceMappingURL=get-bounds.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-bounds.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js"],"sourcesContent":["/* eslint-disable camelcase */\nimport { vec2 } from '@math.gl/core';\nimport { worldToLngLat } from \"./web-mercator-utils.js\";\nimport { transformVector } from \"./math-utils.js\";\nconst DEGREES_TO_RADIANS = Math.PI / 180;\n/*\n * Returns the quad at the intersection of the frustum and the given z plane\n * @param {WebMercatorViewport} viewport\n * @param {Number} z - elevation in meters\n */\nexport function getBounds(viewport, z = 0) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n const { width, height, unproject } = viewport;\n const unprojectOps = { targetZ: z };\n const bottomLeft = unproject([0, height], unprojectOps);\n const bottomRight = unproject([width, height], unprojectOps);\n let topLeft;\n let topRight;\n const halfFov = viewport.fovy\n ? 0.5 * viewport.fovy * DEGREES_TO_RADIANS\n : Math.atan(0.5 / viewport.altitude);\n const angleToGround = (90 - viewport.pitch) * DEGREES_TO_RADIANS;\n // The top plane is parallel to the ground if halfFov == angleToGround\n if (halfFov > angleToGround - 0.01) {\n // intersect with the far plane\n topLeft = unprojectOnFarPlane(viewport, 0, z);\n topRight = unprojectOnFarPlane(viewport, width, z);\n }\n else {\n // intersect with the top plane\n topLeft = unproject([0, 0], unprojectOps);\n topRight = unproject([width, 0], unprojectOps);\n }\n return [bottomLeft, bottomRight, topRight, topLeft];\n}\n/*\n * Find a point on the far clipping plane of the viewport\n * @param {WebMercatorViewport} viewport\n * @param {Number} x - projected x in screen space\n * @param {Number} targetZ - the elevation of the point in meters\n */\nfunction unprojectOnFarPlane(viewport, x, targetZ) {\n const { pixelUnprojectionMatrix } = viewport;\n const coord0 = transformVector(pixelUnprojectionMatrix, [x, 0, 1, 1]);\n const coord1 = transformVector(pixelUnprojectionMatrix, [x, viewport.height, 1, 1]);\n const z = targetZ * viewport.distanceScales.unitsPerMeter[2];\n const t = (z - coord0[2]) / (coord1[2] - coord0[2]);\n const coord = vec2.lerp([], coord0, coord1, t);\n const result = worldToLngLat(coord);\n result.push(targetZ);\n return result;\n}\n//# sourceMappingURL=get-bounds.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;AAIA,MAAM,qBAAqB,KAAK,KAAK"}
@@ -0,0 +1,19 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { MAX_LATITUDE, lngLatToWorld, worldToLngLat } from "./web-mercator-utils.js";
15
+ import { fitBounds } from "./fit-bounds.js";
16
+ import "./get-bounds.js";
17
+ import "./web-mercator-viewport.js";
18
+ import "./normalize-viewport-props.js";
19
+ import "./fly-to-viewport.js";
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ //#region ../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js
15
+ function clamp(x, min, max) {
16
+ return x < min ? min : x > max ? max : x;
17
+ }
18
+ function ieLog2(x) {
19
+ return Math.log(x) * Math.LOG2E;
20
+ }
21
+ const log2 = Math.log2 || ieLog2;
22
+
23
+ //#endregion
24
+ export { clamp, log2 };
25
+ //# sourceMappingURL=math-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math-utils.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js"],"sourcesContent":["import { vec4 } from '@math.gl/core';\n// Helper, avoids low-precision 32 bit matrices from gl-matrix mat4.create()\nexport function createMat4() {\n return [1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1];\n}\n// Transforms a vec4 with a projection matrix\nexport function transformVector(matrix, vector) {\n const result = vec4.transformMat4([], vector, matrix);\n vec4.scale(result, result, 1 / result[3]);\n return result;\n}\nexport function mod(value, divisor) {\n const modulus = value % divisor;\n return modulus < 0 ? divisor + modulus : modulus;\n}\nexport function lerp(start, end, step) {\n return step * end + (1 - step) * start;\n}\nexport function clamp(x, min, max) {\n return x < min ? min : x > max ? max : x;\n}\nfunction ieLog2(x) {\n return Math.log(x) * Math.LOG2E;\n}\n// Handle missing log2 in IE 11\nexport const log2 = Math.log2 || ieLog2;\n//# sourceMappingURL=math-utils.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;AAkBA,SAAgB,MAAM,GAAG,KAAK,KAAK;AAC/B,QAAO,IAAI,MAAM,MAAM,IAAI,MAAM,MAAM;;AAE3C,SAAS,OAAO,GAAG;AACf,QAAO,KAAK,IAAI,EAAE,GAAG,KAAK;;AAG9B,MAAa,OAAO,KAAK,QAAQ"}
@@ -0,0 +1,14 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import "./web-mercator-utils.js";
@@ -0,0 +1,59 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { assert } from "./assert.js";
15
+
16
+ //#region ../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-utils.js
17
+ const PI = Math.PI;
18
+ const PI_4 = PI / 4;
19
+ const DEGREES_TO_RADIANS = PI / 180;
20
+ const RADIANS_TO_DEGREES = 180 / PI;
21
+ const TILE_SIZE = 512;
22
+ const MAX_LATITUDE = 85.051129;
23
+ /**
24
+ * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile.
25
+ * Performs the nonlinear part of the web mercator projection.
26
+ * Remaining projection is done with 4x4 matrices which also handles
27
+ * perspective.
28
+ *
29
+ * @param lngLat - [lng, lat] coordinates
30
+ * Specifies a point on the sphere to project onto the map.
31
+ * @return [x,y] coordinates.
32
+ */
33
+ function lngLatToWorld(lngLat) {
34
+ const [lng, lat] = lngLat;
35
+ assert(Number.isFinite(lng));
36
+ assert(Number.isFinite(lat) && lat >= -90 && lat <= 90, "invalid latitude");
37
+ const lambda2 = lng * DEGREES_TO_RADIANS;
38
+ const phi2 = lat * DEGREES_TO_RADIANS;
39
+ return [TILE_SIZE * (lambda2 + PI) / (2 * PI), TILE_SIZE * (PI + Math.log(Math.tan(PI_4 + phi2 * .5))) / (2 * PI)];
40
+ }
41
+ /**
42
+ * Unproject world point [x,y] on map onto {lat, lon} on sphere
43
+ *
44
+ * @param xy - array with [x,y] members
45
+ * representing point on projected map plane
46
+ * @return - array with [x,y] of point on sphere.
47
+ * Has toArray method if you need a GeoJSON Array.
48
+ * Per cartographic tradition, lat and lon are specified as degrees.
49
+ */
50
+ function worldToLngLat(xy) {
51
+ const [x, y] = xy;
52
+ const lambda2 = x / TILE_SIZE * (2 * PI) - PI;
53
+ const phi2 = 2 * (Math.atan(Math.exp(y / TILE_SIZE * (2 * PI) - PI)) - PI_4);
54
+ return [lambda2 * RADIANS_TO_DEGREES, phi2 * RADIANS_TO_DEGREES];
55
+ }
56
+
57
+ //#endregion
58
+ export { MAX_LATITUDE, lngLatToWorld, worldToLngLat };
59
+ //# sourceMappingURL=web-mercator-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"web-mercator-utils.js","names":[],"sources":["../../../../../../../../../../node_modules/.pnpm/@math.gl+web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/web-mercator-utils.js"],"sourcesContent":["// TODO - THE UTILITIES IN THIS FILE SHOULD BE IMPORTED FROM WEB-MERCATOR-VIEWPORT MODULE\nimport { createMat4, transformVector, clamp, log2 } from \"./math-utils.js\";\nimport { mat4, vec2, vec3 } from '@math.gl/core';\nimport { assert } from \"./assert.js\";\n// CONSTANTS\nconst PI = Math.PI;\nconst PI_4 = PI / 4;\nconst DEGREES_TO_RADIANS = PI / 180;\nconst RADIANS_TO_DEGREES = 180 / PI;\nconst TILE_SIZE = 512;\n// Average circumference (40075 km equatorial, 40007 km meridional)\nconst EARTH_CIRCUMFERENCE = 40.03e6;\n// Latitude that makes a square world, 2 * atan(E ** PI) - PI / 2\nexport const MAX_LATITUDE = 85.051129;\n// Mapbox default altitude\nexport const DEFAULT_ALTITUDE = 1.5;\n/** Logarithimic zoom to linear scale **/\nexport function zoomToScale(zoom) {\n return Math.pow(2, zoom);\n}\n/** Linear scale to logarithimic zoom **/\nexport function scaleToZoom(scale) {\n return log2(scale);\n}\n/**\n * Project [lng,lat] on sphere onto [x,y] on 512*512 Mercator Zoom 0 tile.\n * Performs the nonlinear part of the web mercator projection.\n * Remaining projection is done with 4x4 matrices which also handles\n * perspective.\n *\n * @param lngLat - [lng, lat] coordinates\n * Specifies a point on the sphere to project onto the map.\n * @return [x,y] coordinates.\n */\nexport function lngLatToWorld(lngLat) {\n const [lng, lat] = lngLat;\n assert(Number.isFinite(lng));\n assert(Number.isFinite(lat) && lat >= -90 && lat <= 90, 'invalid latitude');\n const lambda2 = lng * DEGREES_TO_RADIANS;\n const phi2 = lat * DEGREES_TO_RADIANS;\n const x = (TILE_SIZE * (lambda2 + PI)) / (2 * PI);\n const y = (TILE_SIZE * (PI + Math.log(Math.tan(PI_4 + phi2 * 0.5)))) / (2 * PI);\n return [x, y];\n}\n/**\n * Unproject world point [x,y] on map onto {lat, lon} on sphere\n *\n * @param xy - array with [x,y] members\n * representing point on projected map plane\n * @return - array with [x,y] of point on sphere.\n * Has toArray method if you need a GeoJSON Array.\n * Per cartographic tradition, lat and lon are specified as degrees.\n */\nexport function worldToLngLat(xy) {\n const [x, y] = xy;\n const lambda2 = (x / TILE_SIZE) * (2 * PI) - PI;\n const phi2 = 2 * (Math.atan(Math.exp((y / TILE_SIZE) * (2 * PI) - PI)) - PI_4);\n return [lambda2 * RADIANS_TO_DEGREES, phi2 * RADIANS_TO_DEGREES];\n}\n/**\n * Returns the zoom level that gives a 1 meter pixel at a certain latitude\n * 1 = C*cos(y)/2^z/TILE_SIZE = C*cos(y)/2^(z+9)\n */\nexport function getMeterZoom(options) {\n const { latitude } = options;\n assert(Number.isFinite(latitude));\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n return scaleToZoom(EARTH_CIRCUMFERENCE * latCosine) - 9;\n}\n/**\n * Calculate the conversion from meter to common units at a given latitude\n * This is a cheaper version of `getDistanceScales`\n * @param latitude center latitude in degrees\n * @returns common units per meter\n */\nexport function unitsPerMeter(latitude) {\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n return TILE_SIZE / EARTH_CIRCUMFERENCE / latCosine;\n}\n/**\n * Calculate distance scales in meters around current lat/lon, both for\n * degrees and pixels.\n * In mercator projection mode, the distance scales vary significantly\n * with latitude.\n */\nexport function getDistanceScales(options) {\n const { latitude, longitude, highPrecision = false } = options;\n assert(Number.isFinite(latitude) && Number.isFinite(longitude));\n const worldSize = TILE_SIZE;\n const latCosine = Math.cos(latitude * DEGREES_TO_RADIANS);\n /**\n * Number of pixels occupied by one degree longitude around current lat/lon:\n unitsPerDegreeX = d(lngLatToWorld([lng, lat])[0])/d(lng)\n = scale * TILE_SIZE * DEGREES_TO_RADIANS / (2 * PI)\n unitsPerDegreeY = d(lngLatToWorld([lng, lat])[1])/d(lat)\n = -scale * TILE_SIZE * DEGREES_TO_RADIANS / cos(lat * DEGREES_TO_RADIANS) / (2 * PI)\n */\n const unitsPerDegreeX = worldSize / 360;\n const unitsPerDegreeY = unitsPerDegreeX / latCosine;\n /**\n * Number of pixels occupied by one meter around current lat/lon:\n */\n const altUnitsPerMeter = worldSize / EARTH_CIRCUMFERENCE / latCosine;\n /**\n * LngLat: longitude -> east and latitude -> north (bottom left)\n * UTM meter offset: x -> east and y -> north (bottom left)\n * World space: x -> east and y -> south (top left)\n *\n * Y needs to be flipped when converting delta degree/meter to delta pixels\n */\n const result = {\n unitsPerMeter: [altUnitsPerMeter, altUnitsPerMeter, altUnitsPerMeter],\n metersPerUnit: [1 / altUnitsPerMeter, 1 / altUnitsPerMeter, 1 / altUnitsPerMeter],\n unitsPerDegree: [unitsPerDegreeX, unitsPerDegreeY, altUnitsPerMeter],\n degreesPerUnit: [1 / unitsPerDegreeX, 1 / unitsPerDegreeY, 1 / altUnitsPerMeter]\n };\n /**\n * Taylor series 2nd order for 1/latCosine\n f'(a) * (x - a)\n = d(1/cos(lat * DEGREES_TO_RADIANS))/d(lat) * dLat\n = DEGREES_TO_RADIANS * tan(lat * DEGREES_TO_RADIANS) / cos(lat * DEGREES_TO_RADIANS) * dLat\n */\n if (highPrecision) {\n const latCosine2 = (DEGREES_TO_RADIANS * Math.tan(latitude * DEGREES_TO_RADIANS)) / latCosine;\n const unitsPerDegreeY2 = (unitsPerDegreeX * latCosine2) / 2;\n const altUnitsPerDegree2 = (worldSize / EARTH_CIRCUMFERENCE) * latCosine2;\n const altUnitsPerMeter2 = (altUnitsPerDegree2 / unitsPerDegreeY) * altUnitsPerMeter;\n result.unitsPerDegree2 = [0, unitsPerDegreeY2, altUnitsPerDegree2];\n result.unitsPerMeter2 = [altUnitsPerMeter2, 0, altUnitsPerMeter2];\n }\n // Main results, used for converting meters to latlng deltas and scaling offsets\n return result;\n}\n/**\n * Offset a lng/lat position by meterOffset (northing, easting)\n */\nexport function addMetersToLngLat(lngLatZ, xyz) {\n const [longitude, latitude, z0] = lngLatZ;\n const [x, y, z] = xyz;\n // eslint-disable-next-line no-shadow\n const { unitsPerMeter, unitsPerMeter2 } = getDistanceScales({\n longitude,\n latitude,\n highPrecision: true\n });\n const worldspace = lngLatToWorld(lngLatZ);\n worldspace[0] += x * (unitsPerMeter[0] + unitsPerMeter2[0] * y);\n worldspace[1] += y * (unitsPerMeter[1] + unitsPerMeter2[1] * y);\n const newLngLat = worldToLngLat(worldspace);\n const newZ = (z0 || 0) + (z || 0);\n return Number.isFinite(z0) || Number.isFinite(z) ? [newLngLat[0], newLngLat[1], newZ] : newLngLat;\n}\n/**\n *\n * view and projection matrix creation is intentionally kept compatible with\n * mapbox-gl's implementation to ensure that seamless interoperation\n * with mapbox and react-map-gl. See: https://github.com/mapbox/mapbox-gl-js\n */\nexport function getViewMatrix(options) {\n const { \n // Viewport props\n height, pitch, bearing, altitude, \n // Pre-calculated parameters\n scale, center } = options;\n // VIEW MATRIX: PROJECTS MERCATOR WORLD COORDINATES\n // Note that mercator world coordinates typically need to be flipped\n //\n // Note: As usual, matrix operation orders should be read in reverse\n // since vectors will be multiplied from the right during transformation\n const vm = createMat4();\n // Move camera to altitude (along the pitch & bearing direction)\n mat4.translate(vm, vm, [0, 0, -altitude]);\n // Rotate by bearing, and then by pitch (which tilts the view)\n mat4.rotateX(vm, vm, -pitch * DEGREES_TO_RADIANS);\n mat4.rotateZ(vm, vm, bearing * DEGREES_TO_RADIANS);\n const relativeScale = scale / height;\n mat4.scale(vm, vm, [relativeScale, relativeScale, relativeScale]);\n if (center) {\n mat4.translate(vm, vm, vec3.negate([], center));\n }\n return vm;\n}\n/**\n * Calculates mapbox compatible projection matrix from parameters\n *\n * @param options.width Width of \"viewport\" or window\n * @param options.height Height of \"viewport\" or window\n * @param options.scale Scale at the current zoom\n * @param options.center Offset of the target, vec3 in world space\n * @param options.offset Offset of the focal point, vec2 in screen space\n * @param options.pitch Camera angle in degrees (0 is straight down)\n * @param options.fovy field of view in degrees\n * @param options.altitude if provided, field of view is calculated using `altitudeToFovy()`\n * @param options.nearZMultiplier control z buffer\n * @param options.farZMultiplier control z buffer\n * @returns project parameters object\n */\nexport function getProjectionParameters(options) {\n const { width, height, altitude, pitch = 0, offset, center, scale, nearZMultiplier = 1, farZMultiplier = 1 } = options;\n let { fovy = altitudeToFovy(DEFAULT_ALTITUDE) } = options;\n // For back-compatibility allow field of view to be\n // derived from altitude\n if (altitude !== undefined) {\n fovy = altitudeToFovy(altitude);\n }\n const fovRadians = fovy * DEGREES_TO_RADIANS;\n const pitchRadians = pitch * DEGREES_TO_RADIANS;\n // Distance from camera to the target\n const focalDistance = fovyToAltitude(fovy);\n let cameraToSeaLevelDistance = focalDistance;\n if (center) {\n cameraToSeaLevelDistance += (center[2] * scale) / Math.cos(pitchRadians) / height;\n }\n const fovAboveCenter = fovRadians * (0.5 + (offset ? offset[1] : 0) / height);\n // Find the distance from the center point to the center top\n // in focal distance units using law of sines.\n const topHalfSurfaceDistance = (Math.sin(fovAboveCenter) * cameraToSeaLevelDistance) /\n Math.sin(clamp(Math.PI / 2 - pitchRadians - fovAboveCenter, 0.01, Math.PI - 0.01));\n // Calculate z distance of the farthest fragment that should be rendered.\n const furthestDistance = Math.sin(pitchRadians) * topHalfSurfaceDistance + cameraToSeaLevelDistance;\n // Matches mapbox limit\n const horizonDistance = cameraToSeaLevelDistance * 10;\n // Calculate z value of the farthest fragment that should be rendered.\n const farZ = Math.min(furthestDistance * farZMultiplier, horizonDistance);\n return {\n fov: fovRadians,\n aspect: width / height,\n focalDistance,\n near: nearZMultiplier,\n far: farZ\n };\n}\n/**\n * CALCULATE PROJECTION MATRIX: PROJECTS FROM CAMERA (VIEW) SPACE TO CLIPSPACE\n *\n * To match mapbox's z buffer:\n * - \\<= 0.28: nearZMultiplier: 0.1, farZmultiplier: 1\n * - \\>= 0.29: nearZMultiplier: 1 / height, farZMultiplier: 1.01\n *\n * @param options Viewport options\n * @param options.width Width of \"viewport\" or window\n * @param options.height Height of \"viewport\" or window\n * @param options.scale Scale at the current zoom\n * @param options.center Offset of the target, vec3 in world space\n * @param options.offset Offset of the focal point, vec2 in screen space\n * @param options.pitch Camera angle in degrees (0 is straight down)\n * @param options.fovy field of view in degrees\n * @param options.altitude if provided, field of view is calculated using `altitudeToFovy()`\n * @param options.nearZMultiplier control z buffer\n * @param options.farZMultiplier control z buffer\n * @returns 4x4 projection matrix\n */\nexport function getProjectionMatrix(options) {\n const { fov, aspect, near, far } = getProjectionParameters(options);\n const projectionMatrix = mat4.perspective([], fov, // fov in radians\n aspect, // aspect ratio\n near, // near plane\n far // far plane\n );\n return projectionMatrix;\n}\n/**\n *\n * Convert an altitude to field of view such that the\n * focal distance is equal to the altitude\n *\n * @param altitude - altitude of camera in screen units\n * @return fovy field of view in degrees\n */\nexport function altitudeToFovy(altitude) {\n return 2 * Math.atan(0.5 / altitude) * RADIANS_TO_DEGREES;\n}\n/**\n *\n * Convert an field of view such that the\n * focal distance is equal to the altitude\n *\n * @param fovy - field of view in degrees\n * @return altitude altitude of camera in screen units\n */\nexport function fovyToAltitude(fovy) {\n return 0.5 / Math.tan(0.5 * fovy * DEGREES_TO_RADIANS);\n}\n// Project flat coordinates to pixels on screen.\nexport function worldToPixels(xyz, pixelProjectionMatrix) {\n const [x, y, z = 0] = xyz;\n assert(Number.isFinite(x) && Number.isFinite(y) && Number.isFinite(z));\n return transformVector(pixelProjectionMatrix, [x, y, z, 1]);\n}\n/**\n * Unproject pixels on screen to flat coordinates.\n *\n * @param xyz - pixel coordinate on screen.\n * @param pixelUnprojectionMatrix - unprojection matrix 4x4\n * @param targetZ - if pixel coordinate does not have a 3rd component (depth),\n * targetZ is used as the elevation plane to unproject onto\n * @return [x, y, Z] flat coordinates on 512*512 Mercator Zoom 0 tile.\n */\nexport function pixelsToWorld(xyz, pixelUnprojectionMatrix, targetZ = 0) {\n const [x, y, z] = xyz;\n assert(Number.isFinite(x) && Number.isFinite(y), 'invalid pixel coordinate');\n if (Number.isFinite(z)) {\n // Has depth component\n const coord = transformVector(pixelUnprojectionMatrix, [x, y, z, 1]);\n return coord;\n }\n // since we don't know the correct projected z value for the point,\n // unproject two points to get a line and then find the point on that line with z=0\n const coord0 = transformVector(pixelUnprojectionMatrix, [x, y, 0, 1]);\n const coord1 = transformVector(pixelUnprojectionMatrix, [x, y, 1, 1]);\n const z0 = coord0[2];\n const z1 = coord1[2];\n const t = z0 === z1 ? 0 : ((targetZ || 0) - z0) / (z1 - z0);\n return vec2.lerp([], coord0, coord1, t);\n}\n//# sourceMappingURL=web-mercator-utils.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;AAKA,MAAM,KAAK,KAAK;AAChB,MAAM,OAAO,KAAK;AAClB,MAAM,qBAAqB,KAAK;AAChC,MAAM,qBAAqB,MAAM;AACjC,MAAM,YAAY;AAIlB,MAAa,eAAe;;;;;;;;;;;AAqB5B,SAAgB,cAAc,QAAQ;CAClC,MAAM,CAAC,KAAK,OAAO;AACnB,QAAO,OAAO,SAAS,IAAI,CAAC;AAC5B,QAAO,OAAO,SAAS,IAAI,IAAI,OAAO,OAAO,OAAO,IAAI,mBAAmB;CAC3E,MAAM,UAAU,MAAM;CACtB,MAAM,OAAO,MAAM;AAGnB,QAAO,CAFI,aAAa,UAAU,OAAQ,IAAI,KACnC,aAAa,KAAK,KAAK,IAAI,KAAK,IAAI,OAAO,OAAO,GAAI,CAAC,KAAM,IAAI,IAC/D;;;;;;;;;;;AAWjB,SAAgB,cAAc,IAAI;CAC9B,MAAM,CAAC,GAAG,KAAK;CACf,MAAM,UAAW,IAAI,aAAc,IAAI,MAAM;CAC7C,MAAM,OAAO,KAAK,KAAK,KAAK,KAAK,IAAK,IAAI,aAAc,IAAI,MAAM,GAAG,CAAC,GAAG;AACzE,QAAO,CAAC,UAAU,oBAAoB,OAAO,mBAAmB"}
@@ -0,0 +1,16 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import "./web-mercator-utils.js";
15
+ import "./fit-bounds.js";
16
+ import "./get-bounds.js";
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { applyReactStyle } from "../utils/apply-react-style.js";
15
+ import { useControl } from "./use-control.js";
16
+ import { memo, useEffect } from "react";
17
+
18
+ //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js
19
+ function _AttributionControl(props) {
20
+ const ctrl = useControl(({ mapLib }) => new mapLib.AttributionControl(props), { position: props.position });
21
+ useEffect(() => {
22
+ applyReactStyle(ctrl._container, props.style);
23
+ }, [props.style]);
24
+ return null;
25
+ }
26
+ const AttributionControl = memo(_AttributionControl);
27
+
28
+ //#endregion
29
+ //# sourceMappingURL=attribution-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"attribution-control.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/attribution-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _AttributionControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.AttributionControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport const AttributionControl = memo(_AttributionControl);\n//# sourceMappingURL=attribution-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,SAAS,oBAAoB,OAAO;CAChC,MAAM,OAAO,YAAY,EAAE,aAAa,IAAI,OAAO,mBAAmB,MAAM,EAAE,EAC1E,UAAU,MAAM,UACnB,CAAC;AACF,iBAAgB;AACZ,kBAAgB,KAAK,YAAY,MAAM,MAAM;IAC9C,CAAC,MAAM,MAAM,CAAC;AACjB,QAAO;;AAEX,MAAa,qBAAqB,KAAK,oBAAoB"}
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { applyReactStyle } from "../utils/apply-react-style.js";
15
+ import { useControl } from "./use-control.js";
16
+ import { memo, useEffect } from "react";
17
+
18
+ //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js
19
+ function _FullscreenControl(props) {
20
+ const ctrl = useControl(({ mapLib }) => new mapLib.FullscreenControl({ container: props.containerId && document.getElementById(props.containerId) }), { position: props.position });
21
+ useEffect(() => {
22
+ applyReactStyle(ctrl._controlContainer, props.style);
23
+ }, [props.style]);
24
+ return null;
25
+ }
26
+ const FullscreenControl = memo(_FullscreenControl);
27
+
28
+ //#endregion
29
+ //# sourceMappingURL=fullscreen-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fullscreen-control.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/fullscreen-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _FullscreenControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.FullscreenControl({\n container: props.containerId && document.getElementById(props.containerId)\n }), { position: props.position });\n useEffect(() => {\n applyReactStyle(ctrl._controlContainer, props.style);\n }, [props.style]);\n return null;\n}\nexport const FullscreenControl = memo(_FullscreenControl);\n//# sourceMappingURL=fullscreen-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,SAAS,mBAAmB,OAAO;CAC/B,MAAM,OAAO,YAAY,EAAE,aAAa,IAAI,OAAO,kBAAkB,EACjE,WAAW,MAAM,eAAe,SAAS,eAAe,MAAM,YAAY,EAC7E,CAAC,EAAE,EAAE,UAAU,MAAM,UAAU,CAAC;AACjC,iBAAgB;AACZ,kBAAgB,KAAK,mBAAmB,MAAM,MAAM;IACrD,CAAC,MAAM,MAAM,CAAC;AACjB,QAAO;;AAEX,MAAa,oBAAoB,KAAK,mBAAmB"}
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { applyReactStyle } from "../utils/apply-react-style.js";
15
+ import { useControl } from "./use-control.js";
16
+ import { forwardRef, memo, useEffect, useImperativeHandle, useRef } from "react";
17
+
18
+ //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js
19
+ function _GeolocateControl(props, ref) {
20
+ const thisRef = useRef({ props });
21
+ const ctrl = useControl(({ mapLib }) => {
22
+ const gc = new mapLib.GeolocateControl(props);
23
+ const setupUI = gc._setupUI;
24
+ gc._setupUI = () => {
25
+ if (!gc._container.hasChildNodes()) setupUI();
26
+ };
27
+ gc.on("geolocate", (e) => {
28
+ thisRef.current.props.onGeolocate?.(e);
29
+ });
30
+ gc.on("error", (e) => {
31
+ thisRef.current.props.onError?.(e);
32
+ });
33
+ gc.on("outofmaxbounds", (e) => {
34
+ thisRef.current.props.onOutOfMaxBounds?.(e);
35
+ });
36
+ gc.on("trackuserlocationstart", (e) => {
37
+ thisRef.current.props.onTrackUserLocationStart?.(e);
38
+ });
39
+ gc.on("trackuserlocationend", (e) => {
40
+ thisRef.current.props.onTrackUserLocationEnd?.(e);
41
+ });
42
+ return gc;
43
+ }, { position: props.position });
44
+ thisRef.current.props = props;
45
+ useImperativeHandle(ref, () => ctrl, []);
46
+ useEffect(() => {
47
+ applyReactStyle(ctrl._container, props.style);
48
+ }, [props.style]);
49
+ return null;
50
+ }
51
+ const GeolocateControl = memo(forwardRef(_GeolocateControl));
52
+
53
+ //#endregion
54
+ //# sourceMappingURL=geolocate-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"geolocate-control.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/geolocate-control.js"],"sourcesContent":["import { useImperativeHandle, useRef, useEffect, forwardRef, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _GeolocateControl(props, ref) {\n const thisRef = useRef({ props });\n const ctrl = useControl(({ mapLib }) => {\n const gc = new mapLib.GeolocateControl(props);\n // Hack: fix GeolocateControl reuse\n // When using React strict mode, the component is mounted twice.\n // GeolocateControl's UI creation is asynchronous. Removing and adding it back causes the UI to be initialized twice.\n const setupUI = gc._setupUI;\n gc._setupUI = () => {\n if (!gc._container.hasChildNodes()) {\n setupUI();\n }\n };\n gc.on('geolocate', e => {\n thisRef.current.props.onGeolocate?.(e);\n });\n gc.on('error', e => {\n thisRef.current.props.onError?.(e);\n });\n gc.on('outofmaxbounds', e => {\n thisRef.current.props.onOutOfMaxBounds?.(e);\n });\n gc.on('trackuserlocationstart', e => {\n thisRef.current.props.onTrackUserLocationStart?.(e);\n });\n gc.on('trackuserlocationend', e => {\n thisRef.current.props.onTrackUserLocationEnd?.(e);\n });\n return gc;\n }, { position: props.position });\n thisRef.current.props = props;\n useImperativeHandle(ref, () => ctrl, []);\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport const GeolocateControl = memo(forwardRef(_GeolocateControl));\n//# sourceMappingURL=geolocate-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,SAAS,kBAAkB,OAAO,KAAK;CACnC,MAAM,UAAU,OAAO,EAAE,OAAO,CAAC;CACjC,MAAM,OAAO,YAAY,EAAE,aAAa;EACpC,MAAM,KAAK,IAAI,OAAO,iBAAiB,MAAM;EAI7C,MAAM,UAAU,GAAG;AACnB,KAAG,iBAAiB;AAChB,OAAI,CAAC,GAAG,WAAW,eAAe,CAC9B,UAAS;;AAGjB,KAAG,GAAG,cAAa,MAAK;AACpB,WAAQ,QAAQ,MAAM,cAAc,EAAE;IACxC;AACF,KAAG,GAAG,UAAS,MAAK;AAChB,WAAQ,QAAQ,MAAM,UAAU,EAAE;IACpC;AACF,KAAG,GAAG,mBAAkB,MAAK;AACzB,WAAQ,QAAQ,MAAM,mBAAmB,EAAE;IAC7C;AACF,KAAG,GAAG,2BAA0B,MAAK;AACjC,WAAQ,QAAQ,MAAM,2BAA2B,EAAE;IACrD;AACF,KAAG,GAAG,yBAAwB,MAAK;AAC/B,WAAQ,QAAQ,MAAM,yBAAyB,EAAE;IACnD;AACF,SAAO;IACR,EAAE,UAAU,MAAM,UAAU,CAAC;AAChC,SAAQ,QAAQ,QAAQ;AACxB,qBAAoB,WAAW,MAAM,EAAE,CAAC;AACxC,iBAAgB;AACZ,kBAAgB,KAAK,YAAY,MAAM,MAAM;IAC9C,CAAC,MAAM,MAAM,CAAC;AACjB,QAAO;;AAEX,MAAa,mBAAmB,KAAK,WAAW,kBAAkB,CAAC"}
@@ -0,0 +1,15 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import "./map.js";
15
+ import { useContext, useEffect, useMemo, useRef, useState } from "react";
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { applyReactStyle } from "../utils/apply-react-style.js";
15
+ import { useControl } from "./use-control.js";
16
+ import { memo, useEffect } from "react";
17
+
18
+ //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js
19
+ function _LogoControl(props) {
20
+ const ctrl = useControl(({ mapLib }) => new mapLib.LogoControl(props), { position: props.position });
21
+ useEffect(() => {
22
+ applyReactStyle(ctrl._container, props.style);
23
+ }, [props.style]);
24
+ return null;
25
+ }
26
+ const LogoControl = memo(_LogoControl);
27
+
28
+ //#endregion
29
+ //# sourceMappingURL=logo-control.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logo-control.js","names":[],"sources":["../../../../../../../../../../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/logo-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _LogoControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.LogoControl(props), { position: props.position });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport const LogoControl = memo(_LogoControl);\n//# sourceMappingURL=logo-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,SAAS,aAAa,OAAO;CACzB,MAAM,OAAO,YAAY,EAAE,aAAa,IAAI,OAAO,YAAY,MAAM,EAAE,EAAE,UAAU,MAAM,UAAU,CAAC;AACpG,iBAAgB;AACZ,kBAAgB,KAAK,YAAY,MAAM,MAAM;IAC9C,CAAC,MAAM,MAAM,CAAC;AACjB,QAAO;;AAEX,MAAa,cAAc,KAAK,aAAa"}
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Copyright 2025 Hypergiant Galactic Systems Inc. All rights reserved.
3
+ * This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
+ * you may not use this file except in compliance with the License. You may obtain a copy
5
+ * of the License at https://www.apache.org/licenses/LICENSE-2.0
6
+ *
7
+ * Unless required by applicable law or agreed to in writing, software distributed under
8
+ * the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
+ * OF ANY KIND, either express or implied. See the License for the specific language
10
+ * governing permissions and limitations under the License.
11
+ */
12
+
13
+
14
+ import { MountedMapsContext } from "./use-map.js";
15
+ import maplibre_default from "../maplibre/maplibre.js";
16
+ import createRef from "../maplibre/create-ref.js";
17
+ import use_isomorphic_layout_effect_default from "../utils/use-isomorphic-layout-effect.js";
18
+ import setGlobals from "../utils/set-globals.js";
19
+ import * as React$1 from "react";
20
+ import { useContext, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
21
+
22
+ //#region ../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/map.js
23
+ const MapContext = React$1.createContext(null);
24
+ function _Map(props, ref) {
25
+ const mountedMapsContext = useContext(MountedMapsContext);
26
+ const [mapInstance, setMapInstance] = useState(null);
27
+ const containerRef = useRef();
28
+ const { current: contextValue } = useRef({
29
+ mapLib: null,
30
+ map: null
31
+ });
32
+ useEffect(() => {
33
+ const mapLib = props.mapLib;
34
+ let isMounted = true;
35
+ let maplibre;
36
+ Promise.resolve(mapLib || import("maplibre-gl")).then((module) => {
37
+ if (!isMounted) return;
38
+ if (!module) throw new Error("Invalid mapLib");
39
+ const mapboxgl = "Map" in module ? module : module.default;
40
+ if (!mapboxgl.Map) throw new Error("Invalid mapLib");
41
+ setGlobals(mapboxgl, props);
42
+ if (props.reuseMaps) maplibre = maplibre_default.reuse(props, containerRef.current);
43
+ if (!maplibre) maplibre = new maplibre_default(mapboxgl.Map, props, containerRef.current);
44
+ contextValue.map = createRef(maplibre);
45
+ contextValue.mapLib = mapboxgl;
46
+ setMapInstance(maplibre);
47
+ mountedMapsContext?.onMapMount(contextValue.map, props.id);
48
+ }).catch((error) => {
49
+ const { onError } = props;
50
+ if (onError) onError({
51
+ type: "error",
52
+ target: null,
53
+ originalEvent: null,
54
+ error
55
+ });
56
+ else console.error(error);
57
+ });
58
+ return () => {
59
+ isMounted = false;
60
+ if (maplibre) {
61
+ mountedMapsContext?.onMapUnmount(props.id);
62
+ if (props.reuseMaps) maplibre.recycle();
63
+ else maplibre.destroy();
64
+ }
65
+ };
66
+ }, []);
67
+ use_isomorphic_layout_effect_default(() => {
68
+ if (mapInstance) mapInstance.setProps(props);
69
+ });
70
+ useImperativeHandle(ref, () => contextValue.map, [mapInstance]);
71
+ const style = useMemo(() => ({
72
+ position: "relative",
73
+ width: "100%",
74
+ height: "100%",
75
+ ...props.style
76
+ }), [props.style]);
77
+ const CHILD_CONTAINER_STYLE = { height: "100%" };
78
+ return React$1.createElement("div", {
79
+ id: props.id,
80
+ ref: containerRef,
81
+ style
82
+ }, mapInstance && React$1.createElement(MapContext.Provider, { value: contextValue }, React$1.createElement("div", {
83
+ "mapboxgl-children": "",
84
+ style: CHILD_CONTAINER_STYLE
85
+ }, props.children)));
86
+ }
87
+ const Map = React$1.forwardRef(_Map);
88
+
89
+ //#endregion
90
+ export { Map, MapContext };
91
+ //# sourceMappingURL=map.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"map.js","names":["React","Maplibre"],"sources":["../../../../../../../../../../../node_modules/.pnpm/@vis.gl+react-maplibre@8.1.0_maplibre-gl@5.15.0_react-dom@19.2.3_react@19.2.3__react@19.2.3/node_modules/@vis.gl/react-maplibre/dist/components/map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useRef, useEffect, useContext, useMemo, useImperativeHandle } from 'react';\nimport { MountedMapsContext } from \"./use-map.js\";\nimport Maplibre from \"../maplibre/maplibre.js\";\nimport createRef from \"../maplibre/create-ref.js\";\nimport useIsomorphicLayoutEffect from \"../utils/use-isomorphic-layout-effect.js\";\nimport setGlobals from \"../utils/set-globals.js\";\nexport const MapContext = React.createContext(null);\nfunction _Map(props, ref) {\n const mountedMapsContext = useContext(MountedMapsContext);\n const [mapInstance, setMapInstance] = useState(null);\n const containerRef = useRef();\n const { current: contextValue } = useRef({ mapLib: null, map: null });\n useEffect(() => {\n const mapLib = props.mapLib;\n let isMounted = true;\n let maplibre;\n Promise.resolve(mapLib || import('maplibre-gl'))\n .then((module) => {\n if (!isMounted) {\n return;\n }\n if (!module) {\n throw new Error('Invalid mapLib');\n }\n const mapboxgl = 'Map' in module ? module : module.default;\n if (!mapboxgl.Map) {\n throw new Error('Invalid mapLib');\n }\n setGlobals(mapboxgl, props);\n if (props.reuseMaps) {\n maplibre = Maplibre.reuse(props, containerRef.current);\n }\n if (!maplibre) {\n maplibre = new Maplibre(mapboxgl.Map, props, containerRef.current);\n }\n contextValue.map = createRef(maplibre);\n contextValue.mapLib = mapboxgl;\n setMapInstance(maplibre);\n mountedMapsContext?.onMapMount(contextValue.map, props.id);\n })\n .catch(error => {\n const { onError } = props;\n if (onError) {\n onError({\n type: 'error',\n target: null,\n originalEvent: null,\n error\n });\n }\n else {\n console.error(error); // eslint-disable-line\n }\n });\n return () => {\n isMounted = false;\n if (maplibre) {\n mountedMapsContext?.onMapUnmount(props.id);\n if (props.reuseMaps) {\n maplibre.recycle();\n }\n else {\n maplibre.destroy();\n }\n }\n };\n }, []);\n useIsomorphicLayoutEffect(() => {\n if (mapInstance) {\n mapInstance.setProps(props);\n }\n });\n useImperativeHandle(ref, () => contextValue.map, [mapInstance]);\n const style = useMemo(() => ({\n position: 'relative',\n width: '100%',\n height: '100%',\n ...props.style\n }), [props.style]);\n const CHILD_CONTAINER_STYLE = {\n height: '100%'\n };\n return (React.createElement(\"div\", { id: props.id, ref: containerRef, style: style }, mapInstance && (React.createElement(MapContext.Provider, { value: contextValue },\n React.createElement(\"div\", { \"mapboxgl-children\": \"\", style: CHILD_CONTAINER_STYLE }, props.children)))));\n}\nexport const Map = React.forwardRef(_Map);\n//# sourceMappingURL=map.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,MAAa,aAAaA,QAAM,cAAc,KAAK;AACnD,SAAS,KAAK,OAAO,KAAK;CACtB,MAAM,qBAAqB,WAAW,mBAAmB;CACzD,MAAM,CAAC,aAAa,kBAAkB,SAAS,KAAK;CACpD,MAAM,eAAe,QAAQ;CAC7B,MAAM,EAAE,SAAS,iBAAiB,OAAO;EAAE,QAAQ;EAAM,KAAK;EAAM,CAAC;AACrE,iBAAgB;EACZ,MAAM,SAAS,MAAM;EACrB,IAAI,YAAY;EAChB,IAAI;AACJ,UAAQ,QAAQ,UAAU,OAAO,eAAe,CAC3C,MAAM,WAAW;AAClB,OAAI,CAAC,UACD;AAEJ,OAAI,CAAC,OACD,OAAM,IAAI,MAAM,iBAAiB;GAErC,MAAM,WAAW,SAAS,SAAS,SAAS,OAAO;AACnD,OAAI,CAAC,SAAS,IACV,OAAM,IAAI,MAAM,iBAAiB;AAErC,cAAW,UAAU,MAAM;AAC3B,OAAI,MAAM,UACN,YAAWC,iBAAS,MAAM,OAAO,aAAa,QAAQ;AAE1D,OAAI,CAAC,SACD,YAAW,IAAIA,iBAAS,SAAS,KAAK,OAAO,aAAa,QAAQ;AAEtE,gBAAa,MAAM,UAAU,SAAS;AACtC,gBAAa,SAAS;AACtB,kBAAe,SAAS;AACxB,uBAAoB,WAAW,aAAa,KAAK,MAAM,GAAG;IAC5D,CACG,OAAM,UAAS;GAChB,MAAM,EAAE,YAAY;AACpB,OAAI,QACA,SAAQ;IACJ,MAAM;IACN,QAAQ;IACR,eAAe;IACf;IACH,CAAC;OAGF,SAAQ,MAAM,MAAM;IAE1B;AACF,eAAa;AACT,eAAY;AACZ,OAAI,UAAU;AACV,wBAAoB,aAAa,MAAM,GAAG;AAC1C,QAAI,MAAM,UACN,UAAS,SAAS;QAGlB,UAAS,SAAS;;;IAI/B,EAAE,CAAC;AACN,4CAAgC;AAC5B,MAAI,YACA,aAAY,SAAS,MAAM;GAEjC;AACF,qBAAoB,WAAW,aAAa,KAAK,CAAC,YAAY,CAAC;CAC/D,MAAM,QAAQ,eAAe;EACzB,UAAU;EACV,OAAO;EACP,QAAQ;EACR,GAAG,MAAM;EACZ,GAAG,CAAC,MAAM,MAAM,CAAC;CAClB,MAAM,wBAAwB,EAC1B,QAAQ,QACX;AACD,QAAQD,QAAM,cAAc,OAAO;EAAE,IAAI,MAAM;EAAI,KAAK;EAAqB;EAAO,EAAE,eAAgBA,QAAM,cAAc,WAAW,UAAU,EAAE,OAAO,cAAc,EAClKA,QAAM,cAAc,OAAO;EAAE,qBAAqB;EAAI,OAAO;EAAuB,EAAE,MAAM,SAAS,CAAC,CAAE;;AAEhH,MAAa,MAAMA,QAAM,WAAW,KAAK"}