Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: capacitor/geolocation returns course instead of heading as "heading" #2208

Open
3 tasks done
danielkorosi opened this issue Oct 10, 2024 · 1 comment
Open
3 tasks done

Comments

@danielkorosi
Copy link

danielkorosi commented Oct 10, 2024

Capacitor Version

[warn] The bundledWebRuntime configuration option has been deprecated. Can be safely deleted.
💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 6.1.2
@capacitor/core: 6.1.2
@capacitor/android: 6.1.2
@capacitor/ios: 6.1.2

Installed Dependencies:

@capacitor/cli: 5.5.0
@capacitor/core: 5.5.0
@capacitor/android: 5.5.0
@capacitor/ios: 5.5.0

[success] Android looking great! 👌
[error] The web assets directory (./dist) must contain an index.html file.
It will be the entry point for the web portion of the Capacitor app.

Other API Details

No response

Platforms Affected

  • iOS
  • Android
  • Web

Current Behavior

I need the heading information of the device in order to write it in the exif data when taking photos. For this I tried to use the @capacitor/geolocation plugin which - according to the docs -provides the heading information as part of getCurrentPosition() return value. However, I receive always "-1" for the heading.
It seems to me that it is because the plugin does not actually return the "heading" value but the "course" value, which is - unlike heading - related to motion. See: https://github.com/ionic-team/capacitor-plugins/blob/main/geolocation/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift#L216

What is the reason for geolocation plugin returning the course instead of heading under name "heading"?
It would be more reasonable to return the heading instead of the course under name of "heading" in getCurrentPosition(), and return course under the name "course".

Expected Behavior

Return the heading instead of the course under name "heading" in getCurrentPosition(), and return course under the name "course".

Project Reproduction

https://github.com/ionic-team/capacitor-plugins/blob/main/geolocation/ios/Sources/GeolocationPlugin/GeolocationPlugin.swift#L216

Additional Information

No response

@eric-horodyski
Copy link
Member

This issue relates to Geolocation, which is part of the @capacitor/geolocation plugin, and as such as been transferred to the appropriate repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants