@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/build/r3f.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("react/jsx-runtime"),i=require("react"),l=require("three"),n=require("./shared.cjs"),f=require("@react-three/fiber"),E=new l.Matrix4,m=new n.Geodetic,d=new l.Vector3;class h extends l.Group{set(t,e,o,r=n.Ellipsoid.WGS84){const s=m.set(t,e,o).toECEF(d);r.getEastNorthUpFrame(s,E).decompose(this.position,this.quaternion,this.scale)}}const x=i.forwardRef(function({longitude:t,latitude:e,height:o=0,ellipsoid:r=n.Ellipsoid.WGS84,children:s},p){const a=i.useMemo(()=>new h,[]);return i.useEffect(()=>{a.set(t,e,o,r)},[t,e,o,r,a]),u.jsx("primitive",{ref:p,object:a,children:s})});function G(c){return t=>{c.forEach(e=>{typeof e=="function"?e(t):e!=null&&(e.current=t)})}}const S=i.forwardRef(function({args:t,children:e,...o},r){const s=i.useRef(null);return f.extend({EllipsoidGeometry:n.EllipsoidGeometry}),u.jsxs("mesh",{ref:G([s,r]),...o,children:[u.jsx("ellipsoidGeometry",{args:t}),e]})});exports.EastNorthUpFrame=x;exports.EllipsoidMesh=S;
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@2.1.1/node_modules/react-merge-refs/dist/index.mjs","../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","o","f","r","n","EllipsoidMesh","args","props","ref","useRef","extend","EllipsoidGeometry","jsxs","mergeRefs","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,CAACH,EAAWC,EAAUC,EAAQC,EAAWO,CAAK,CAAC,QAG/C,YAAU,CAAA,IAAKD,EAAc,OAAQC,EACnC,SAAAF,EACH,CAEJ,CAAC,ECnDD,SAASK,EAAEC,EAAE,CAAC,OAAOC,GAAG,CAACD,EAAE,QAAQE,GAAG,CAAC,OAAOA,GAAG,WAAWA,EAAED,CAAC,EAAEC,GAAG,OAAOA,EAAE,QAAQD,EAAE,CAAC,CAAC,CAAC,CCsBnF,MAAME,EAA8BV,EAAA,WACzC,SAAmB,CAAE,KAAAW,EAAM,SAAAV,EAAU,GAAGW,GAASV,EAAc,CACvD,MAAAW,EAAMC,SAAoB,IAAI,EAC7BC,OAAAA,EAAA,OAAA,CAAEC,kBAAAA,EAAAA,kBAAmB,EAE1BC,OAAC,OAAK,CAAA,IAAKC,EAAU,CAACL,EAAKX,CAAY,CAAC,EAAI,GAAGU,EAC7C,SAAA,CAAAO,MAAC,qBAAkB,KAAAR,EAAY,EAC9BV,CAAA,EACH,CAAA,CAGN","x_google_ignoreList":[1]}
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,CAACH,EAAWC,EAAUC,EAAQC,EAAWO,CAAK,CAAC,QAG/C,YAAU,CAAA,IAAKD,EAAc,OAAQC,EACnC,SAAAF,EACH,CAEJ,CAAC,EC/CD,SAASK,EAAiBC,EAAM,CAC9B,OAAQC,GAAU,CAChB,UAAWC,KAAOF,EAAMG,EAAUD,EAAKD,CAAK,CAC7C,CACH,CAGA,SAASG,EAAiBJ,EAAM,CAC9B,OAAQC,GAAU,CAChB,MAAMI,EAAW,CAAE,EACnB,UAAWH,KAAOF,EAAM,CACtB,MAAMM,EAAUH,EAAUD,EAAKD,CAAK,EAC9BM,EAAY,OAAOD,GAAY,WACrCD,EAAS,KAAKE,EAAYD,EAAU,IAAMH,EAAUD,EAAK,IAAI,CAAC,CACpE,CACI,MAAO,IAAM,CACX,UAAWI,KAAWD,EAAUC,EAAS,CAC1C,CACF,CACH,CAGA,SAASH,EAAUD,EAAKD,EAAO,CAC7B,GAAI,OAAOC,GAAQ,WACjB,OAAOA,EAAID,CAAK,EACPC,IACTA,EAAI,QAAUD,EAElB,CACA,IAAIO,EAAY,SAASC,UAAQ,MAAM,GAAG,EAAE,CAAC,EAAG,EAAE,GAAK,GAAKL,EAAmBL,ECXxE,MAAMW,EAA8BjB,EAAA,WACzC,SAAmB,CAAE,KAAAkB,EAAM,SAAAjB,EAAU,GAAGkB,GAASjB,EAAc,CACvD,MAAAO,EAAMW,SAAoB,IAAI,EAC7BC,OAAAA,EAAA,OAAA,CAAEC,kBAAAA,EAAAA,kBAAmB,EAE1BC,OAAC,OAAK,CAAA,IAAKR,EAAU,CAACN,EAAKP,CAAY,CAAC,EAAI,GAAGiB,EAC7C,SAAA,CAAAK,MAAC,qBAAkB,KAAAN,EAAY,EAC9BjB,CAAA,EACH,CAAA,CAGN","x_google_ignoreList":[1]}
package/build/r3f.js CHANGED
@@ -1,39 +1,55 @@
1
- import { jsx as a, jsxs as f } from "react/jsx-runtime";
2
- import { forwardRef as m, useMemo as u, useEffect as l, useRef as E } from "react";
3
- import { Group as h, Vector3 as d, Matrix4 as x } from "three";
4
- import { E as p, G, a as w } from "./shared.js";
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 x(), N = /* @__PURE__ */ new G(), U = /* @__PURE__ */ new d();
7
- class j extends h {
8
- set(o, t, r, e = p.WGS84) {
9
- const s = N.set(o, t, r).toECEF(U);
10
- e.getEastNorthUpFrame(s, S).decompose(this.position, this.quaternion, this.scale);
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 g = /* @__PURE__ */ m(function({ longitude: o, latitude: t, height: r = 0, ellipsoid: e = p.WGS84, children: s }, n) {
14
- const c = u(() => new j(), []);
15
- return l(() => {
16
- c.set(o, t, r, e);
17
- }, [o, t, r, e, c]), /* @__PURE__ */ a("primitive", { ref: n, object: c, children: s });
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 y(i) {
20
- return (o) => {
21
- i.forEach((t) => {
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
- const q = /* @__PURE__ */ m(
27
- function({ args: o, children: t, ...r }, e) {
28
- const s = E(null);
29
- return F({ EllipsoidGeometry: w }), /* @__PURE__ */ f("mesh", { ref: y([s, e]), ...r, children: [
30
- /* @__PURE__ */ a("ellipsoidGeometry", { args: o }),
31
- t
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
- g as EastNorthUpFrame,
37
- q as EllipsoidMesh
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@2.1.1/node_modules/react-merge-refs/dist/index.mjs","../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","o","f","r","n","EllipsoidMesh","args","props","ref","useRef","extend","EllipsoidGeometry","jsxs","mergeRefs","jsx"],"mappings":";;;;;AAOA,MAAMA,wBAAkCC,EAAQ,GAC1CC,wBAAoCC,EAAS,GAC7CC,wBAAkCC,EAAQ;AAEhD,MAAMC,UAA8BC,EAAM;AAAA,EACxC,IACEC,GACAC,GACAC,GACAC,IAAYC,EAAU,OAChB;AAEA,UAAAC,IAAWX,EACd,IAAIM,GAAWC,GAAUC,CAAM,EAC/B,OAAON,CAAa;AAEvB,IADeO,EAAU,oBAAoBE,GAAUb,CAAa,EAC7D,UAAU,KAAK,UAAU,KAAK,YAAY,KAAK,KAAK;AAAA,EAAA;AAE/D;AAQO,MAAMc,IAAiC,gBAAAC,EAG5C,SACA,EAAE,WAAAP,GAAW,UAAAC,GAAU,QAAAC,IAAS,GAAG,WAAAC,IAAYC,EAAU,OAAO,UAAAI,EAAA,GAChEC,GACA;AACA,QAAMC,IAAQC,EAAQ,MAAM,IAAIb,EAAsB,GAAG,CAAA,CAAE;AAE3D,SAAAc,EAAU,MAAM;AACd,IAAAF,EAAM,IAAIV,GAAWC,GAAUC,GAAQC,CAAS;AAAA,EAAA,GAC/C,CAACH,GAAWC,GAAUC,GAAQC,GAAWO,CAAK,CAAC,qBAG/C,aAAU,EAAA,KAAKD,GAAc,QAAQC,GACnC,UAAAF,GACH;AAEJ,CAAC;ACnDD,SAASK,EAAEC,GAAE;AAAC,SAAO,CAAAC,MAAG;AAAC,IAAAD,EAAE,QAAQ,CAAAE,MAAG;AAAC,aAAOA,KAAG,aAAWA,EAAED,CAAC,IAAEC,KAAG,SAAOA,EAAE,UAAQD;AAAA,IAAE,CAAC;AAAA,EAAC;AAAC;ACsBnF,MAAME,IAA8B,gBAAAV;AAAA,EACzC,SAAmB,EAAE,MAAAW,GAAM,UAAAV,GAAU,GAAGW,KAASV,GAAc;AACvD,UAAAW,IAAMC,EAAoB,IAAI;AAC7B,WAAAC,EAAA,EAAE,mBAAAC,GAAmB,GAE1B,gBAAAC,EAAC,QAAK,EAAA,KAAKC,EAAU,CAACL,GAAKX,CAAY,CAAC,GAAI,GAAGU,GAC7C,UAAA;AAAA,MAAA,gBAAAO,EAAC,uBAAkB,MAAAR,GAAY;AAAA,MAC9BV;AAAA,IAAA,GACH;AAAA,EAAA;AAGN;","x_google_ignoreList":[1]}
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","Ell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;AACX,iBAAWI,KAAWD,EAAU,CAAAC,EAAS;AAAA,IAC1C;AAAA,EACF;AACH;AAGA,SAASH,EAAUD,GAAKD,GAAO;AAC7B,MAAI,OAAOC,KAAQ;AACjB,WAAOA,EAAID,CAAK;AACX,EAAIC,MACTA,EAAI,UAAUD;AAElB;AACA,IAAIO,IAAY,SAASC,EAAQ,MAAM,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,KAAKL,IAAmBL;ACXxE,MAAMW,IAA8B,gBAAAjB;AAAA,EACzC,SAAmB,EAAE,MAAAkB,GAAM,UAAAjB,GAAU,GAAGkB,KAASjB,GAAc;AACvD,UAAAO,IAAMW,EAAoB,IAAI;AAC7B,WAAAC,EAAA,EAAE,mBAAAC,GAAmB,GAE1B,gBAAAC,EAAC,QAAK,EAAA,KAAKR,EAAU,CAACN,GAAKP,CAAY,CAAC,GAAI,GAAGiB,GAC7C,UAAA;AAAA,MAAA,gBAAAK,EAAC,uBAAkB,MAAAN,GAAY;AAAA,MAC9BjB;AAAA,IAAA,GACH;AAAA,EAAA;AAGN;","x_google_ignoreList":[1]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@takram/three-geospatial",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Provides fundamental functions for rendering GIS data in Three.js and R3F",
5
5
  "keywords": [
6
6
  "three",