gl-draw 0.17.0-beta.36 → 0.17.0-beta.37
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/dist/cartographicToCartesian.js +1 -0
- package/dist/cartographicToCartesian.module.js +49 -0
- package/dist/index.module2.js +325 -320
- package/dist/index2.js +4 -4
- package/dist/objects/conicPolygon/geometry/index.d.ts +1 -2
- package/dist/objects/ellipsoid/createGeometry.d.ts +30 -0
- package/dist/objects/ellipsoid/index.d.ts +38 -0
- package/dist/objects/index.d.ts +1 -0
- package/dist/objects/index.js +1 -1
- package/dist/objects/index.module.js +662 -619
- package/dist/plugins/Worker/getAttributes/conicLine.d.ts +1 -1
- package/dist/plugins/Worker/getAttributes/conicPolygon.d.ts +2 -3
- package/dist/plugins/index.js +1 -1
- package/dist/plugins/index.module.js +36 -36
- package/dist/utils/cartographicToCartesian.d.ts +30 -0
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.module.js +15 -13
- package/package.json +1 -1
- package/dist/polar2Cartesian.js +0 -1
- package/dist/polar2Cartesian.module.js +0 -18
- package/dist/utils/polar2Cartesian.d.ts +0 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Vector3 } from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* 将地理坐标 (经度, 纬度, 高度) 转换为 Cartesian3 坐标
|
|
4
|
+
* 类似 Cesium 的 Ellipsoid.cartographicToCartesian
|
|
5
|
+
* @param longitude 经度(度)
|
|
6
|
+
* @param latitude 纬度(度)
|
|
7
|
+
* @param height 椭球体表面之上的高度(米),默认为 0
|
|
8
|
+
* @param scaleFactor 缩放因子,默认为 1/WGS84.a(将地球缩放到半径≈1)
|
|
9
|
+
* @param usePerfectSphere 是否使用完美球体(忽略椭球体扁率),默认 false
|
|
10
|
+
* @returns Vector3 笛卡尔坐标(已缩放)
|
|
11
|
+
*/
|
|
12
|
+
export declare const WGS84: {
|
|
13
|
+
a: number;
|
|
14
|
+
b: number;
|
|
15
|
+
f: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function cartographicToCartesian(longitude: number, latitude: number, height?: number, scaleFactor?: number, usePerfectSphere?: boolean): Vector3;
|
|
18
|
+
/**
|
|
19
|
+
* 将 Cartesian3 坐标转换为地理坐标 (经度, 纬度, 高度)
|
|
20
|
+
* 类似 Cesium 的 Ellipsoid.cartesianToCartographic
|
|
21
|
+
* @param cartesian Vector3 笛卡尔坐标(已缩放)
|
|
22
|
+
* @param scaleFactor 缩放因子,必须与 cartographicToCartesian 使用的相同
|
|
23
|
+
* @param usePerfectSphere 是否使用完美球体,必须与 cartographicToCartesian 使用的相同
|
|
24
|
+
* @returns {longitude, latitude, height} 经纬度(度)和高度(米)
|
|
25
|
+
*/
|
|
26
|
+
export declare function cartesianToCartographic(cartesian: Vector3, scaleFactor?: number, usePerfectSphere?: boolean): {
|
|
27
|
+
longitude: number;
|
|
28
|
+
latitude: number;
|
|
29
|
+
height: number;
|
|
30
|
+
};
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -2,5 +2,5 @@ export { applyTextureColorSpace } from './applyTextureColorSpace';
|
|
|
2
2
|
export * from './getProjection';
|
|
3
3
|
export { isPlainObject } from './isPlainObject';
|
|
4
4
|
export * from './parseVector';
|
|
5
|
-
export
|
|
5
|
+
export * from './cartographicToCartesian';
|
|
6
6
|
export * from './uvGenerator';
|
package/dist/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("../isPlainObject.js"),s=require("d3-geo"),p=require("d3-geo-projection"),r=require("../cartographicToCartesian.js"),g=require("../uvGenerator.js"),u={mercator:s.geoMercator,equirectangular:s.geoEquirectangular,winkel3:p.geoWinkel3},c={},j=e=>{var o,n,i;const t=JSON.stringify(e);if(c[t])return c[t];const a=u[(o=e.projectionType)!=null?o:"mercator"]().center(e.center).scale(e.scale).translate((n=e.translate)!=null?n:[0,0]).precision((i=e.precision)!=null?i:.1);return e.rotate&&a.rotate(e.rotate),c[t]=a,a};exports.applyTextureColorSpace=l.applyTextureColorSpace;exports.isPlainObject=l.isPlainObject;exports.WGS84=r.WGS84;exports.cartesianToCartographic=r.cartesianToCartographic;exports.cartographicToCartesian=r.cartographicToCartesian;exports.parseVector2=r.parseVector2;exports.parseVector3=r.parseVector3;exports.claerUVGenerator=g.claerUVGenerator;exports.getUVGenerator=g.getUVGenerator;exports.getProjection=j;
|
|
@@ -1,27 +1,29 @@
|
|
|
1
1
|
import { a as x, i as y } from "../isPlainObject.module.js";
|
|
2
2
|
import { geoMercator as i, geoEquirectangular as s } from "d3-geo";
|
|
3
3
|
import { geoWinkel3 as p } from "d3-geo-projection";
|
|
4
|
-
import { b,
|
|
5
|
-
import { c as
|
|
4
|
+
import { W as V, b, c as k, a as C, p as G } from "../cartographicToCartesian.module.js";
|
|
5
|
+
import { c as S, g as W } from "../uvGenerator.module.js";
|
|
6
6
|
const l = {
|
|
7
7
|
mercator: i,
|
|
8
8
|
equirectangular: s,
|
|
9
9
|
winkel3: p
|
|
10
|
-
},
|
|
10
|
+
}, t = {}, f = (r) => {
|
|
11
11
|
var o, c, n;
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
14
|
-
return
|
|
15
|
-
const
|
|
16
|
-
return
|
|
12
|
+
const e = JSON.stringify(r);
|
|
13
|
+
if (t[e])
|
|
14
|
+
return t[e];
|
|
15
|
+
const a = l[(o = r.projectionType) != null ? o : "mercator"]().center(r.center).scale(r.scale).translate((c = r.translate) != null ? c : [0, 0]).precision((n = r.precision) != null ? n : 0.1);
|
|
16
|
+
return r.rotate && a.rotate(r.rotate), t[e] = a, a;
|
|
17
17
|
};
|
|
18
18
|
export {
|
|
19
|
+
V as WGS84,
|
|
19
20
|
x as applyTextureColorSpace,
|
|
20
|
-
|
|
21
|
+
b as cartesianToCartographic,
|
|
22
|
+
k as cartographicToCartesian,
|
|
23
|
+
S as claerUVGenerator,
|
|
21
24
|
f as getProjection,
|
|
22
|
-
|
|
25
|
+
W as getUVGenerator,
|
|
23
26
|
y as isPlainObject,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
O as polar2Cartesian
|
|
27
|
+
C as parseVector2,
|
|
28
|
+
G as parseVector3
|
|
27
29
|
};
|
package/package.json
CHANGED
package/dist/polar2Cartesian.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("three"),s=t=>t instanceof e.Vector3?t:new e.Vector3(...t),c=t=>t instanceof e.Vector2?t:new e.Vector2(...t);function i(t,o,r=0){const n=(90-o)*Math.PI/180,a=(90-t)*Math.PI/180;return[r*Math.sin(n)*Math.cos(a),r*Math.cos(n),r*Math.sin(n)*Math.sin(a)]}exports.parseVector2=c;exports.parseVector3=s;exports.polar2Cartesian=i;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { Vector3 as e, Vector2 as o } from "three";
|
|
2
|
-
const i = (t) => t instanceof e ? t : new e(...t), h = (t) => t instanceof o ? t : new o(...t);
|
|
3
|
-
function p(t, s, n = 0) {
|
|
4
|
-
const a = (90 - s) * Math.PI / 180, r = (90 - t) * Math.PI / 180;
|
|
5
|
-
return [
|
|
6
|
-
n * Math.sin(a) * Math.cos(r),
|
|
7
|
-
// x
|
|
8
|
-
n * Math.cos(a),
|
|
9
|
-
// y
|
|
10
|
-
n * Math.sin(a) * Math.sin(r)
|
|
11
|
-
// z
|
|
12
|
-
];
|
|
13
|
-
}
|
|
14
|
-
export {
|
|
15
|
-
p as a,
|
|
16
|
-
h as b,
|
|
17
|
-
i as p
|
|
18
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function polar2Cartesian(lng: number, lat: number, r?: number): number[];
|