@wemap/providers 11.2.3 → 11.2.5
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/index.js
CHANGED
|
@@ -11,11 +11,29 @@ const maths = require("@wemap/maths");
|
|
|
11
11
|
const routers = require("@wemap/routers");
|
|
12
12
|
const utils = require("@wemap/utils");
|
|
13
13
|
const Logger = require("@wemap/logger");
|
|
14
|
-
const
|
|
14
|
+
const geomag = require("geomag");
|
|
15
15
|
const camera = require("@wemap/camera");
|
|
16
16
|
const _interopDefaultLegacy = (e) => e && typeof e === "object" && "default" in e ? e : { default: e };
|
|
17
|
+
function _interopNamespace(e) {
|
|
18
|
+
if (e && e.__esModule)
|
|
19
|
+
return e;
|
|
20
|
+
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
21
|
+
if (e) {
|
|
22
|
+
for (const k in e) {
|
|
23
|
+
if (k !== "default") {
|
|
24
|
+
const d = Object.getOwnPropertyDescriptor(e, k);
|
|
25
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: () => e[k]
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
n.default = e;
|
|
33
|
+
return Object.freeze(n);
|
|
34
|
+
}
|
|
17
35
|
const Logger__default = /* @__PURE__ */ _interopDefaultLegacy(Logger);
|
|
18
|
-
const
|
|
36
|
+
const geomag__namespace = /* @__PURE__ */ _interopNamespace(geomag);
|
|
19
37
|
class RelativeAttitude extends geo.Attitude {
|
|
20
38
|
}
|
|
21
39
|
class AbsoluteAttitude extends geo.Attitude {
|
|
@@ -2223,8 +2241,8 @@ class AbsoluteAttitudeFromBrowser extends Provider {
|
|
|
2223
2241
|
});
|
|
2224
2242
|
__publicField(this, "onAbsolutePositionEvent", (position) => {
|
|
2225
2243
|
this.absolutePositionEvent = position;
|
|
2226
|
-
const wmmResult =
|
|
2227
|
-
this.declinationQuaternion = maths.Quaternion.fromAxisAngle([0, 0, 1], -maths.deg2rad(wmmResult.
|
|
2244
|
+
const wmmResult = geomag__namespace.field(position.lat, position.lng);
|
|
2245
|
+
this.declinationQuaternion = maths.Quaternion.fromAxisAngle([0, 0, 1], -maths.deg2rad(wmmResult.declination));
|
|
2228
2246
|
AbsolutePositionProvider$1.removeEventListener(this.absolutePositionProviderId);
|
|
2229
2247
|
delete this.absolutePositionProviderId;
|
|
2230
2248
|
this.compute();
|