@accelint/map-toolkit 0.4.0 → 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.
- package/CHANGELOG.md +52 -24
- package/README.md +3 -0
- package/catalog-info.yaml +6 -7
- package/dist/_virtual/rolldown_runtime.js +22 -0
- package/dist/camera/events.d.ts +15 -0
- package/dist/camera/events.js +29 -0
- package/dist/camera/events.js.map +1 -0
- package/dist/camera/index.d.ts +16 -0
- package/dist/camera/index.js +17 -0
- package/dist/camera/types.d.ts +84 -0
- package/dist/camera/types.js +12 -0
- package/dist/camera/use-camera-state.d.ts +153 -0
- package/dist/camera/use-camera-state.js +419 -0
- package/dist/camera/use-camera-state.js.map +1 -0
- package/dist/cursor-coordinates/use-cursor-coordinates.js +1 -1
- package/dist/deckgl/base-map/constants.d.ts +6 -1
- package/dist/deckgl/base-map/constants.js +6 -1
- package/dist/deckgl/base-map/constants.js.map +1 -1
- package/dist/deckgl/base-map/controls.d.ts +34 -0
- package/dist/deckgl/base-map/controls.js +50 -0
- package/dist/deckgl/base-map/controls.js.map +1 -0
- package/dist/deckgl/base-map/events.d.ts +4 -0
- package/dist/deckgl/base-map/events.js +5 -1
- package/dist/deckgl/base-map/events.js.map +1 -1
- package/dist/deckgl/base-map/index.d.ts +8 -23
- package/dist/deckgl/base-map/index.js +82 -42
- package/dist/deckgl/base-map/index.js.map +1 -1
- package/dist/deckgl/base-map/provider.d.ts +2 -2
- package/dist/deckgl/base-map/types.d.ts +43 -2
- package/dist/deckgl/index.d.ts +5 -4
- package/dist/deckgl/index.js +2 -1
- package/dist/deckgl/saved-viewports/index.d.ts +32 -0
- package/dist/deckgl/saved-viewports/index.js +52 -0
- package/dist/deckgl/saved-viewports/index.js.map +1 -0
- package/dist/deckgl/saved-viewports/storage.d.ts +21 -0
- package/dist/deckgl/saved-viewports/storage.js +39 -0
- package/dist/deckgl/saved-viewports/storage.js.map +1 -0
- package/dist/maplibre/hooks/use-maplibre.d.ts +2 -2
- package/dist/maplibre/hooks/use-maplibre.js +2 -2
- package/dist/maplibre/hooks/use-maplibre.js.map +1 -1
- package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js +21 -0
- package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/assert.js.map +1 -0
- package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/fit-bounds.js +63 -0
- 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
- 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
- package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/get-bounds.js +20 -0
- 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
- package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/index.js +19 -0
- package/dist/node_modules/.pnpm/@math.gl_web-mercator@4.1.0/node_modules/@math.gl/web-mercator/dist/math-utils.js +25 -0
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js +812 -0
- package/dist/node_modules/.pnpm/immer@10.2.0/node_modules/immer/dist/immer.js.map +1 -0
- package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js +35 -0
- package/dist/node_modules/.pnpm/radashi@12.7.1/node_modules/radashi/dist/radashi.js.map +1 -0
- 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
- 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
- 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
- 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
- package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js +39 -0
- package/dist/node_modules/.pnpm/react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js.map +1 -0
- 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
- 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
- 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
- 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
- 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
- package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js +78 -0
- package/dist/packages/hotkey-manager/dist/actions/register-hotkey/index.js.map +1 -0
- package/dist/packages/hotkey-manager/dist/constants.js +47 -0
- package/dist/packages/hotkey-manager/dist/constants.js.map +1 -0
- package/dist/packages/hotkey-manager/dist/enums/keycode.js +130 -0
- package/dist/packages/hotkey-manager/dist/enums/keycode.js.map +1 -0
- package/dist/packages/hotkey-manager/dist/lib/is-client/index.js +22 -0
- package/dist/packages/hotkey-manager/dist/lib/is-client/index.js.map +1 -0
- package/dist/packages/hotkey-manager/dist/lib/is-mac/index.js +24 -0
- package/dist/packages/hotkey-manager/dist/lib/is-mac/index.js.map +1 -0
- package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js +39 -0
- package/dist/packages/hotkey-manager/dist/lib/key-to-id/index.js.map +1 -0
- package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js +27 -0
- package/dist/packages/hotkey-manager/dist/lib/key-to-string/index.js.map +1 -0
- package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js +95 -0
- package/dist/packages/hotkey-manager/dist/stores/hotkey-store/index.js.map +1 -0
- package/package.json +98 -85
|
@@ -0,0 +1,88 @@
|
|
|
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 { arePointsEqual } from "../utils/deep-equal.js";
|
|
15
|
+
import { MapContext } from "./map.js";
|
|
16
|
+
import { require_react_dom } from "../../../../../../react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js";
|
|
17
|
+
import { applyReactStyle } from "../utils/apply-react-style.js";
|
|
18
|
+
import { compareClassNames } from "../utils/compare-class-names.js";
|
|
19
|
+
import * as React$1 from "react";
|
|
20
|
+
import { forwardRef, memo, useContext, useEffect, useImperativeHandle, useMemo, useRef } 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/marker.js
|
|
23
|
+
var import_react_dom = require_react_dom();
|
|
24
|
+
const Marker = memo(forwardRef((props, ref) => {
|
|
25
|
+
const { map, mapLib } = useContext(MapContext);
|
|
26
|
+
const thisRef = useRef({ props });
|
|
27
|
+
const marker = useMemo(() => {
|
|
28
|
+
let hasChildren = false;
|
|
29
|
+
React$1.Children.forEach(props.children, (el) => {
|
|
30
|
+
if (el) hasChildren = true;
|
|
31
|
+
});
|
|
32
|
+
const options = {
|
|
33
|
+
...props,
|
|
34
|
+
element: hasChildren ? document.createElement("div") : void 0
|
|
35
|
+
};
|
|
36
|
+
const mk = new mapLib.Marker(options);
|
|
37
|
+
mk.setLngLat([props.longitude, props.latitude]);
|
|
38
|
+
mk.getElement().addEventListener("click", (e) => {
|
|
39
|
+
thisRef.current.props.onClick?.({
|
|
40
|
+
type: "click",
|
|
41
|
+
target: mk,
|
|
42
|
+
originalEvent: e
|
|
43
|
+
});
|
|
44
|
+
});
|
|
45
|
+
mk.on("dragstart", (e) => {
|
|
46
|
+
const evt = e;
|
|
47
|
+
evt.lngLat = marker.getLngLat();
|
|
48
|
+
thisRef.current.props.onDragStart?.(evt);
|
|
49
|
+
});
|
|
50
|
+
mk.on("drag", (e) => {
|
|
51
|
+
const evt = e;
|
|
52
|
+
evt.lngLat = marker.getLngLat();
|
|
53
|
+
thisRef.current.props.onDrag?.(evt);
|
|
54
|
+
});
|
|
55
|
+
mk.on("dragend", (e) => {
|
|
56
|
+
const evt = e;
|
|
57
|
+
evt.lngLat = marker.getLngLat();
|
|
58
|
+
thisRef.current.props.onDragEnd?.(evt);
|
|
59
|
+
});
|
|
60
|
+
return mk;
|
|
61
|
+
}, []);
|
|
62
|
+
useEffect(() => {
|
|
63
|
+
marker.addTo(map.getMap());
|
|
64
|
+
return () => {
|
|
65
|
+
marker.remove();
|
|
66
|
+
};
|
|
67
|
+
}, []);
|
|
68
|
+
const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = "auto", pitchAlignment = "auto" } = props;
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
applyReactStyle(marker.getElement(), style);
|
|
71
|
+
}, [style]);
|
|
72
|
+
useImperativeHandle(ref, () => marker, []);
|
|
73
|
+
const oldProps = thisRef.current.props;
|
|
74
|
+
if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) marker.setLngLat([longitude, latitude]);
|
|
75
|
+
if (offset && !arePointsEqual(marker.getOffset(), offset)) marker.setOffset(offset);
|
|
76
|
+
if (marker.isDraggable() !== draggable) marker.setDraggable(draggable);
|
|
77
|
+
if (marker.getRotation() !== rotation) marker.setRotation(rotation);
|
|
78
|
+
if (marker.getRotationAlignment() !== rotationAlignment) marker.setRotationAlignment(rotationAlignment);
|
|
79
|
+
if (marker.getPitchAlignment() !== pitchAlignment) marker.setPitchAlignment(pitchAlignment);
|
|
80
|
+
if (marker.getPopup() !== popup) marker.setPopup(popup);
|
|
81
|
+
const classNameDiff = compareClassNames(oldProps.className, props.className);
|
|
82
|
+
if (classNameDiff) for (const c of classNameDiff) marker.toggleClassName(c);
|
|
83
|
+
thisRef.current.props = props;
|
|
84
|
+
return (0, import_react_dom.createPortal)(props.children, marker.getElement());
|
|
85
|
+
}));
|
|
86
|
+
|
|
87
|
+
//#endregion
|
|
88
|
+
//# sourceMappingURL=marker.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"marker.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/marker.js"],"sourcesContent":["/* global document */\nimport * as React from 'react';\nimport { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { MapContext } from \"./map.js\";\nimport { arePointsEqual } from \"../utils/deep-equal.js\";\nimport { compareClassNames } from \"../utils/compare-class-names.js\";\n/* eslint-disable complexity,max-statements */\nexport const Marker = memo(forwardRef((props, ref) => {\n const { map, mapLib } = useContext(MapContext);\n const thisRef = useRef({ props });\n const marker = useMemo(() => {\n let hasChildren = false;\n React.Children.forEach(props.children, el => {\n if (el) {\n hasChildren = true;\n }\n });\n const options = {\n ...props,\n element: hasChildren ? document.createElement('div') : undefined\n };\n const mk = new mapLib.Marker(options);\n mk.setLngLat([props.longitude, props.latitude]);\n mk.getElement().addEventListener('click', (e) => {\n thisRef.current.props.onClick?.({\n type: 'click',\n target: mk,\n originalEvent: e\n });\n });\n mk.on('dragstart', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDragStart?.(evt);\n });\n mk.on('drag', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDrag?.(evt);\n });\n mk.on('dragend', e => {\n const evt = e;\n evt.lngLat = marker.getLngLat();\n thisRef.current.props.onDragEnd?.(evt);\n });\n return mk;\n }, []);\n useEffect(() => {\n marker.addTo(map.getMap());\n return () => {\n marker.remove();\n };\n }, []);\n const { longitude, latitude, offset, style, draggable = false, popup = null, rotation = 0, rotationAlignment = 'auto', pitchAlignment = 'auto' } = props;\n useEffect(() => {\n applyReactStyle(marker.getElement(), style);\n }, [style]);\n useImperativeHandle(ref, () => marker, []);\n const oldProps = thisRef.current.props;\n if (marker.getLngLat().lng !== longitude || marker.getLngLat().lat !== latitude) {\n marker.setLngLat([longitude, latitude]);\n }\n if (offset && !arePointsEqual(marker.getOffset(), offset)) {\n marker.setOffset(offset);\n }\n if (marker.isDraggable() !== draggable) {\n marker.setDraggable(draggable);\n }\n if (marker.getRotation() !== rotation) {\n marker.setRotation(rotation);\n }\n if (marker.getRotationAlignment() !== rotationAlignment) {\n marker.setRotationAlignment(rotationAlignment);\n }\n if (marker.getPitchAlignment() !== pitchAlignment) {\n marker.setPitchAlignment(pitchAlignment);\n }\n if (marker.getPopup() !== popup) {\n marker.setPopup(popup);\n }\n const classNameDiff = compareClassNames(oldProps.className, props.className);\n if (classNameDiff) {\n for (const c of classNameDiff) {\n marker.toggleClassName(c);\n }\n }\n thisRef.current.props = props;\n return createPortal(props.children, marker.getElement());\n}));\n//# sourceMappingURL=marker.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AASA,MAAa,SAAS,KAAK,YAAY,OAAO,QAAQ;CAClD,MAAM,EAAE,KAAK,WAAW,WAAW,WAAW;CAC9C,MAAM,UAAU,OAAO,EAAE,OAAO,CAAC;CACjC,MAAM,SAAS,cAAc;EACzB,IAAI,cAAc;AAClB,UAAM,SAAS,QAAQ,MAAM,WAAU,OAAM;AACzC,OAAI,GACA,eAAc;IAEpB;EACF,MAAM,UAAU;GACZ,GAAG;GACH,SAAS,cAAc,SAAS,cAAc,MAAM,GAAG;GAC1D;EACD,MAAM,KAAK,IAAI,OAAO,OAAO,QAAQ;AACrC,KAAG,UAAU,CAAC,MAAM,WAAW,MAAM,SAAS,CAAC;AAC/C,KAAG,YAAY,CAAC,iBAAiB,UAAU,MAAM;AAC7C,WAAQ,QAAQ,MAAM,UAAU;IAC5B,MAAM;IACN,QAAQ;IACR,eAAe;IAClB,CAAC;IACJ;AACF,KAAG,GAAG,cAAa,MAAK;GACpB,MAAM,MAAM;AACZ,OAAI,SAAS,OAAO,WAAW;AAC/B,WAAQ,QAAQ,MAAM,cAAc,IAAI;IAC1C;AACF,KAAG,GAAG,SAAQ,MAAK;GACf,MAAM,MAAM;AACZ,OAAI,SAAS,OAAO,WAAW;AAC/B,WAAQ,QAAQ,MAAM,SAAS,IAAI;IACrC;AACF,KAAG,GAAG,YAAW,MAAK;GAClB,MAAM,MAAM;AACZ,OAAI,SAAS,OAAO,WAAW;AAC/B,WAAQ,QAAQ,MAAM,YAAY,IAAI;IACxC;AACF,SAAO;IACR,EAAE,CAAC;AACN,iBAAgB;AACZ,SAAO,MAAM,IAAI,QAAQ,CAAC;AAC1B,eAAa;AACT,UAAO,QAAQ;;IAEpB,EAAE,CAAC;CACN,MAAM,EAAE,WAAW,UAAU,QAAQ,OAAO,YAAY,OAAO,QAAQ,MAAM,WAAW,GAAG,oBAAoB,QAAQ,iBAAiB,WAAW;AACnJ,iBAAgB;AACZ,kBAAgB,OAAO,YAAY,EAAE,MAAM;IAC5C,CAAC,MAAM,CAAC;AACX,qBAAoB,WAAW,QAAQ,EAAE,CAAC;CAC1C,MAAM,WAAW,QAAQ,QAAQ;AACjC,KAAI,OAAO,WAAW,CAAC,QAAQ,aAAa,OAAO,WAAW,CAAC,QAAQ,SACnE,QAAO,UAAU,CAAC,WAAW,SAAS,CAAC;AAE3C,KAAI,UAAU,CAAC,eAAe,OAAO,WAAW,EAAE,OAAO,CACrD,QAAO,UAAU,OAAO;AAE5B,KAAI,OAAO,aAAa,KAAK,UACzB,QAAO,aAAa,UAAU;AAElC,KAAI,OAAO,aAAa,KAAK,SACzB,QAAO,YAAY,SAAS;AAEhC,KAAI,OAAO,sBAAsB,KAAK,kBAClC,QAAO,qBAAqB,kBAAkB;AAElD,KAAI,OAAO,mBAAmB,KAAK,eAC/B,QAAO,kBAAkB,eAAe;AAE5C,KAAI,OAAO,UAAU,KAAK,MACtB,QAAO,SAAS,MAAM;CAE1B,MAAM,gBAAgB,kBAAkB,SAAS,WAAW,MAAM,UAAU;AAC5E,KAAI,cACA,MAAK,MAAM,KAAK,cACZ,QAAO,gBAAgB,EAAE;AAGjC,SAAQ,QAAQ,QAAQ;AACxB,2CAAoB,MAAM,UAAU,OAAO,YAAY,CAAC;EAC1D,CAAC"}
|
|
@@ -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/navigation-control.js
|
|
19
|
+
function _NavigationControl(props) {
|
|
20
|
+
const ctrl = useControl(({ mapLib }) => new mapLib.NavigationControl(props), { position: props.position });
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
applyReactStyle(ctrl._container, props.style);
|
|
23
|
+
}, [props.style]);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const NavigationControl = memo(_NavigationControl);
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=navigation-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation-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/navigation-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _NavigationControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.NavigationControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport const NavigationControl = memo(_NavigationControl);\n//# sourceMappingURL=navigation-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,SAAS,mBAAmB,OAAO;CAC/B,MAAM,OAAO,YAAY,EAAE,aAAa,IAAI,OAAO,kBAAkB,MAAM,EAAE,EACzE,UAAU,MAAM,UACnB,CAAC;AACF,iBAAgB;AACZ,kBAAgB,KAAK,YAAY,MAAM,MAAM;IAC9C,CAAC,MAAM,MAAM,CAAC;AACjB,QAAO;;AAEX,MAAa,oBAAoB,KAAK,mBAAmB"}
|
|
@@ -0,0 +1,69 @@
|
|
|
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 { deepEqual } from "../utils/deep-equal.js";
|
|
15
|
+
import { MapContext } from "./map.js";
|
|
16
|
+
import { require_react_dom } from "../../../../../../react-dom@19.2.3_react@19.2.3/node_modules/react-dom/index.js";
|
|
17
|
+
import { applyReactStyle } from "../utils/apply-react-style.js";
|
|
18
|
+
import { compareClassNames } from "../utils/compare-class-names.js";
|
|
19
|
+
import { forwardRef, memo, useContext, useEffect, useImperativeHandle, useMemo, useRef } from "react";
|
|
20
|
+
|
|
21
|
+
//#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/popup.js
|
|
22
|
+
var import_react_dom = require_react_dom();
|
|
23
|
+
const Popup = memo(forwardRef((props, ref) => {
|
|
24
|
+
const { map, mapLib } = useContext(MapContext);
|
|
25
|
+
const container = useMemo(() => {
|
|
26
|
+
return document.createElement("div");
|
|
27
|
+
}, []);
|
|
28
|
+
const thisRef = useRef({ props });
|
|
29
|
+
const popup = useMemo(() => {
|
|
30
|
+
const options = { ...props };
|
|
31
|
+
const pp = new mapLib.Popup(options);
|
|
32
|
+
pp.setLngLat([props.longitude, props.latitude]);
|
|
33
|
+
pp.once("open", (e) => {
|
|
34
|
+
thisRef.current.props.onOpen?.(e);
|
|
35
|
+
});
|
|
36
|
+
return pp;
|
|
37
|
+
}, []);
|
|
38
|
+
useEffect(() => {
|
|
39
|
+
const onClose = (e) => {
|
|
40
|
+
thisRef.current.props.onClose?.(e);
|
|
41
|
+
};
|
|
42
|
+
popup.on("close", onClose);
|
|
43
|
+
popup.setDOMContent(container).addTo(map.getMap());
|
|
44
|
+
return () => {
|
|
45
|
+
popup.off("close", onClose);
|
|
46
|
+
if (popup.isOpen()) popup.remove();
|
|
47
|
+
};
|
|
48
|
+
}, []);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
applyReactStyle(popup.getElement(), props.style);
|
|
51
|
+
}, [props.style]);
|
|
52
|
+
useImperativeHandle(ref, () => popup, []);
|
|
53
|
+
if (popup.isOpen()) {
|
|
54
|
+
const oldProps = thisRef.current.props;
|
|
55
|
+
if (popup.getLngLat().lng !== props.longitude || popup.getLngLat().lat !== props.latitude) popup.setLngLat([props.longitude, props.latitude]);
|
|
56
|
+
if (props.offset && !deepEqual(oldProps.offset, props.offset)) popup.setOffset(props.offset);
|
|
57
|
+
if (oldProps.anchor !== props.anchor || oldProps.maxWidth !== props.maxWidth) {
|
|
58
|
+
popup.options.anchor = props.anchor;
|
|
59
|
+
popup.setMaxWidth(props.maxWidth);
|
|
60
|
+
}
|
|
61
|
+
const classNameDiff = compareClassNames(oldProps.className, props.className);
|
|
62
|
+
if (classNameDiff) for (const c of classNameDiff) popup.toggleClassName(c);
|
|
63
|
+
thisRef.current.props = props;
|
|
64
|
+
}
|
|
65
|
+
return (0, import_react_dom.createPortal)(props.children, container);
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
//#endregion
|
|
69
|
+
//# sourceMappingURL=popup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popup.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/popup.js"],"sourcesContent":["import { createPortal } from 'react-dom';\nimport { useImperativeHandle, useEffect, useMemo, useRef, useContext, forwardRef, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { MapContext } from \"./map.js\";\nimport { deepEqual } from \"../utils/deep-equal.js\";\nimport { compareClassNames } from \"../utils/compare-class-names.js\";\n/* eslint-disable complexity,max-statements */\nexport const Popup = memo(forwardRef((props, ref) => {\n const { map, mapLib } = useContext(MapContext);\n const container = useMemo(() => {\n return document.createElement('div');\n }, []);\n const thisRef = useRef({ props });\n const popup = useMemo(() => {\n const options = { ...props };\n const pp = new mapLib.Popup(options);\n pp.setLngLat([props.longitude, props.latitude]);\n pp.once('open', e => {\n thisRef.current.props.onOpen?.(e);\n });\n return pp;\n }, []);\n useEffect(() => {\n const onClose = e => {\n thisRef.current.props.onClose?.(e);\n };\n popup.on('close', onClose);\n popup.setDOMContent(container).addTo(map.getMap());\n return () => {\n // https://github.com/visgl/react-map-gl/issues/1825\n // onClose should not be fired if the popup is removed by unmounting\n // When using React strict mode, the component is mounted twice.\n // Firing the onClose callback here would be a false signal to remove the component.\n popup.off('close', onClose);\n if (popup.isOpen()) {\n popup.remove();\n }\n };\n }, []);\n useEffect(() => {\n applyReactStyle(popup.getElement(), props.style);\n }, [props.style]);\n useImperativeHandle(ref, () => popup, []);\n if (popup.isOpen()) {\n const oldProps = thisRef.current.props;\n if (popup.getLngLat().lng !== props.longitude || popup.getLngLat().lat !== props.latitude) {\n popup.setLngLat([props.longitude, props.latitude]);\n }\n if (props.offset && !deepEqual(oldProps.offset, props.offset)) {\n popup.setOffset(props.offset);\n }\n if (oldProps.anchor !== props.anchor || oldProps.maxWidth !== props.maxWidth) {\n popup.options.anchor = props.anchor;\n popup.setMaxWidth(props.maxWidth);\n }\n const classNameDiff = compareClassNames(oldProps.className, props.className);\n if (classNameDiff) {\n for (const c of classNameDiff) {\n popup.toggleClassName(c);\n }\n }\n thisRef.current.props = props;\n }\n return createPortal(props.children, container);\n}));\n//# sourceMappingURL=popup.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAOA,MAAa,QAAQ,KAAK,YAAY,OAAO,QAAQ;CACjD,MAAM,EAAE,KAAK,WAAW,WAAW,WAAW;CAC9C,MAAM,YAAY,cAAc;AAC5B,SAAO,SAAS,cAAc,MAAM;IACrC,EAAE,CAAC;CACN,MAAM,UAAU,OAAO,EAAE,OAAO,CAAC;CACjC,MAAM,QAAQ,cAAc;EACxB,MAAM,UAAU,EAAE,GAAG,OAAO;EAC5B,MAAM,KAAK,IAAI,OAAO,MAAM,QAAQ;AACpC,KAAG,UAAU,CAAC,MAAM,WAAW,MAAM,SAAS,CAAC;AAC/C,KAAG,KAAK,SAAQ,MAAK;AACjB,WAAQ,QAAQ,MAAM,SAAS,EAAE;IACnC;AACF,SAAO;IACR,EAAE,CAAC;AACN,iBAAgB;EACZ,MAAM,WAAU,MAAK;AACjB,WAAQ,QAAQ,MAAM,UAAU,EAAE;;AAEtC,QAAM,GAAG,SAAS,QAAQ;AAC1B,QAAM,cAAc,UAAU,CAAC,MAAM,IAAI,QAAQ,CAAC;AAClD,eAAa;AAKT,SAAM,IAAI,SAAS,QAAQ;AAC3B,OAAI,MAAM,QAAQ,CACd,OAAM,QAAQ;;IAGvB,EAAE,CAAC;AACN,iBAAgB;AACZ,kBAAgB,MAAM,YAAY,EAAE,MAAM,MAAM;IACjD,CAAC,MAAM,MAAM,CAAC;AACjB,qBAAoB,WAAW,OAAO,EAAE,CAAC;AACzC,KAAI,MAAM,QAAQ,EAAE;EAChB,MAAM,WAAW,QAAQ,QAAQ;AACjC,MAAI,MAAM,WAAW,CAAC,QAAQ,MAAM,aAAa,MAAM,WAAW,CAAC,QAAQ,MAAM,SAC7E,OAAM,UAAU,CAAC,MAAM,WAAW,MAAM,SAAS,CAAC;AAEtD,MAAI,MAAM,UAAU,CAAC,UAAU,SAAS,QAAQ,MAAM,OAAO,CACzD,OAAM,UAAU,MAAM,OAAO;AAEjC,MAAI,SAAS,WAAW,MAAM,UAAU,SAAS,aAAa,MAAM,UAAU;AAC1E,SAAM,QAAQ,SAAS,MAAM;AAC7B,SAAM,YAAY,MAAM,SAAS;;EAErC,MAAM,gBAAgB,kBAAkB,SAAS,WAAW,MAAM,UAAU;AAC5E,MAAI,cACA,MAAK,MAAM,KAAK,cACZ,OAAM,gBAAgB,EAAE;AAGhC,UAAQ,QAAQ,QAAQ;;AAE5B,2CAAoB,MAAM,UAAU,UAAU;EAChD,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
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, 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/scale-control.js
|
|
19
|
+
function _ScaleControl(props) {
|
|
20
|
+
const ctrl = useControl(({ mapLib }) => new mapLib.ScaleControl(props), { position: props.position });
|
|
21
|
+
const propsRef = useRef(props);
|
|
22
|
+
const prevProps = propsRef.current;
|
|
23
|
+
propsRef.current = props;
|
|
24
|
+
const { style } = props;
|
|
25
|
+
if (props.maxWidth !== void 0 && props.maxWidth !== prevProps.maxWidth) ctrl.options.maxWidth = props.maxWidth;
|
|
26
|
+
if (props.unit !== void 0 && props.unit !== prevProps.unit) ctrl.setUnit(props.unit);
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
applyReactStyle(ctrl._container, style);
|
|
29
|
+
}, [style]);
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
const ScaleControl = memo(_ScaleControl);
|
|
33
|
+
|
|
34
|
+
//#endregion
|
|
35
|
+
//# sourceMappingURL=scale-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scale-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/scale-control.js"],"sourcesContent":["import { useEffect, useRef, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _ScaleControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.ScaleControl(props), {\n position: props.position\n });\n const propsRef = useRef(props);\n const prevProps = propsRef.current;\n propsRef.current = props;\n const { style } = props;\n if (props.maxWidth !== undefined && props.maxWidth !== prevProps.maxWidth) {\n ctrl.options.maxWidth = props.maxWidth;\n }\n if (props.unit !== undefined && props.unit !== prevProps.unit) {\n ctrl.setUnit(props.unit);\n }\n useEffect(() => {\n applyReactStyle(ctrl._container, style);\n }, [style]);\n return null;\n}\nexport const ScaleControl = memo(_ScaleControl);\n//# sourceMappingURL=scale-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,SAAS,cAAc,OAAO;CAC1B,MAAM,OAAO,YAAY,EAAE,aAAa,IAAI,OAAO,aAAa,MAAM,EAAE,EACpE,UAAU,MAAM,UACnB,CAAC;CACF,MAAM,WAAW,OAAO,MAAM;CAC9B,MAAM,YAAY,SAAS;AAC3B,UAAS,UAAU;CACnB,MAAM,EAAE,UAAU;AAClB,KAAI,MAAM,aAAa,UAAa,MAAM,aAAa,UAAU,SAC7D,MAAK,QAAQ,WAAW,MAAM;AAElC,KAAI,MAAM,SAAS,UAAa,MAAM,SAAS,UAAU,KACrD,MAAK,QAAQ,MAAM,KAAK;AAE5B,iBAAgB;AACZ,kBAAgB,KAAK,YAAY,MAAM;IACxC,CAAC,MAAM,CAAC;AACX,QAAO;;AAEX,MAAa,eAAe,KAAK,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/terrain-control.js
|
|
19
|
+
function _TerrainControl(props) {
|
|
20
|
+
const ctrl = useControl(({ mapLib }) => new mapLib.TerrainControl(props), { position: props.position });
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
applyReactStyle(ctrl._container, props.style);
|
|
23
|
+
}, [props.style]);
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
const TerrainControl = memo(_TerrainControl);
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
//# sourceMappingURL=terrain-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terrain-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/terrain-control.js"],"sourcesContent":["import { useEffect, memo } from 'react';\nimport { applyReactStyle } from \"../utils/apply-react-style.js\";\nimport { useControl } from \"./use-control.js\";\nfunction _TerrainControl(props) {\n const ctrl = useControl(({ mapLib }) => new mapLib.TerrainControl(props), {\n position: props.position\n });\n useEffect(() => {\n applyReactStyle(ctrl._container, props.style);\n }, [props.style]);\n return null;\n}\nexport const TerrainControl = memo(_TerrainControl);\n//# sourceMappingURL=terrain-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,SAAS,gBAAgB,OAAO;CAC5B,MAAM,OAAO,YAAY,EAAE,aAAa,IAAI,OAAO,eAAe,MAAM,EAAE,EACtE,UAAU,MAAM,UACnB,CAAC;AACF,iBAAgB;AACZ,kBAAgB,KAAK,YAAY,MAAM,MAAM;IAC9C,CAAC,MAAM,MAAM,CAAC;AACjB,QAAO;;AAEX,MAAa,iBAAiB,KAAK,gBAAgB"}
|
|
@@ -0,0 +1,40 @@
|
|
|
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 { MapContext } from "./map.js";
|
|
15
|
+
import { useContext, useEffect, useMemo } from "react";
|
|
16
|
+
|
|
17
|
+
//#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/use-control.js
|
|
18
|
+
function useControl(onCreate, arg1, arg2, arg3) {
|
|
19
|
+
const context = useContext(MapContext);
|
|
20
|
+
const ctrl = useMemo(() => onCreate(context), []);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
const opts = arg3 || arg2 || arg1;
|
|
23
|
+
const onAdd = typeof arg1 === "function" && typeof arg2 === "function" ? arg1 : null;
|
|
24
|
+
const onRemove = typeof arg2 === "function" ? arg2 : typeof arg1 === "function" ? arg1 : null;
|
|
25
|
+
const { map } = context;
|
|
26
|
+
if (!map.hasControl(ctrl)) {
|
|
27
|
+
map.addControl(ctrl, opts?.position);
|
|
28
|
+
if (onAdd) onAdd(context);
|
|
29
|
+
}
|
|
30
|
+
return () => {
|
|
31
|
+
if (onRemove) onRemove(context);
|
|
32
|
+
if (map.hasControl(ctrl)) map.removeControl(ctrl);
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
return ctrl;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { useControl };
|
|
40
|
+
//# sourceMappingURL=use-control.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-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/use-control.js"],"sourcesContent":["import { useContext, useMemo, useEffect } from 'react';\nimport { MapContext } from \"./map.js\";\nexport function useControl(onCreate, arg1, arg2, arg3) {\n const context = useContext(MapContext);\n const ctrl = useMemo(() => onCreate(context), []);\n useEffect(() => {\n const opts = (arg3 || arg2 || arg1);\n const onAdd = typeof arg1 === 'function' && typeof arg2 === 'function' ? arg1 : null;\n const onRemove = typeof arg2 === 'function' ? arg2 : typeof arg1 === 'function' ? arg1 : null;\n const { map } = context;\n if (!map.hasControl(ctrl)) {\n map.addControl(ctrl, opts?.position);\n if (onAdd) {\n onAdd(context);\n }\n }\n return () => {\n if (onRemove) {\n onRemove(context);\n }\n // Map might have been removed (parent effects are destroyed before child ones)\n if (map.hasControl(ctrl)) {\n map.removeControl(ctrl);\n }\n };\n }, []);\n return ctrl;\n}\n//# sourceMappingURL=use-control.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;AAEA,SAAgB,WAAW,UAAU,MAAM,MAAM,MAAM;CACnD,MAAM,UAAU,WAAW,WAAW;CACtC,MAAM,OAAO,cAAc,SAAS,QAAQ,EAAE,EAAE,CAAC;AACjD,iBAAgB;EACZ,MAAM,OAAQ,QAAQ,QAAQ;EAC9B,MAAM,QAAQ,OAAO,SAAS,cAAc,OAAO,SAAS,aAAa,OAAO;EAChF,MAAM,WAAW,OAAO,SAAS,aAAa,OAAO,OAAO,SAAS,aAAa,OAAO;EACzF,MAAM,EAAE,QAAQ;AAChB,MAAI,CAAC,IAAI,WAAW,KAAK,EAAE;AACvB,OAAI,WAAW,MAAM,MAAM,SAAS;AACpC,OAAI,MACA,OAAM,QAAQ;;AAGtB,eAAa;AACT,OAAI,SACA,UAAS,QAAQ;AAGrB,OAAI,IAAI,WAAW,KAAK,CACpB,KAAI,cAAc,KAAK;;IAGhC,EAAE,CAAC;AACN,QAAO"}
|
|
@@ -0,0 +1,23 @@
|
|
|
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 * as React$1 from "react";
|
|
16
|
+
import { useCallback, useContext, useMemo, useState } 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/use-map.js
|
|
19
|
+
const MountedMapsContext = React$1.createContext(null);
|
|
20
|
+
|
|
21
|
+
//#endregion
|
|
22
|
+
export { MountedMapsContext };
|
|
23
|
+
//# sourceMappingURL=use-map.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-map.js","names":["React"],"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/use-map.js"],"sourcesContent":["import * as React from 'react';\nimport { useState, useCallback, useMemo, useContext } from 'react';\nimport { MapContext } from \"./map.js\";\nexport const MountedMapsContext = React.createContext(null);\nexport const MapProvider = props => {\n const [maps, setMaps] = useState({});\n const onMapMount = useCallback((map, id = 'default') => {\n setMaps(currMaps => {\n if (id === 'current') {\n throw new Error(\"'current' cannot be used as map id\");\n }\n if (currMaps[id]) {\n throw new Error(`Multiple maps with the same id: ${id}`);\n }\n return { ...currMaps, [id]: map };\n });\n }, []);\n const onMapUnmount = useCallback((id = 'default') => {\n setMaps(currMaps => {\n if (currMaps[id]) {\n const nextMaps = { ...currMaps };\n delete nextMaps[id];\n return nextMaps;\n }\n return currMaps;\n });\n }, []);\n return (React.createElement(MountedMapsContext.Provider, { value: {\n maps,\n onMapMount,\n onMapUnmount\n } }, props.children));\n};\nexport function useMap() {\n const maps = useContext(MountedMapsContext)?.maps;\n const currentMap = useContext(MapContext);\n const mapsWithCurrent = useMemo(() => {\n return { ...maps, current: currentMap?.map };\n }, [maps, currentMap]);\n return mapsWithCurrent;\n}\n//# sourceMappingURL=use-map.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;AAGA,MAAa,qBAAqBA,QAAM,cAAc,KAAK"}
|
|
@@ -0,0 +1,27 @@
|
|
|
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 "./components/use-map.js";
|
|
15
|
+
import { Map } from "./components/map.js";
|
|
16
|
+
import "./components/marker.js";
|
|
17
|
+
import "./components/popup.js";
|
|
18
|
+
import { useControl } from "./components/use-control.js";
|
|
19
|
+
import "./components/attribution-control.js";
|
|
20
|
+
import "./components/fullscreen-control.js";
|
|
21
|
+
import "./components/geolocate-control.js";
|
|
22
|
+
import "./components/navigation-control.js";
|
|
23
|
+
import "./components/scale-control.js";
|
|
24
|
+
import "./components/terrain-control.js";
|
|
25
|
+
import "./components/logo-control.js";
|
|
26
|
+
import "./components/source.js";
|
|
27
|
+
import "./components/layer.js";
|
|
@@ -0,0 +1,57 @@
|
|
|
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/@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
|
|
15
|
+
/** These methods may break the react binding if called directly */
|
|
16
|
+
const skipMethods = [
|
|
17
|
+
"setMaxBounds",
|
|
18
|
+
"setMinZoom",
|
|
19
|
+
"setMaxZoom",
|
|
20
|
+
"setMinPitch",
|
|
21
|
+
"setMaxPitch",
|
|
22
|
+
"setRenderWorldCopies",
|
|
23
|
+
"setProjection",
|
|
24
|
+
"setStyle",
|
|
25
|
+
"addSource",
|
|
26
|
+
"removeSource",
|
|
27
|
+
"addLayer",
|
|
28
|
+
"removeLayer",
|
|
29
|
+
"setLayerZoomRange",
|
|
30
|
+
"setFilter",
|
|
31
|
+
"setPaintProperty",
|
|
32
|
+
"setLayoutProperty",
|
|
33
|
+
"setLight",
|
|
34
|
+
"setTerrain",
|
|
35
|
+
"setFog",
|
|
36
|
+
"remove"
|
|
37
|
+
];
|
|
38
|
+
function createRef(mapInstance) {
|
|
39
|
+
if (!mapInstance) return null;
|
|
40
|
+
const map = mapInstance.map;
|
|
41
|
+
const result = { getMap: () => map };
|
|
42
|
+
for (const key of getMethodNames(map)) if (!(key in result) && !skipMethods.includes(key)) result[key] = map[key].bind(map);
|
|
43
|
+
return result;
|
|
44
|
+
}
|
|
45
|
+
function getMethodNames(obj) {
|
|
46
|
+
const result = /* @__PURE__ */ new Set();
|
|
47
|
+
let proto = obj;
|
|
48
|
+
while (proto) {
|
|
49
|
+
for (const key of Object.getOwnPropertyNames(proto)) if (key[0] !== "_" && typeof obj[key] === "function" && key !== "fire" && key !== "setEventedParent") result.add(key);
|
|
50
|
+
proto = Object.getPrototypeOf(proto);
|
|
51
|
+
}
|
|
52
|
+
return Array.from(result);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
//#endregion
|
|
56
|
+
export { createRef as default };
|
|
57
|
+
//# sourceMappingURL=create-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-ref.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/maplibre/create-ref.js"],"sourcesContent":["/** These methods may break the react binding if called directly */\nconst skipMethods = [\n 'setMaxBounds',\n 'setMinZoom',\n 'setMaxZoom',\n 'setMinPitch',\n 'setMaxPitch',\n 'setRenderWorldCopies',\n 'setProjection',\n 'setStyle',\n 'addSource',\n 'removeSource',\n 'addLayer',\n 'removeLayer',\n 'setLayerZoomRange',\n 'setFilter',\n 'setPaintProperty',\n 'setLayoutProperty',\n 'setLight',\n 'setTerrain',\n 'setFog',\n 'remove'\n];\nexport default function createRef(mapInstance) {\n if (!mapInstance) {\n return null;\n }\n const map = mapInstance.map;\n const result = {\n getMap: () => map\n };\n for (const key of getMethodNames(map)) {\n // @ts-expect-error\n if (!(key in result) && !skipMethods.includes(key)) {\n result[key] = map[key].bind(map);\n }\n }\n return result;\n}\nfunction getMethodNames(obj) {\n const result = new Set();\n let proto = obj;\n while (proto) {\n for (const key of Object.getOwnPropertyNames(proto)) {\n if (key[0] !== '_' &&\n typeof obj[key] === 'function' &&\n key !== 'fire' &&\n key !== 'setEventedParent') {\n result.add(key);\n }\n }\n proto = Object.getPrototypeOf(proto);\n }\n return Array.from(result);\n}\n//# sourceMappingURL=create-ref.js.map"],"x_google_ignoreList":[0],"mappings":";;;;;;;;;;;;;;;AACA,MAAM,cAAc;CAChB;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACH;AACD,SAAwB,UAAU,aAAa;AAC3C,KAAI,CAAC,YACD,QAAO;CAEX,MAAM,MAAM,YAAY;CACxB,MAAM,SAAS,EACX,cAAc,KACjB;AACD,MAAK,MAAM,OAAO,eAAe,IAAI,CAEjC,KAAI,EAAE,OAAO,WAAW,CAAC,YAAY,SAAS,IAAI,CAC9C,QAAO,OAAO,IAAI,KAAK,KAAK,IAAI;AAGxC,QAAO;;AAEX,SAAS,eAAe,KAAK;CACzB,MAAM,yBAAS,IAAI,KAAK;CACxB,IAAI,QAAQ;AACZ,QAAO,OAAO;AACV,OAAK,MAAM,OAAO,OAAO,oBAAoB,MAAM,CAC/C,KAAI,IAAI,OAAO,OACX,OAAO,IAAI,SAAS,cACpB,QAAQ,UACR,QAAQ,mBACR,QAAO,IAAI,IAAI;AAGvB,UAAQ,OAAO,eAAe,MAAM;;AAExC,QAAO,MAAM,KAAK,OAAO"}
|