react-three-map 0.8.0 → 0.8.2
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 +15 -0
- package/README.md +62 -23
- package/dist/cjs/main.js +55 -18
- package/dist/es/main.mjs +6 -3
- package/dist/es/main.mjs.map +1 -1
- package/dist/es/main10.mjs +8 -33
- package/dist/es/main10.mjs.map +1 -1
- package/dist/es/main11.mjs +33 -11
- package/dist/es/main11.mjs.map +1 -1
- package/dist/es/main12.mjs +11 -22
- package/dist/es/main12.mjs.map +1 -1
- package/dist/es/main13.mjs +17 -24
- package/dist/es/main13.mjs.map +1 -1
- package/dist/es/main14.mjs +2 -23
- package/dist/es/main14.mjs.map +1 -1
- package/dist/es/main15.mjs +28 -93
- package/dist/es/main15.mjs.map +1 -1
- package/dist/es/main16.mjs +21 -61
- package/dist/es/main16.mjs.map +1 -1
- package/dist/es/main17.mjs +94 -19
- package/dist/es/main17.mjs.map +1 -1
- package/dist/es/main18.mjs +62 -23
- package/dist/es/main18.mjs.map +1 -1
- package/dist/es/main19.mjs +17 -13
- package/dist/es/main19.mjs.map +1 -1
- package/dist/es/main20.mjs +23 -68
- package/dist/es/main20.mjs.map +1 -1
- package/dist/es/main21.mjs +19 -0
- package/dist/es/main21.mjs.map +1 -0
- package/dist/es/main22.mjs +83 -0
- package/dist/es/main22.mjs.map +1 -0
- package/dist/es/main3.mjs +3 -3
- package/dist/es/main3.mjs.map +1 -1
- package/dist/es/main4.mjs +3 -3
- package/dist/es/main5.mjs +32 -19
- package/dist/es/main5.mjs.map +1 -1
- package/dist/es/main6.mjs +19 -15
- package/dist/es/main6.mjs.map +1 -1
- package/dist/es/main7.mjs +10 -22
- package/dist/es/main7.mjs.map +1 -1
- package/dist/es/main8.mjs +22 -26
- package/dist/es/main8.mjs.map +1 -1
- package/dist/es/main9.mjs +26 -8
- package/dist/es/main9.mjs.map +1 -1
- package/dist/maplibre/cjs/main.js +55 -18
- package/dist/maplibre/es/main.mjs +6 -3
- package/dist/maplibre/es/main.mjs.map +1 -1
- package/dist/maplibre/es/main10.mjs +8 -33
- package/dist/maplibre/es/main10.mjs.map +1 -1
- package/dist/maplibre/es/main11.mjs +33 -11
- package/dist/maplibre/es/main11.mjs.map +1 -1
- package/dist/maplibre/es/main12.mjs +11 -22
- package/dist/maplibre/es/main12.mjs.map +1 -1
- package/dist/maplibre/es/main13.mjs +17 -24
- package/dist/maplibre/es/main13.mjs.map +1 -1
- package/dist/maplibre/es/main14.mjs +2 -23
- package/dist/maplibre/es/main14.mjs.map +1 -1
- package/dist/maplibre/es/main15.mjs +28 -93
- package/dist/maplibre/es/main15.mjs.map +1 -1
- package/dist/maplibre/es/main16.mjs +21 -61
- package/dist/maplibre/es/main16.mjs.map +1 -1
- package/dist/maplibre/es/main17.mjs +94 -19
- package/dist/maplibre/es/main17.mjs.map +1 -1
- package/dist/maplibre/es/main18.mjs +62 -23
- package/dist/maplibre/es/main18.mjs.map +1 -1
- package/dist/maplibre/es/main19.mjs +17 -13
- package/dist/maplibre/es/main19.mjs.map +1 -1
- package/dist/maplibre/es/main20.mjs +23 -68
- package/dist/maplibre/es/main20.mjs.map +1 -1
- package/dist/maplibre/es/main21.mjs +19 -0
- package/dist/maplibre/es/main21.mjs.map +1 -0
- package/dist/maplibre/es/main22.mjs +83 -0
- package/dist/maplibre/es/main22.mjs.map +1 -0
- package/dist/maplibre/es/main3.mjs +3 -3
- package/dist/maplibre/es/main3.mjs.map +1 -1
- package/dist/maplibre/es/main4.mjs +3 -3
- package/dist/maplibre/es/main5.mjs +32 -19
- package/dist/maplibre/es/main5.mjs.map +1 -1
- package/dist/maplibre/es/main6.mjs +19 -15
- package/dist/maplibre/es/main6.mjs.map +1 -1
- package/dist/maplibre/es/main7.mjs +10 -22
- package/dist/maplibre/es/main7.mjs.map +1 -1
- package/dist/maplibre/es/main8.mjs +22 -26
- package/dist/maplibre/es/main8.mjs.map +1 -1
- package/dist/maplibre/es/main9.mjs +26 -8
- package/dist/maplibre/es/main9.mjs.map +1 -1
- package/dist/maplibre/types/api/coords-to-vector-3.d.ts +3 -3
- package/dist/maplibre/types/api/index.d.ts +2 -1
- package/dist/maplibre/types/api/vector-3-to-coords.d.ts +3 -0
- package/dist/maplibre/types/core/canvas-overlay/sync-camera-fc.d.ts +2 -1
- package/dist/maplibre/types/core/earth-radius.d.ts +1 -0
- package/dist/types/api/coords-to-vector-3.d.ts +3 -3
- package/dist/types/api/index.d.ts +2 -1
- package/dist/types/api/vector-3-to-coords.d.ts +3 -0
- package/dist/types/core/canvas-overlay/sync-camera-fc.d.ts +2 -1
- package/dist/types/core/earth-radius.d.ts +1 -0
- package/made-with/studio-carto-urban-project.webp +0 -0
- package/package.json +6 -9
- package/stories/package.json +5 -5
- package/stories/yarn.lock +1935 -1089
- package/vitest.config.ts +1 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"main22.mjs","sources":["../../../src/core/canvas-overlay/sync-camera-fc.tsx"],"sourcesContent":["import { useFrame, useThree } from \"@react-three/fiber\";\nimport { memo, useEffect, useLayoutEffect, useMemo, useRef } from \"react\";\nimport { Matrix4Tuple, PerspectiveCamera } from \"three\";\nimport { Coords } from \"../../api/coords\";\nimport { MapInstance } from \"../generic-map\";\nimport { syncCamera } from \"../sync-camera\";\nimport { useCoordsToMatrix } from \"../use-coords-to-matrix\";\nimport { useFunction } from \"../use-function\";\nimport { useR3M } from \"../use-r3m\";\n\ninterface SyncCameraFCProps extends Coords {\n setOnRender?: (callback: () => (mx: Matrix4Tuple) => void) => void,\n /** on `useFrame` it will manually render (used by `<Coordinates>`) */\n manualRender?: boolean,\n onReady?: () => void,\n map: MapInstance,\n}\n\n/** React Component (FC) to sync the Three camera with the map provider */\nexport const SyncCameraFC = memo<SyncCameraFCProps>(({\n latitude, longitude, altitude = 0, setOnRender, manualRender, onReady, map\n}) => {\n\n const mapCanvas = map.getCanvas();\n\n const r3m = useR3M();\n\n const camRef = useRef<PerspectiveCamera>(null);\n\n const camera = useThree(s => s.camera) as PerspectiveCamera;\n const gl = useThree(s => s.gl);\n const threeCanvas = useThree(s => s.gl.domElement);\n const scene = useThree(s => s.scene);\n const advance = useThree(s => s.advance);\n const setSize = useThree(s => s.setSize);\n const set = useThree(s => s.set);\n\n const origin = useCoordsToMatrix({ latitude, longitude, altitude, fromLngLat: r3m.fromLngLat });\n\n const ready = useRef(false);\n\n const triggerRepaint = useMemo(() => map.triggerRepaint, [map]);\n const mapPaintRequests = useRef(0);\n const triggerRepaintOff = useFunction(() => {\n mapPaintRequests.current++;\n })\n\n useFrame(() => {\n syncCamera(camera, origin, r3m.viewProjMx)\n\n if (manualRender) gl.render(scene, camera);\n\n map.triggerRepaint = triggerRepaint;\n if (mapPaintRequests.current > 0) {\n mapPaintRequests.current = 0;\n map.triggerRepaint();\n }\n }, -Infinity)\n\n const onRender = useFunction((viewProjMx: Matrix4Tuple) => {\n map.triggerRepaint = triggerRepaintOff;\n\n if (threeCanvas.width !== mapCanvas.width || threeCanvas.height !== mapCanvas.height) {\n setSize(\n mapCanvas.clientWidth,\n mapCanvas.clientHeight,\n true,\n mapCanvas.offsetTop,\n mapCanvas.offsetLeft,\n );\n }\n\n r3m.viewProjMx = viewProjMx;\n if (!ready.current && onReady) {\n ready.current = true;\n onReady();\n }\n advance(Date.now() * .001, true);\n })\n\n useEffect(() => {\n setOnRender && setOnRender(() => onRender)\n }, [setOnRender, onRender])\n\n useLayoutEffect(() => {\n if (!manualRender) return;\n set({ camera: camRef.current! }); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return <>\n {manualRender && <perspectiveCamera\n ref={camRef}\n matrixAutoUpdate={false}\n matrixWorldAutoUpdate={false}\n />}\n </>\n})\n\nSyncCameraFC.displayName = 'SyncCameraFC';"],"names":[],"mappings":";;;;;;;AAmBa,MAAA,eAAe,KAAwB,CAAC;AAAA,EACnD;AAAA,EAAU;AAAA,EAAW,WAAW;AAAA,EAAG;AAAA,EAAa;AAAA,EAAc;AAAA,EAAS;AACzE,MAAM;AAEE,QAAA,YAAY,IAAI;AAEtB,QAAM,MAAM;AAEN,QAAA,SAAS,OAA0B,IAAI;AAE7C,QAAM,SAAS,SAAS,CAAK,MAAA,EAAE,MAAM;AACrC,QAAM,KAAK,SAAS,CAAK,MAAA,EAAE,EAAE;AAC7B,QAAM,cAAc,SAAS,CAAK,MAAA,EAAE,GAAG,UAAU;AACjD,QAAM,QAAQ,SAAS,CAAK,MAAA,EAAE,KAAK;AACnC,QAAM,UAAU,SAAS,CAAK,MAAA,EAAE,OAAO;AACvC,QAAM,UAAU,SAAS,CAAK,MAAA,EAAE,OAAO;AACvC,QAAM,MAAM,SAAS,CAAK,MAAA,EAAE,GAAG;AAEzB,QAAA,SAAS,kBAAkB,EAAE,UAAU,WAAW,UAAU,YAAY,IAAI,WAAA,CAAY;AAExF,QAAA,QAAQ,OAAO,KAAK;AAE1B,QAAM,iBAAiB,QAAQ,MAAM,IAAI,gBAAgB,CAAC,GAAG,CAAC;AACxD,QAAA,mBAAmB,OAAO,CAAC;AAC3B,QAAA,oBAAoB,YAAY,MAAM;AACzB,qBAAA;AAAA,EAAA,CAClB;AAED,WAAS,MAAM;AACF,eAAA,QAAQ,QAAQ,IAAI,UAAU;AAErC,QAAA;AAAiB,SAAA,OAAO,OAAO,MAAM;AAEzC,QAAI,iBAAiB;AACjB,QAAA,iBAAiB,UAAU,GAAG;AAChC,uBAAiB,UAAU;AAC3B,UAAI,eAAe;AAAA,IACrB;AAAA,EAAA,GACC,SAAS;AAEN,QAAA,WAAW,YAAY,CAAC,eAA6B;AACzD,QAAI,iBAAiB;AAErB,QAAI,YAAY,UAAU,UAAU,SAAS,YAAY,WAAW,UAAU,QAAQ;AACpF;AAAA,QACE,UAAU;AAAA,QACV,UAAU;AAAA,QACV;AAAA,QACA,UAAU;AAAA,QACV,UAAU;AAAA,MAAA;AAAA,IAEd;AAEA,QAAI,aAAa;AACb,QAAA,CAAC,MAAM,WAAW,SAAS;AAC7B,YAAM,UAAU;AACR;IACV;AACA,YAAQ,KAAK,IAAQ,IAAA,MAAM,IAAI;AAAA,EAAA,CAChC;AAED,YAAU,MAAM;AACC,mBAAA,YAAY,MAAM,QAAQ;AAAA,EAAA,GACxC,CAAC,aAAa,QAAQ,CAAC;AAE1B,kBAAgB,MAAM;AACpB,QAAI,CAAC;AAAc;AACnB,QAAI,EAAE,QAAQ,OAAO,QAAU,CAAA;AAAA,EACjC,GAAG,CAAE,CAAA;AAEL,yCACG,UAAgB,gBAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MAChB,KAAK;AAAA,MACL,kBAAkB;AAAA,MAClB,uBAAuB;AAAA,IAAA;AAAA,EAE3B,EAAA,CAAA;AACF,CAAC;AAED,aAAa,cAAc;"}
|
|
@@ -4,9 +4,9 @@ import { MercatorCoordinate } from "mapbox-gl";
|
|
|
4
4
|
import { memo, useState } from "react";
|
|
5
5
|
import { useMap, Layer } from "react-map-gl";
|
|
6
6
|
import * as THREE from "three";
|
|
7
|
-
import { useCanvasInLayer } from "./
|
|
8
|
-
import { InitCanvasFC } from "./
|
|
9
|
-
import { useFunction } from "./
|
|
7
|
+
import { useCanvasInLayer } from "./main8.mjs";
|
|
8
|
+
import { InitCanvasFC } from "./main9.mjs";
|
|
9
|
+
import { useFunction } from "./main10.mjs";
|
|
10
10
|
extend(THREE);
|
|
11
11
|
const fromLngLat = MercatorCoordinate.fromLngLat;
|
|
12
12
|
const Canvas = memo(({ overlay, ...props }) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main3.mjs","sources":["../../../src/mapbox/canvas.tsx"],"sourcesContent":["
|
|
1
|
+
{"version":3,"file":"main3.mjs","sources":["../../../src/mapbox/canvas.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/ban-ts-comment */\nimport { extend } from \"@react-three/fiber\";\nimport { MercatorCoordinate } from \"mapbox-gl\";\nimport { memo, useState } from \"react\";\nimport { Layer, useMap } from \"react-map-gl\";\nimport * as THREE from \"three\";\nimport { Matrix4Tuple } from \"three\";\nimport { CanvasProps } from \"../api/canvas-props\";\nimport { useCanvasInLayer } from \"../core/canvas-in-layer/use-canvas-in-layer\";\nimport { InitCanvasFC } from \"../core/canvas-overlay/init-canvas-fc\";\nimport { Render } from \"../core/canvas-overlay/render\";\nimport { MapInstance } from \"../core/generic-map\";\nimport { useFunction } from \"../core/use-function\";\n\nextend(THREE);\n\nconst fromLngLat = MercatorCoordinate.fromLngLat\n\n/** react`-three-fiber` canvas inside `Mapbox` */\nexport const Canvas = memo<CanvasProps>(({ overlay, ...props }) => {\n\n const map = useMap().current!.getMap(); // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n return <>\n {overlay && <CanvasOverlay map={map} {...props} />}\n {!overlay && <CanvasInLayer map={map} {...props} />}\n </>\n})\nCanvas.displayName = 'Canvas'\n\ninterface CanvasPropsAndMap extends CanvasProps {\n map: MapInstance;\n}\n\nconst CanvasInLayer = memo<CanvasPropsAndMap>(({ map, ...props }) => {\n const layerProps = useCanvasInLayer(props, fromLngLat, map);\n /* @ts-ignore */ // eslint-disable-line @typescript-eslint/ban-ts-comment\n return <Layer {...layerProps} />\n})\nCanvasInLayer.displayName = 'CanvasInLayer';\n\nconst CanvasOverlay = memo<CanvasPropsAndMap>(({ map, id, beforeId, ...props }) => {\n const [onRender, setOnRender] = useState<(mx: Matrix4Tuple) => void>();\n\n const render = useFunction<Render>((_gl, mx) => {\n if (!onRender) return;\n onRender(mx as Matrix4Tuple);\n })\n\n return <>\n {/* @ts-ignore */}\n <Layer id={id} beforeId={beforeId} type=\"custom\" render={render} />\n <InitCanvasFC {...props}\n setOnRender={setOnRender}\n map={map}\n fromLngLat={fromLngLat}\n />\n </>\n})\nCanvasInLayer.displayName = 'CanvasInLayer';"],"names":[],"mappings":";;;;;;;;;AAcA,OAAO,KAAK;AAEZ,MAAM,aAAa,mBAAmB;AAG/B,MAAM,SAAS,KAAkB,CAAC,EAAE,SAAS,GAAG,YAAY;AAEjE,QAAM,MAAM,OAAA,EAAS,QAAS,OAAO;AAErC,SACG,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA,WAAY,oBAAA,eAAA,EAAc,KAAW,GAAG,MAAO,CAAA;AAAA,IAC/C,CAAC,WAAW,oBAAC,eAAc,EAAA,KAAW,GAAG,OAAO;AAAA,EACnD,EAAA,CAAA;AACF,CAAC;AACD,OAAO,cAAc;AAMrB,MAAM,gBAAgB,KAAwB,CAAC,EAAE,KAAK,GAAG,YAAY;AACnE,QAAM,aAAa,iBAAiB,OAAO,YAAY,GAAG;AAEnD,SAAA,oBAAC,OAAO,EAAA,GAAG,WAAY,CAAA;AAChC,CAAC;AACD,cAAc,cAAc;AAE5B,MAAM,gBAAgB,KAAwB,CAAC,EAAE,KAAK,IAAI,UAAU,GAAG,YAAY;AACjF,QAAM,CAAC,UAAU,WAAW,IAAI,SAAqC;AAErE,QAAM,SAAS,YAAoB,CAAC,KAAK,OAAO;AAC9C,QAAI,CAAC;AAAU;AACf,aAAS,EAAkB;AAAA,EAAA,CAC5B;AAED,SAEE,qBAAA,UAAA,EAAA,UAAA;AAAA,IAAA,oBAAC,OAAM,EAAA,IAAQ,UAAoB,MAAK,UAAS,QAAgB;AAAA,IACjE;AAAA,MAAC;AAAA,MAAA;AAAA,QAAc,GAAG;AAAA,QAChB;AAAA,QACA;AAAA,QACA;AAAA,MAAA;AAAA,IACF;AAAA,EACF,EAAA,CAAA;AACF,CAAC;AACD,cAAc,cAAc;"}
|
|
@@ -2,9 +2,9 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { createPortal, useThree, useFrame } from "@react-three/fiber";
|
|
3
3
|
import { memo, useState, useRef, useLayoutEffect } from "react";
|
|
4
4
|
import { Scene } from "three";
|
|
5
|
-
import { syncCamera } from "./
|
|
6
|
-
import { useCoordsToMatrix } from "./
|
|
7
|
-
import { useR3M } from "./
|
|
5
|
+
import { syncCamera } from "./main11.mjs";
|
|
6
|
+
import { useCoordsToMatrix } from "./main12.mjs";
|
|
7
|
+
import { useR3M } from "./main13.mjs";
|
|
8
8
|
const Coordinates = memo(({
|
|
9
9
|
latitude,
|
|
10
10
|
longitude,
|
|
@@ -1,22 +1,35 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { earthRadius } from "./main14.mjs";
|
|
3
|
+
const mercatorScaleLookup = {};
|
|
4
|
+
function getMercatorScale(lat) {
|
|
5
|
+
const index = Math.round(lat * 1e3);
|
|
6
|
+
if (mercatorScaleLookup[index] === void 0) {
|
|
7
|
+
mercatorScaleLookup[index] = 1 / Math.cos(lat * MathUtils.DEG2RAD);
|
|
8
|
+
}
|
|
9
|
+
return mercatorScaleLookup[index];
|
|
10
|
+
}
|
|
11
|
+
function averageMercatorScale(originLat, pointLat, steps = 10) {
|
|
12
|
+
let totalScale = 0;
|
|
13
|
+
const latStep = (pointLat - originLat) / steps;
|
|
14
|
+
for (let i = 0; i <= steps; i++) {
|
|
15
|
+
const lat = originLat + latStep * i;
|
|
16
|
+
totalScale += getMercatorScale(lat);
|
|
17
|
+
}
|
|
18
|
+
return totalScale / (steps + 1);
|
|
19
|
+
}
|
|
20
|
+
function coordsToVector3(point, origin) {
|
|
21
|
+
const latitudeDiff = (point.latitude - origin.latitude) * MathUtils.DEG2RAD;
|
|
22
|
+
const longitudeDiff = (point.longitude - origin.longitude) * MathUtils.DEG2RAD;
|
|
23
|
+
const altitudeDiff = (point.altitude || 0) - (origin.altitude || 0);
|
|
24
|
+
const x = longitudeDiff * earthRadius * Math.cos(origin.latitude * MathUtils.DEG2RAD);
|
|
25
|
+
const y = altitudeDiff;
|
|
26
|
+
const steps = Math.ceil(Math.abs(point.latitude - origin.latitude)) * 100 + 1;
|
|
27
|
+
const avgScale = averageMercatorScale(origin.latitude, point.latitude, steps);
|
|
28
|
+
const z = -latitudeDiff * earthRadius / getMercatorScale(origin.latitude) * avgScale;
|
|
29
|
+
return [x, y, z];
|
|
30
|
+
}
|
|
19
31
|
export {
|
|
20
|
-
|
|
32
|
+
averageMercatorScale,
|
|
33
|
+
coordsToVector3
|
|
21
34
|
};
|
|
22
35
|
//# sourceMappingURL=main5.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main5.mjs","sources":["../../../src/api/
|
|
1
|
+
{"version":3,"file":"main5.mjs","sources":["../../../src/api/coords-to-vector-3.ts"],"sourcesContent":["import { MathUtils, Vector3Tuple } from 'three';\nimport { Coords } from './coords';\nimport { earthRadius } from \"../core/earth-radius\";\n\n\nconst mercatorScaleLookup: { [key: number]: number } = {};\n\nfunction getMercatorScale(lat: number): number {\n const index = Math.round(lat * 1000);\n if (mercatorScaleLookup[index] === undefined) {\n mercatorScaleLookup[index] = 1 / Math.cos(lat * MathUtils.DEG2RAD);\n }\n return mercatorScaleLookup[index];\n}\n\nexport function averageMercatorScale(originLat: number, pointLat: number, steps = 10): number {\n let totalScale = 0;\n const latStep = (pointLat - originLat) / steps;\n for (let i = 0; i <= steps; i++) {\n const lat = originLat + latStep * i;\n totalScale += getMercatorScale(lat);\n }\n return totalScale / (steps + 1);\n}\n\nexport function coordsToVector3(point: Coords, origin: Coords): Vector3Tuple {\n const latitudeDiff = (point.latitude - origin.latitude) * MathUtils.DEG2RAD;\n const longitudeDiff = (point.longitude - origin.longitude) * MathUtils.DEG2RAD;\n const altitudeDiff = (point.altitude || 0) - (origin.altitude || 0);\n\n const x = longitudeDiff * earthRadius * Math.cos(origin.latitude * MathUtils.DEG2RAD);\n const y = altitudeDiff;\n\n // dynamic step size based on latitude difference. calculate the mercator unit scale at origin\n // and the scale average along the line to the point for better accuracy far from origin\n const steps = Math.ceil(Math.abs(point.latitude - origin.latitude)) * 100 + 1;\n const avgScale = averageMercatorScale(origin.latitude, point.latitude, steps);\n\n const z = ((-latitudeDiff * earthRadius) / getMercatorScale(origin.latitude)) * avgScale;\n return [x, y, z] as Vector3Tuple;\n}"],"names":[],"mappings":";;AAKA,MAAM,sBAAiD,CAAA;AAEvD,SAAS,iBAAiB,KAAqB;AAC7C,QAAM,QAAQ,KAAK,MAAM,MAAM,GAAI;AAC/B,MAAA,oBAAoB,KAAK,MAAM,QAAW;AAC5C,wBAAoB,KAAK,IAAI,IAAI,KAAK,IAAI,MAAM,UAAU,OAAO;AAAA,EACnE;AACA,SAAO,oBAAoB,KAAK;AAClC;AAEO,SAAS,qBAAqB,WAAmB,UAAkB,QAAQ,IAAY;AAC5F,MAAI,aAAa;AACX,QAAA,WAAW,WAAW,aAAa;AACzC,WAAS,IAAI,GAAG,KAAK,OAAO,KAAK;AACzB,UAAA,MAAM,YAAY,UAAU;AAClC,kBAAc,iBAAiB,GAAG;AAAA,EACpC;AACA,SAAO,cAAc,QAAQ;AAC/B;AAEgB,SAAA,gBAAgB,OAAe,QAA8B;AAC3E,QAAM,gBAAgB,MAAM,WAAW,OAAO,YAAY,UAAU;AACpE,QAAM,iBAAiB,MAAM,YAAY,OAAO,aAAa,UAAU;AACvE,QAAM,gBAAgB,MAAM,YAAY,MAAM,OAAO,YAAY;AAE3D,QAAA,IAAI,gBAAgB,cAAc,KAAK,IAAI,OAAO,WAAW,UAAU,OAAO;AACpF,QAAM,IAAI;AAIJ,QAAA,QAAQ,KAAK,KAAK,KAAK,IAAI,MAAM,WAAW,OAAO,QAAQ,CAAC,IAAI,MAAM;AAC5E,QAAM,WAAW,qBAAqB,OAAO,UAAU,MAAM,UAAU,KAAK;AAE5E,QAAM,IAAM,CAAC,eAAe,cAAe,iBAAiB,OAAO,QAAQ,IAAK;AACzE,SAAA,CAAC,GAAG,GAAG,CAAC;AACjB;"}
|
|
@@ -1,18 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useMemo } from "react";
|
|
3
|
+
import { useCoords } from "./main15.mjs";
|
|
4
|
+
import { coordsToVector3 } from "./main5.mjs";
|
|
5
|
+
const NearCoordinates = memo(({ children, ...coords }) => {
|
|
6
|
+
const { latitude, longitude, altitude } = useCoords();
|
|
7
|
+
const pos = useMemo(() => coordsToVector3(coords, { latitude, longitude, altitude }), [
|
|
8
|
+
// eslint-disable-line react-hooks/exhaustive-deps
|
|
9
|
+
latitude,
|
|
10
|
+
longitude,
|
|
11
|
+
altitude,
|
|
12
|
+
coords.latitude,
|
|
13
|
+
coords.longitude,
|
|
14
|
+
coords.altitude
|
|
15
|
+
]);
|
|
16
|
+
return /* @__PURE__ */ jsx("object3D", { position: pos, children });
|
|
17
|
+
});
|
|
18
|
+
NearCoordinates.displayName = "NearCoordinates";
|
|
15
19
|
export {
|
|
16
|
-
|
|
20
|
+
NearCoordinates
|
|
17
21
|
};
|
|
18
22
|
//# sourceMappingURL=main6.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main6.mjs","sources":["../../../src/api/
|
|
1
|
+
{"version":3,"file":"main6.mjs","sources":["../../../src/api/near-coordinates.tsx"],"sourcesContent":["import { memo, useMemo } from \"react\";\nimport { useCoords } from \"../core/use-coords\";\nimport { CoordinatesProps } from \"./coordinates\";\nimport { coordsToVector3 } from \"./coords-to-vector-3\";\n\nexport const NearCoordinates = memo<CoordinatesProps>(({children, ...coords})=>{\n const {latitude, longitude, altitude} = useCoords();\n const pos = useMemo(()=>coordsToVector3(coords, {latitude, longitude, altitude}), [ // eslint-disable-line react-hooks/exhaustive-deps\n latitude, longitude, altitude, coords.latitude, coords.longitude, coords.altitude\n ]);\n return <object3D position={pos}>{children}</object3D>\n})\nNearCoordinates.displayName = 'NearCoordinates';"],"names":[],"mappings":";;;;AAKO,MAAM,kBAAkB,KAAuB,CAAC,EAAC,UAAU,GAAG,aAAU;AAC7E,QAAM,EAAC,UAAU,WAAW,aAAY,UAAU;AAC5C,QAAA,MAAM,QAAQ,MAAI,gBAAgB,QAAQ,EAAC,UAAU,WAAW,SAAQ,CAAC,GAAG;AAAA;AAAA,IAChF;AAAA,IAAU;AAAA,IAAW;AAAA,IAAU,OAAO;AAAA,IAAU,OAAO;AAAA,IAAW,OAAO;AAAA,EAAA,CAC1E;AACD,SAAQ,oBAAA,YAAA,EAAS,UAAU,KAAM,SAAS,CAAA;AAC5C,CAAC;AACD,gBAAgB,cAAc;"}
|
|
@@ -1,26 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
fromLngLat
|
|
11
|
-
});
|
|
12
|
-
const { onRemove, useThree, r3m } = useRoot(fromLngLat, map, props);
|
|
13
|
-
const render = useRender({ origin, frameloop, useThree, map, r3m });
|
|
14
|
-
return {
|
|
15
|
-
id: props.id,
|
|
16
|
-
beforeId: props.beforeId,
|
|
17
|
-
onRemove,
|
|
18
|
-
render,
|
|
19
|
-
type: "custom",
|
|
20
|
-
renderingMode: "3d"
|
|
21
|
-
};
|
|
1
|
+
import { MathUtils } from "three";
|
|
2
|
+
import { earthRadius } from "./main14.mjs";
|
|
3
|
+
function vector3ToCoords(position, origin) {
|
|
4
|
+
const [x, y, z] = position;
|
|
5
|
+
const latitude = origin.latitude + -z / earthRadius * MathUtils.RAD2DEG;
|
|
6
|
+
const longitude = origin.longitude + x / earthRadius * MathUtils.RAD2DEG / Math.cos(origin.latitude * MathUtils.DEG2RAD);
|
|
7
|
+
const altitude = (origin.altitude || 0) + y;
|
|
8
|
+
const coords = { latitude, longitude, altitude };
|
|
9
|
+
return coords;
|
|
22
10
|
}
|
|
23
11
|
export {
|
|
24
|
-
|
|
12
|
+
vector3ToCoords
|
|
25
13
|
};
|
|
26
14
|
//# sourceMappingURL=main7.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main7.mjs","sources":["../../../src/
|
|
1
|
+
{"version":3,"file":"main7.mjs","sources":["../../../src/api/vector-3-to-coords.ts"],"sourcesContent":["import { MathUtils, Vector3Tuple } from \"three\";\nimport { Coords } from \"./coords\";\nimport { earthRadius } from \"../core/earth-radius\";\n\nexport function vector3ToCoords(position: Vector3Tuple, origin: Coords): Coords {\n const [x, y, z] = position;\n const latitude = origin.latitude + (-z / earthRadius) * MathUtils.RAD2DEG;\n const longitude = origin.longitude + (x / earthRadius) * MathUtils.RAD2DEG / Math.cos(origin.latitude * MathUtils.DEG2RAD);\n const altitude = (origin.altitude || 0) + y;\n const coords: Coords = { latitude, longitude, altitude };\n return coords;\n}"],"names":[],"mappings":";;AAIgB,SAAA,gBAAgB,UAAwB,QAAwB;AAC9E,QAAM,CAAC,GAAG,GAAG,CAAC,IAAI;AAClB,QAAM,WAAW,OAAO,WAAY,CAAC,IAAI,cAAe,UAAU;AAClE,QAAM,YAAY,OAAO,YAAa,IAAI,cAAe,UAAU,UAAU,KAAK,IAAI,OAAO,WAAW,UAAU,OAAO;AACnH,QAAA,YAAY,OAAO,YAAY,KAAK;AAC1C,QAAM,SAAiB,EAAE,UAAU,WAAW,SAAS;AAChD,SAAA;AACT;"}
|
|
@@ -1,30 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
el2.style.bottom = "0";
|
|
12
|
-
el2.style.left = "0";
|
|
13
|
-
el2.style.right = "0";
|
|
14
|
-
el2.style.pointerEvents = "none";
|
|
15
|
-
return el2;
|
|
1
|
+
import { useCoordsToMatrix } from "./main12.mjs";
|
|
2
|
+
import { useRender } from "./main16.mjs";
|
|
3
|
+
import { useRoot } from "./main17.mjs";
|
|
4
|
+
function useCanvasInLayer(props, fromLngLat, map) {
|
|
5
|
+
const { latitude, longitude, altitude, frameloop } = props;
|
|
6
|
+
const origin = useCoordsToMatrix({
|
|
7
|
+
latitude,
|
|
8
|
+
longitude,
|
|
9
|
+
altitude,
|
|
10
|
+
fromLngLat
|
|
16
11
|
});
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
12
|
+
const { onRemove, useThree, r3m } = useRoot(fromLngLat, map, props);
|
|
13
|
+
const render = useRender({ origin, frameloop, useThree, map, r3m });
|
|
14
|
+
return {
|
|
15
|
+
id: props.id,
|
|
16
|
+
beforeId: props.beforeId,
|
|
17
|
+
onRemove,
|
|
18
|
+
render,
|
|
19
|
+
type: "custom",
|
|
20
|
+
renderingMode: "3d"
|
|
21
|
+
};
|
|
22
|
+
}
|
|
27
23
|
export {
|
|
28
|
-
|
|
24
|
+
useCanvasInLayer
|
|
29
25
|
};
|
|
30
26
|
//# sourceMappingURL=main8.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main8.mjs","sources":["../../../src/core/canvas-
|
|
1
|
+
{"version":3,"file":"main8.mjs","sources":["../../../src/core/canvas-in-layer/use-canvas-in-layer.tsx"],"sourcesContent":["import { CanvasProps } from \"../../api/canvas-props\";\nimport { FromLngLat, MapInstance } from \"../generic-map\";\nimport { useCoordsToMatrix } from \"../use-coords-to-matrix\";\nimport { useRender } from \"./use-render\";\nimport { useRoot } from \"./use-root\";\n\n/** get all the properties that you need to render as a map `<Layer>` */\nexport function useCanvasInLayer(props: CanvasProps,fromLngLat: FromLngLat, map: MapInstance) {\n\n const {latitude, longitude, altitude, frameloop } = props;\n\n const origin = useCoordsToMatrix({\n latitude, longitude, altitude, fromLngLat,\n });\n\n const { onRemove, useThree, r3m } = useRoot(fromLngLat, map, props);\n \n const render = useRender({origin, frameloop, useThree, map, r3m});\n \n return {\n id: props.id,\n beforeId: props.beforeId,\n onRemove,\n render,\n type: 'custom',\n renderingMode: '3d'\n } as const\n\n}"],"names":[],"mappings":";;;AAOgB,SAAA,iBAAiB,OAAmB,YAAwB,KAAkB;AAE5F,QAAM,EAAC,UAAU,WAAW,UAAU,cAAc;AAElD,QAAM,SAAS,kBAAkB;AAAA,IAC/B;AAAA,IAAU;AAAA,IAAW;AAAA,IAAU;AAAA,EAAA,CAChC;AAEK,QAAA,EAAE,UAAU,UAAU,IAAA,IAAQ,QAAQ,YAAY,KAAK,KAAK;AAE5D,QAAA,SAAS,UAAU,EAAC,QAAQ,WAAW,UAAU,KAAK,KAAI;AAEzD,SAAA;AAAA,IACL,IAAI,MAAM;AAAA,IACV,UAAU,MAAM;AAAA,IAChB;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,eAAe;AAAA,EAAA;AAGrB;"}
|
|
@@ -1,12 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { memo, useState, useEffect } from "react";
|
|
3
|
+
import { createPortal } from "react-dom";
|
|
4
|
+
import { CanvasPortal } from "./main18.mjs";
|
|
5
|
+
const InitCanvasFC = memo((props) => {
|
|
6
|
+
const canvas = props.map.getCanvas();
|
|
7
|
+
const [el] = useState(() => {
|
|
8
|
+
const el2 = document.createElement("div");
|
|
9
|
+
el2.style.position = "absolute";
|
|
10
|
+
el2.style.top = "0";
|
|
11
|
+
el2.style.bottom = "0";
|
|
12
|
+
el2.style.left = "0";
|
|
13
|
+
el2.style.right = "0";
|
|
14
|
+
el2.style.pointerEvents = "none";
|
|
15
|
+
return el2;
|
|
16
|
+
});
|
|
17
|
+
useEffect(() => {
|
|
18
|
+
const parent = canvas.parentElement;
|
|
19
|
+
parent.appendChild(el);
|
|
20
|
+
return () => {
|
|
21
|
+
parent.removeChild(el);
|
|
22
|
+
};
|
|
7
23
|
}, []);
|
|
8
|
-
};
|
|
24
|
+
return /* @__PURE__ */ jsx(Fragment, { children: createPortal(/* @__PURE__ */ jsx(CanvasPortal, { ...props }), el) });
|
|
25
|
+
});
|
|
26
|
+
InitCanvasFC.displayName = "InitCanvasFC";
|
|
9
27
|
export {
|
|
10
|
-
|
|
28
|
+
InitCanvasFC
|
|
11
29
|
};
|
|
12
30
|
//# sourceMappingURL=main9.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main9.mjs","sources":["../../../src/core/
|
|
1
|
+
{"version":3,"file":"main9.mjs","sources":["../../../src/core/canvas-overlay/init-canvas-fc.tsx"],"sourcesContent":["import { memo, useEffect, useState } from \"react\";\nimport { createPortal } from 'react-dom';\nimport { Matrix4Tuple } from \"three\";\nimport { CanvasProps } from \"../../api/canvas-props\";\nimport { FromLngLat, MapInstance } from \"../generic-map\";\nimport { CanvasPortal } from \"./canvas-portal\";\n\ninterface InitCanvasFCProps extends CanvasProps {\n map: MapInstance,\n setOnRender: (callback: () => (mx: Matrix4Tuple) => void) => void,\n frameloop?: 'always' | 'demand',\n fromLngLat: FromLngLat,\n}\nexport const InitCanvasFC = memo<InitCanvasFCProps>((props) => {\n const canvas = props.map.getCanvas() // eslint-disable-line @typescript-eslint/no-non-null-assertion\n\n const [el] = useState(() => {\n const el = document.createElement('div');\n el.style.position = 'absolute';\n el.style.top = '0';\n el.style.bottom = '0';\n el.style.left = '0';\n el.style.right = '0';\n el.style.pointerEvents = 'none';\n return el\n })\n\n useEffect(() => {\n const parent = canvas.parentElement!; // eslint-disable-line @typescript-eslint/no-non-null-assertion\n parent.appendChild(el);\n return () => {\n parent.removeChild(el);\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n return <>\n {createPortal((\n <CanvasPortal {...props} />\n ), el)}\n </>\n})\nInitCanvasFC.displayName = 'InitCanvasFC';\n"],"names":["el"],"mappings":";;;;AAaa,MAAA,eAAe,KAAwB,CAAC,UAAU;AACvD,QAAA,SAAS,MAAM,IAAI,UAAU;AAEnC,QAAM,CAAC,EAAE,IAAI,SAAS,MAAM;AACpBA,UAAAA,MAAK,SAAS,cAAc,KAAK;AACvCA,QAAG,MAAM,WAAW;AACpBA,QAAG,MAAM,MAAM;AACfA,QAAG,MAAM,SAAS;AAClBA,QAAG,MAAM,OAAO;AAChBA,QAAG,MAAM,QAAQ;AACjBA,QAAG,MAAM,gBAAgB;AAClBA,WAAAA;AAAAA,EAAA,CACR;AAED,YAAU,MAAM;AACd,UAAM,SAAS,OAAO;AACtB,WAAO,YAAY,EAAE;AACrB,WAAO,MAAM;AACX,aAAO,YAAY,EAAE;AAAA,IAAA;AAAA,EAEzB,GAAG,CAAE,CAAA;AACE,SAAA,oBAAA,UAAA,EACJ,uBACE,oBAAA,cAAA,EAAc,GAAG,MAAO,CAAA,GACxB,EAAE,EACP,CAAA;AACF,CAAC;AACD,aAAa,cAAc;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3Tuple } from
|
|
2
|
-
import { Coords } from
|
|
3
|
-
|
|
1
|
+
import { Vector3Tuple } from 'three';
|
|
2
|
+
import { Coords } from './coords';
|
|
3
|
+
export declare function averageMercatorScale(originLat: number, pointLat: number, steps?: number): number;
|
|
4
4
|
export declare function coordsToVector3(point: Coords, origin: Coords): Vector3Tuple;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Matrix4Tuple } from "three";
|
|
3
3
|
import { Coords } from "../../api/coords";
|
|
4
|
+
import { MapInstance } from "../generic-map";
|
|
4
5
|
interface SyncCameraFCProps extends Coords {
|
|
5
6
|
setOnRender?: (callback: () => (mx: Matrix4Tuple) => void) => void;
|
|
6
7
|
/** on `useFrame` it will manually render (used by `<Coordinates>`) */
|
|
7
8
|
manualRender?: boolean;
|
|
8
9
|
onReady?: () => void;
|
|
9
|
-
|
|
10
|
+
map: MapInstance;
|
|
10
11
|
}
|
|
11
12
|
/** React Component (FC) to sync the Three camera with the map provider */
|
|
12
13
|
export declare const SyncCameraFC: import("react").NamedExoticComponent<SyncCameraFCProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const earthRadius = 6371008.8;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Vector3Tuple } from
|
|
2
|
-
import { Coords } from
|
|
3
|
-
|
|
1
|
+
import { Vector3Tuple } from 'three';
|
|
2
|
+
import { Coords } from './coords';
|
|
3
|
+
export declare function averageMercatorScale(originLat: number, pointLat: number, steps?: number): number;
|
|
4
4
|
export declare function coordsToVector3(point: Coords, origin: Coords): Vector3Tuple;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Matrix4Tuple } from "three";
|
|
3
3
|
import { Coords } from "../../api/coords";
|
|
4
|
+
import { MapInstance } from "../generic-map";
|
|
4
5
|
interface SyncCameraFCProps extends Coords {
|
|
5
6
|
setOnRender?: (callback: () => (mx: Matrix4Tuple) => void) => void;
|
|
6
7
|
/** on `useFrame` it will manually render (used by `<Coordinates>`) */
|
|
7
8
|
manualRender?: boolean;
|
|
8
9
|
onReady?: () => void;
|
|
9
|
-
|
|
10
|
+
map: MapInstance;
|
|
10
11
|
}
|
|
11
12
|
/** React Component (FC) to sync the Three camera with the map provider */
|
|
12
13
|
export declare const SyncCameraFC: import("react").NamedExoticComponent<SyncCameraFCProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const earthRadius = 6371008.8;
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-three-map",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2",
|
|
4
4
|
"description": "Use react-three-fiber inside MapLibre and Mapbox",
|
|
5
5
|
"main": "dist/cjs/main.js",
|
|
6
6
|
"module": "dist/es/main.mjs",
|
|
@@ -29,13 +29,11 @@
|
|
|
29
29
|
"build:stories": "yarn ladle build",
|
|
30
30
|
"test": "yarn vitest"
|
|
31
31
|
},
|
|
32
|
-
"dependencies": {
|
|
33
|
-
"@turf/turf": "^7.0.0-alpha.2"
|
|
34
|
-
},
|
|
32
|
+
"dependencies": {},
|
|
35
33
|
"devDependencies": {
|
|
36
34
|
"@changesets/cli": "^2.26.1",
|
|
37
|
-
"@ladle/react": "^
|
|
38
|
-
"@react-three/drei": "^9.
|
|
35
|
+
"@ladle/react": "^4.0.2",
|
|
36
|
+
"@react-three/drei": "^9.97.6",
|
|
39
37
|
"@react-three/fiber": "^8.15.12",
|
|
40
38
|
"@react-three/postprocessing": "^2.15.11",
|
|
41
39
|
"@types/luxon": "^3.3.1",
|
|
@@ -48,7 +46,6 @@
|
|
|
48
46
|
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
49
47
|
"@typescript-eslint/parser": "^5.59.11",
|
|
50
48
|
"@vitejs/plugin-react": "^4.0.0",
|
|
51
|
-
"@vitest/coverage-v8": "^0.33.0",
|
|
52
49
|
"cross-env": "^7.0.3",
|
|
53
50
|
"eslint": "^8.38.0",
|
|
54
51
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
@@ -56,11 +53,11 @@
|
|
|
56
53
|
"happy-dom": "^10.5.2",
|
|
57
54
|
"leva": "^0.9.35",
|
|
58
55
|
"luxon": "^3.3.0",
|
|
59
|
-
"mapbox-gl": "^
|
|
56
|
+
"mapbox-gl": "^3.1.2",
|
|
60
57
|
"maplibre-gl": "^3.2.0",
|
|
61
58
|
"react": "^18.2.0",
|
|
62
59
|
"react-dom": "^18.2.0",
|
|
63
|
-
"react-map-gl": "^7.1.
|
|
60
|
+
"react-map-gl": "^7.1.7",
|
|
64
61
|
"suncalc": "^1.9.0",
|
|
65
62
|
"suspend-react": "^0.1.3",
|
|
66
63
|
"three": "^0.159.0",
|
package/stories/package.json
CHANGED
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
"dev": "yarn ladle serve"
|
|
7
7
|
},
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@ladle/react": "^
|
|
10
|
-
"@react-three/drei": "^9.
|
|
9
|
+
"@ladle/react": "^4.0.2",
|
|
10
|
+
"@react-three/drei": "^9.97.6",
|
|
11
11
|
"@react-three/fiber": "^8.15.12",
|
|
12
12
|
"@react-three/postprocessing": "^2.15.11",
|
|
13
13
|
"@types/luxon": "^3.3.7",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
"@types/tz-lookup": "^6.1.2",
|
|
16
16
|
"leva": "^0.9.35",
|
|
17
17
|
"luxon": "^3.4.4",
|
|
18
|
-
"mapbox-gl": "^
|
|
18
|
+
"mapbox-gl": "^3.1.2",
|
|
19
19
|
"maplibre-gl": "^3.2.0",
|
|
20
20
|
"react": "^18.2.0",
|
|
21
21
|
"react-dom": "^18.2.0",
|
|
22
|
-
"react-map-gl": "^7.1.
|
|
23
|
-
"react-three-map": "^0.
|
|
22
|
+
"react-map-gl": "^7.1.7",
|
|
23
|
+
"react-three-map": "^0.8.1",
|
|
24
24
|
"suncalc": "^1.9.0",
|
|
25
25
|
"three": "^0.159.0",
|
|
26
26
|
"three-stdlib": "^2.28.7",
|