@takram/three-geospatial 0.2.0 → 0.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/build/index.cjs.map +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/build/r3f.cjs +1 -1
- package/build/r3f.cjs.map +1 -1
- package/build/r3f.js +43 -27
- package/build/r3f.js.map +1 -1
- package/package.json +1 -1
package/build/r3f.cjs
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),c=require("react"),p=require("three"),i=require("./shared.cjs"),m=require("@react-three/fiber"),E=new p.Matrix4,d=new i.Geodetic,h=new p.Vector3;class R extends p.Group{set(e,o,r,s=i.Ellipsoid.WGS84){const n=d.set(e,o,r).toECEF(h);s.getEastNorthUpFrame(n,E).decompose(this.position,this.quaternion,this.scale)}}const x=c.forwardRef(function({longitude:e,latitude:o,height:r=0,ellipsoid:s=i.Ellipsoid.WGS84,children:n},l){const u=c.useMemo(()=>new R,[]);return c.useEffect(()=>{u.set(e,o,r,s)},[e,o,r,s,u]),a.jsx("primitive",{ref:l,object:u,children:n})});function G(t){return e=>{for(const o of t)f(o,e)}}function g(t){return e=>{const o=[];for(const r of t){const s=f(r,e),n=typeof s=="function";o.push(n?s:()=>f(r,null))}return()=>{for(const r of o)r()}}}function f(t,e){if(typeof t=="function")return t(e);t&&(t.current=e)}var y=parseInt(c.version.split(".")[0],10)>=19?g:G;const S=c.forwardRef(function({args:e,children:o,...r},s){const n=c.useRef(null);return m.extend({EllipsoidGeometry:i.EllipsoidGeometry}),a.jsxs("mesh",{ref:y([n,s]),...r,children:[a.jsx("ellipsoidGeometry",{args:e}),o]})});exports.EastNorthUpFrame=x;exports.EllipsoidMesh=S;
|
2
2
|
//# sourceMappingURL=r3f.cjs.map
|
package/build/r3f.cjs.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"r3f.cjs","sources":["../src/r3f/EastNorthUpFrame.tsx","../node_modules/.pnpm/react-merge-refs@
|
1
|
+
{"version":3,"file":"r3f.cjs","sources":["../src/r3f/EastNorthUpFrame.tsx","../node_modules/.pnpm/react-merge-refs@3.0.2_react@19.0.0/node_modules/react-merge-refs/dist/index.js","../src/r3f/EllipsoidMesh.tsx"],"sourcesContent":null,"names":["matrixScratch","Matrix4","geodeticScratch","Geodetic","vectorScratch","Vector3","EastNorthUpFrameGroup","Group","longitude","latitude","height","ellipsoid","Ellipsoid","position","EastNorthUpFrame","forwardRef","children","forwardedRef","group","useMemo","useEffect","mergeRefsReact16","refs","value","ref","assignRef","mergeRefsReact19","cleanups","cleanup","isCleanup","mergeRefs","version","EllipsoidMesh","args","props","useRef","extend","EllipsoidGeometry","jsxs","jsx"],"mappings":"qNAOMA,MAAkCC,EAAAA,QAClCC,MAAoCC,EAAAA,SACpCC,MAAkCC,EAAAA,QAExC,MAAMC,UAA8BC,EAAAA,KAAM,CACxC,IACEC,EACAC,EACAC,EACAC,EAAYC,YAAU,MAChB,CAEA,MAAAC,EAAWX,EACd,IAAIM,EAAWC,EAAUC,CAAM,EAC/B,OAAON,CAAa,EACRO,EAAU,oBAAoBE,EAAUb,CAAa,EAC7D,UAAU,KAAK,SAAU,KAAK,WAAY,KAAK,KAAK,CAAA,CAE/D,CAQO,MAAMc,EAAiCC,EAAAA,WAG5C,SACA,CAAE,UAAAP,EAAW,SAAAC,EAAU,OAAAC,EAAS,EAAG,UAAAC,EAAYC,EAAA,UAAU,MAAO,SAAAI,CAAA,EAChEC,EACA,CACA,MAAMC,EAAQC,EAAQ,QAAA,IAAM,IAAIb,EAAyB,CAAA,CAAE,EAE3Dc,OAAAA,EAAAA,UAAU,IAAM,CACdF,EAAM,IAAIV,EAAWC,EAAUC,EAAQC,CAAS,CAAA,EAC/C,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|
1
|
+
import { jsx as a, jsxs as u } from "react/jsx-runtime";
|
2
|
+
import { forwardRef as p, useMemo as l, useEffect as h, version as E, useRef as d } from "react";
|
3
|
+
import { Group as x, Vector3 as G, Matrix4 as R } from "three";
|
4
|
+
import { E as m, G as g, a as w } from "./shared.js";
|
5
5
|
import { extend as F } from "@react-three/fiber";
|
6
|
-
const S = /* @__PURE__ */ new
|
7
|
-
class
|
8
|
-
set(
|
9
|
-
const
|
10
|
-
|
6
|
+
const S = /* @__PURE__ */ new R(), y = /* @__PURE__ */ new g(), N = /* @__PURE__ */ new G();
|
7
|
+
class U extends x {
|
8
|
+
set(t, o, r, s = m.WGS84) {
|
9
|
+
const n = y.set(t, o, r).toECEF(N);
|
10
|
+
s.getEastNorthUpFrame(n, S).decompose(this.position, this.quaternion, this.scale);
|
11
11
|
}
|
12
12
|
}
|
13
|
-
const
|
14
|
-
const c =
|
15
|
-
return
|
16
|
-
c.set(
|
17
|
-
}, [
|
13
|
+
const V = /* @__PURE__ */ p(function({ longitude: t, latitude: o, height: r = 0, ellipsoid: s = m.WGS84, children: n }, f) {
|
14
|
+
const c = l(() => new U(), []);
|
15
|
+
return h(() => {
|
16
|
+
c.set(t, o, r, s);
|
17
|
+
}, [t, o, r, s, c]), /* @__PURE__ */ a("primitive", { ref: f, object: c, children: n });
|
18
18
|
});
|
19
|
-
function
|
20
|
-
return (
|
21
|
-
i
|
22
|
-
typeof t == "function" ? t(o) : t != null && (t.current = o);
|
23
|
-
});
|
19
|
+
function j(e) {
|
20
|
+
return (t) => {
|
21
|
+
for (const o of e) i(o, t);
|
24
22
|
};
|
25
23
|
}
|
26
|
-
|
27
|
-
|
28
|
-
const
|
29
|
-
|
30
|
-
|
31
|
-
|
24
|
+
function v(e) {
|
25
|
+
return (t) => {
|
26
|
+
const o = [];
|
27
|
+
for (const r of e) {
|
28
|
+
const s = i(r, t), n = typeof s == "function";
|
29
|
+
o.push(n ? s : () => i(r, null));
|
30
|
+
}
|
31
|
+
return () => {
|
32
|
+
for (const r of o) r();
|
33
|
+
};
|
34
|
+
};
|
35
|
+
}
|
36
|
+
function i(e, t) {
|
37
|
+
if (typeof e == "function")
|
38
|
+
return e(t);
|
39
|
+
e && (e.current = t);
|
40
|
+
}
|
41
|
+
var M = parseInt(E.split(".")[0], 10) >= 19 ? v : j;
|
42
|
+
const k = /* @__PURE__ */ p(
|
43
|
+
function({ args: t, children: o, ...r }, s) {
|
44
|
+
const n = d(null);
|
45
|
+
return F({ EllipsoidGeometry: w }), /* @__PURE__ */ u("mesh", { ref: M([n, s]), ...r, children: [
|
46
|
+
/* @__PURE__ */ a("ellipsoidGeometry", { args: t }),
|
47
|
+
o
|
32
48
|
] });
|
33
49
|
}
|
34
50
|
);
|
35
51
|
export {
|
36
|
-
|
37
|
-
|
52
|
+
V as EastNorthUpFrame,
|
53
|
+
k as EllipsoidMesh
|
38
54
|
};
|
39
55
|
//# sourceMappingURL=r3f.js.map
|
package/build/r3f.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"r3f.js","sources":["../src/r3f/EastNorthUpFrame.tsx","../node_modules/.pnpm/react-merge-refs@
|
1
|
+
{"version":3,"file":"r3f.js","sources":["../src/r3f/EastNorthUpFrame.tsx","../node_modules/.pnpm/react-merge-refs@3.0.2_react@19.0.0/node_modules/react-merge-refs/dist/index.js","../src/r3f/EllipsoidMesh.tsx"],"sourcesContent":null,"names":["matrixScratch","Matrix4","geodeticScratch","Geodetic","vectorScratch","Vector3","EastNorthUpFrameGroup","Group","longitude","latitude","height","ellipsoid","Ellipsoid","position","EastNorthUpFrame","forwardRef","children","forwardedRef","group","useMemo","useEffect","mergeRefsReact16","refs","value","ref","assignRef","mergeRefsReact19","cleanups","cleanup","isCleanup","mergeRefs","version","EllipsoidMesh","args","props","useRef","extend","EllipsoidGeometry","jsxs","jsx"],"mappings":";;;;;AAOA,MAAMA,wBAAkCC,EAAQ,GAC1CC,wBAAoCC,EAAS,GAC7CC,wBAAkCC,EAAQ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