Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Heading-tracking mode takes the long way around #1199

Closed

Description

@friedbunny

When using MGLUserTrackingModeFollowWithHeading, rotating the device several degrees around due south causes the map to go the wrong way to get there.

rotation-bug

Activity

  1. added
    iOS
    on Apr 3, 2015
  2. friedbunny commented on Apr 3, 2015

    @friedbunny
    ContributorAuthor

    The headings from [MGLMapView locationManager:didUpdateHeading:] are good.

    11:48:25.347 Mapbox GL[3393:500129] headingDirection: 179.321411 (true:179.321411/mag:165.504303)
    11:48:28.515 Mapbox GL[3393:500129] headingDirection: 184.756287 (true:184.756287/mag:170.939178)
    11:48:34.055 Mapbox GL[3393:500129] headingDirection: 179.454987 (true:179.454987/mag:165.637878)
    11:48:35.089 Mapbox GL[3393:500129] headingDirection: 184.748398 (true:184.748398/mag:170.931290)
    11:48:36.282 Mapbox GL[3393:500129] headingDirection: 179.720413 (true:179.720413/mag:165.903305)
    11:48:37.559 Mapbox GL[3393:500129] headingDirection: 185.071442 (true:185.071442/mag:171.254333)
  3. friedbunny commented on Apr 3, 2015

    @friedbunny
    ContributorAuthor

    Transform::_setAngle is interpolating between negative and positive angles, where headings < 180º become negative angles.

    headingDirection: 174.973160
    Transform::_setAngle: -2.920038 → -3.053858
    headingDirection: 180.300735
    Transform::_setAngle: -3.022575 → 3.136344
    headingDirection: 174.859329
    Transform::_setAngle: 3.136344 → -3.051871
    headingDirection: 180.390106
    Transform::_setAngle: -3.051871 → 3.134784
  4. friedbunny commented on Apr 7, 2015

    @friedbunny
    ContributorAuthor

    @kkaefer, perhaps you've got some ideas about the best way to fix what appears to be an interpolation issue?

  5. jfirebaugh commented on Apr 7, 2015

    @jfirebaugh
    Contributor

    This looks like the native version of mapbox/mapbox-gl-js#818, probably a similar fix should be applied.

  6. added a commit that references this issue on Apr 20, 2015
    3e529da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugiOS

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions