Skip to content

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

@danielkorosi

Description

@danielkorosi

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions