dgeoutils 2.4.17 → 2.4.18
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/cjs/DPoint.d.ts +6 -1
- package/dist/cjs/DPoint.js +15 -0
- package/dist/es2015/DPoint.js +15 -0
- package/dist/esm/DPoint.js +15 -0
- package/dist/umd/dgeoutils.js +16 -1
- package/dist/umd/dgeoutils.min.js +1 -1
- package/dist/umd/dgeoutils.min.js.map +1 -1
- package/package.json +1 -1
package/dist/cjs/DPoint.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ export interface LatLng {
|
|
|
9
9
|
lon?: number;
|
|
10
10
|
alt?: number;
|
|
11
11
|
}
|
|
12
|
+
export interface XYZ extends Record<string, any> {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
z?: number;
|
|
16
|
+
}
|
|
12
17
|
export declare const HALF_PI_IN_DEGREE = 90;
|
|
13
18
|
export declare const PI_IN_DEGREE = 180;
|
|
14
19
|
export declare const DOUBLE_PI_IN_DEGREE = 360;
|
|
@@ -25,7 +30,7 @@ export declare class DPoint {
|
|
|
25
30
|
constructor(x: number, y: number);
|
|
26
31
|
constructor(x: number, y: number, z?: number);
|
|
27
32
|
static zero(): DPoint;
|
|
28
|
-
static parse(c: LatLng | number[] | DCoord | Point | Feature<Point
|
|
33
|
+
static parse(c: LatLng | number[] | DCoord | Point | Feature<Point> | XYZ, format?: string): DPoint;
|
|
29
34
|
static parseFromWKT(wkt: string): DPoint;
|
|
30
35
|
static random(): DPoint;
|
|
31
36
|
static getTileFromQuadKey(quadKey: string): DPoint;
|
package/dist/cjs/DPoint.js
CHANGED
|
@@ -10,6 +10,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
10
10
|
};
|
|
11
11
|
return __assign.apply(this, arguments);
|
|
12
12
|
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
13
24
|
var __read = (this && this.__read) || function (o, n) {
|
|
14
25
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
15
26
|
if (!m) return o;
|
|
@@ -63,6 +74,10 @@ var DPoint = (function () {
|
|
|
63
74
|
if (lat && lng) {
|
|
64
75
|
return new DPoint(lng, lat, alt !== null && alt !== void 0 ? alt : 0);
|
|
65
76
|
}
|
|
77
|
+
var _c = c, x = _c.x, y = _c.y, z = _c.z, properties = __rest(_c, ["x", "y", "z"]);
|
|
78
|
+
if ((0, utils_1.isDefAndNotNull)(x) && (0, utils_1.isDefAndNotNull)(y)) {
|
|
79
|
+
return new DPoint(x, y, z).setProperties(properties);
|
|
80
|
+
}
|
|
66
81
|
var t = c;
|
|
67
82
|
if (c.type === 'Point') {
|
|
68
83
|
t = c.coordinates;
|
package/dist/es2015/DPoint.js
CHANGED
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
1
12
|
import { DLine } from './DLine';
|
|
2
13
|
import { DPolygon } from './DPolygon';
|
|
3
14
|
import { checkFunction, createArray, DGeo, div, isDefAndNotNull } from './utils';
|
|
@@ -30,6 +41,10 @@ export class DPoint {
|
|
|
30
41
|
if (lat && lng) {
|
|
31
42
|
return new DPoint(lng, lat, alt !== null && alt !== void 0 ? alt : 0);
|
|
32
43
|
}
|
|
44
|
+
const _a = c, { x, y, z } = _a, properties = __rest(_a, ["x", "y", "z"]);
|
|
45
|
+
if (isDefAndNotNull(x) && isDefAndNotNull(y)) {
|
|
46
|
+
return new DPoint(x, y, z).setProperties(properties);
|
|
47
|
+
}
|
|
33
48
|
let t = c;
|
|
34
49
|
if (c.type === 'Point') {
|
|
35
50
|
t = c.coordinates;
|
package/dist/esm/DPoint.js
CHANGED
|
@@ -9,6 +9,17 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
+
var t = {};
|
|
14
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
+
t[p] = s[p];
|
|
16
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
+
t[p[i]] = s[p[i]];
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
};
|
|
12
23
|
var __read = (this && this.__read) || function (o, n) {
|
|
13
24
|
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
14
25
|
if (!m) return o;
|
|
@@ -60,6 +71,10 @@ var DPoint = (function () {
|
|
|
60
71
|
if (lat && lng) {
|
|
61
72
|
return new DPoint(lng, lat, alt !== null && alt !== void 0 ? alt : 0);
|
|
62
73
|
}
|
|
74
|
+
var _c = c, x = _c.x, y = _c.y, z = _c.z, properties = __rest(_c, ["x", "y", "z"]);
|
|
75
|
+
if (isDefAndNotNull(x) && isDefAndNotNull(y)) {
|
|
76
|
+
return new DPoint(x, y, z).setProperties(properties);
|
|
77
|
+
}
|
|
63
78
|
var t = c;
|
|
64
79
|
if (c.type === 'Point') {
|
|
65
80
|
t = c.coordinates;
|