Skip to content

Commit

Permalink
fix: geolocation api should not set orientation when undefined
Browse files Browse the repository at this point in the history
  • Loading branch information
Maximvdw committed Dec 10, 2023
1 parent 87aa1c8 commit 43d2345
Show file tree
Hide file tree
Showing 6 changed files with 595 additions and 7,777 deletions.
4 changes: 2 additions & 2 deletions modules/capacitor-geolocation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"@capacitor/geolocation": ">=4.1.0"
},
"devDependencies": {
"@capacitor/core": "^4.7.0",
"@capacitor/core": "^5.5.1",
"cross-env": "^7.0.3",
"@capacitor/geolocation": "^4.1.0"
"@capacitor/geolocation": "^5.0.6"
}
}
18 changes: 11 additions & 7 deletions modules/capacitor-geolocation/src/GeolocationSourceNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,17 @@ export class GeolocationSourceNode extends SourceNode<DataFrame> {
geoPos.altitude = position.coords.altitude;
geoPos.latitude = position.coords.latitude;
geoPos.longitude = position.coords.longitude;
geoPos.linearVelocity = new LinearVelocity(position.coords.speed);
geoPos.orientation = Orientation.fromEuler({
yaw: position.coords.heading,
pitch: 0,
roll: 0,
unit: AngleUnit.DEGREE,
});
if (position.coords.speed) {
geoPos.linearVelocity = new LinearVelocity(position.coords.speed);
}
if (position.coords.heading) {
geoPos.orientation = Orientation.fromEuler({
yaw: position.coords.heading,
pitch: 0,
roll: 0,
unit: AngleUnit.DEGREE,
});
}
return geoPos;
}

Expand Down
20 changes: 16 additions & 4 deletions modules/capacitor-geolocation/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
# yarn lockfile v1


"@capacitor/geolocation@^4.1.0":
version "4.1.0"
resolved "https://registry.yarnpkg.com/@capacitor/geolocation/-/geolocation-4.1.0.tgz#1941b5ca4288d7cb5c80940649d4416322b37ee2"
integrity sha512-hfI4MUcu1zcJPTvm0g6V3telTGwq9sCU8EnY4hFJpLedbIQeWPthCOSbFtNHAU5mVaAP1Zls3x6TsXL8TX08EA==
"@capacitor/core@^5.5.1":
version "5.5.1"
resolved "https://registry.yarnpkg.com/@capacitor/core/-/core-5.5.1.tgz#bd2a969a1149a480aed3483d8867677e85606058"
integrity sha512-VG6Iv8Q7ZAbvjodxpvjcSe0jfxUwZXnvjbi93ehuJ6eYP8U926qLSXyrT/DToZq+F6v/HyGyVgn3mrE/9jW2Tg==
dependencies:
tslib "^2.1.0"

"@capacitor/geolocation@^5.0.6":
version "5.0.6"
resolved "https://registry.yarnpkg.com/@capacitor/geolocation/-/geolocation-5.0.6.tgz#05f7d96f4274847c4e09f443cad71a21126a679a"
integrity sha512-3pB3CBa38aDMk7zouGbjOMBytcaqRMBosMcqNrOQjE5LMBAPUI1cEGrUzmkj+scP0SIyYGA95Tkj0BAnzvNWag==

cross-env@^7.0.3:
version "7.0.3"
Expand Down Expand Up @@ -45,6 +52,11 @@ shebang-regex@^3.0.0:
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==

tslib@^2.1.0:
version "2.6.2"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.6.2.tgz#703ac29425e7b37cd6fd456e92404d46d1f3e4ae"
integrity sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==

which@^2.0.1:
version "2.0.2"
resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
Expand Down
38 changes: 19 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,36 +21,36 @@
"bump:release": "standard-version -m 'chore(release): %s' --skip.changelog"
},
"devDependencies": {
"@babel/cli": "^7.23.0",
"@babel/core": "^7.23.2",
"@babel/preset-env": "^7.23.2",
"@openhps/core": ">=0.5.13",
"@types/chai": "^4.3.9",
"@types/cordova": "11.0.2",
"@types/mocha": "^10.0.3",
"@types/node": "^20.8.9",
"@typescript-eslint/eslint-plugin": "^6.9.0",
"@typescript-eslint/parser": "^6.9.0",
"@babel/cli": "^7.23.4",
"@babel/core": "^7.23.5",
"@babel/preset-env": "^7.23.5",
"@openhps/core": ">=0.6.8",
"@types/chai": "^4.3.11",
"@types/cordova": "11.0.3",
"@types/mocha": "^10.0.6",
"@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.13.2",
"@typescript-eslint/parser": "^6.13.2",
"chai": "^4.3.10",
"eslint": "^8.52.0",
"eslint-config-prettier": "^9.0.0",
"eslint": "^8.55.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-deprecation": "^2.0.0",
"eslint-plugin-import": "^2.29.0",
"eslint-plugin-jsdoc": "^46.8.2",
"eslint-plugin-jsdoc": "^46.9.0",
"eslint-plugin-prettier": "^5.0.1",
"mocha": "^10.2.0",
"mocha-junit-reporter": "^2.2.1",
"npm-run-all": "^4.1.5",
"nyc": "^15.1.0",
"prettier": "^3.0.3",
"reflect-metadata": "^0.1.13",
"prettier": "^3.1.0",
"reflect-metadata": "^0.1.14",
"shx": "^0.3.4",
"standard-version": "^9.5.0",
"ts-node": ">=10.9.1",
"typedoc": "^0.25.2",
"typescript": "^5.2.2",
"ts-node": ">=10.9.2",
"typedoc": "^0.25.4",
"typescript": "^5.3.3",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.9.1",
"webpack-bundle-analyzer": "^4.10.1",
"webpack-cli": "^5.1.4"
}
}
Loading

0 comments on commit 43d2345

Please sign in to comment.