@wemap/geo 2.7.4 → 2.7.7
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/package.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"directory": "packages/geo"
|
|
13
13
|
},
|
|
14
14
|
"name": "@wemap/geo",
|
|
15
|
-
"version": "2.7.
|
|
15
|
+
"version": "2.7.7",
|
|
16
16
|
"bugs": {
|
|
17
17
|
"url": "https://github.com/wemap/wemap-modules-js/issues"
|
|
18
18
|
},
|
|
@@ -27,11 +27,11 @@
|
|
|
27
27
|
],
|
|
28
28
|
"license": "ISC",
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@wemap/logger": "^2.7.
|
|
31
|
-
"@wemap/maths": "^2.7.
|
|
30
|
+
"@wemap/logger": "^2.7.7",
|
|
31
|
+
"@wemap/maths": "^2.7.7",
|
|
32
32
|
"lodash.isfinite": "^3.3.2",
|
|
33
33
|
"lodash.isnumber": "^3.0.3",
|
|
34
34
|
"lodash.isstring": "^4.0.1"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "988e0675759932cfc6b64df7768c6e6e573df1d9"
|
|
37
37
|
}
|
|
@@ -29,11 +29,11 @@ class WGS84UserPosition extends WGS84 {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
set time(time) {
|
|
32
|
-
if (isNumber(time) && isFinite(time)
|
|
32
|
+
if (isNumber(time) && isFinite(time)) {
|
|
33
33
|
this._time = time;
|
|
34
34
|
} else {
|
|
35
35
|
if (typeof time !== 'undefined' && time !== null) {
|
|
36
|
-
throw new Error('time argument is not a
|
|
36
|
+
throw new Error('time argument is not a number');
|
|
37
37
|
}
|
|
38
38
|
this._time = null;
|
|
39
39
|
}
|
|
@@ -23,7 +23,7 @@ describe('WGS84UserPosition', () => {
|
|
|
23
23
|
expect(() => new WGS84UserPosition(45, 5, null, null, null)).not.throw(Error);
|
|
24
24
|
expect(() => new WGS84UserPosition(45, 5, null, null, 0)).not.throw(Error);
|
|
25
25
|
expect(() => new WGS84UserPosition(45, 5, null, null, 10)).not.throw(Error);
|
|
26
|
-
expect(() => new WGS84UserPosition(45, 5, null, null, -10)).throw(Error);
|
|
26
|
+
expect(() => new WGS84UserPosition(45, 5, null, null, -10)).not.throw(Error);
|
|
27
27
|
expect(() => new WGS84UserPosition(45, 5, null, null, Number.POSITIVE_INFINITY)).throw(Error);
|
|
28
28
|
|
|
29
29
|
expect(() => new WGS84UserPosition(45, 5, null, null, null, null)).not.throw(Error);
|
|
@@ -43,8 +43,8 @@ class Attitude {
|
|
|
43
43
|
get heading() {
|
|
44
44
|
if (this._heading === null) {
|
|
45
45
|
let offset = 0;
|
|
46
|
-
if (
|
|
47
|
-
offset = deg2rad(
|
|
46
|
+
if (typeof(window) !== 'undefined' && window && window.orientation) {
|
|
47
|
+
offset = deg2rad(window.orientation);
|
|
48
48
|
}
|
|
49
49
|
this._heading = Rotations.getHeadingFromQuaternion(this.quaternion) + offset;
|
|
50
50
|
}
|