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.

Updating and restoring camera pitch causes a shift north #14362

Closed

Description

@datwelk

When changing the pitch of the current camera to a different angle, and changing it back to the original angle, the map has moved from its original position. This does NOT happen when doing the same thing with a two finger pan.

From what I suspect it may have to do with the edge padding, caused by the difference between using CameraOptions' anchor and center properties. The pan method sets the anchor to the center coordinate, whereas in my programmatic camera change I can not access this property and use the current camera's center.

Steps to reproduce

  1. Ensure a 0 pitch of the current map camera
  2. Programmatically obtain the current map's camera, set the pitch to an angle of 45 degrees, and call setCamera: on the map with the newly created camera.
  3. Programmatically change the map's camera back to its original pitch angle of 0 degrees.

Expected behavior

The map looks identical at step 1 and 3.

Actual behavior

The map has moved substantially up north.

Configuration

Mapbox SDK versions: 4.3
iOS/macOS versions: iOS 12.1.1
Device/simulator models: iPad Mini
Xcode version: 10.1

Activity

  1. added
    iOS
    on Apr 8, 2019
  2. TimWatson commented on Apr 9, 2019

    @TimWatson

    This might be related to #14150

  3. datwelk commented on Apr 26, 2019

    @datwelk
    Author

    @friedbunny is there anything I could do to help resolve this issue? Would a sample project help (I'm looking at the 'needs reproduction' label)?

  4. julianrex commented on Apr 26, 2019

    @julianrex
    Contributor

    @datwelk a reproduction sample project would be most welcome!

  5. datwelk commented on Apr 29, 2019

    @datwelk
    Author

    @julianrex here you go: https://github.com/datwelk/MapboxPerspectiveBug

    It seems to only occur when edgePadding is provided when updating the map's camera. Perhaps I'm misinterpreting the meaning of the edge padding? See this line

  6. astojilj commented on May 15, 2019

    @astojilj
    Contributor

    @datwelk thanks.
    Fix for this is part of PR #14664. I used this patch with iOS demo to reproduce/verify it.

  7. added this to the release-oolong milestone on Sep 6, 2019
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

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions