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.

update Transform geo/screen conversions for tilt #2139

Closed

Description

@incanus

In #2116 we have a PR for tilt/pitch. However we have yet to update Transform::pixelForLatLng & Transform::latLngForPixel to actually use the matrix instead of just doing trig for center, zoom, and rotation, so that pitch can be factored in. As a result, we get things like the floating user dot on iOS and these conversions will be off for e.g. long-press marker drop gestures, too.

Note that we do already account for world wrap and the date line in the current routines.

/cc @ansis @friedbunny @1ec5

Activity

  1. added
    GL JS parity
    on Aug 20, 2015
  2. 1ec5 commented on Aug 20, 2015

    @1ec5
    Contributor

    pixelForLatLng() and latLngForPixel() need to work with pitch, or things like fitToBounds() will yield unexpected results.

  3. incanus commented on Aug 20, 2015

    @incanus
    ContributorAuthor

    Right, this is not just cosmetic.

  4. self-assigned this
    on Aug 20, 2015
  5. incanus commented on Aug 20, 2015

    @incanus
    ContributorAuthor

    Per chat, it's unclear if -[MGLMapView metersPerPixelAtLatitude:] is affected by this. Need to investigate MapKit.

  6. ansis commented on Aug 24, 2015

    @ansis
    Contributor

    These should be implemented in 1551424 and fixed in 1081992.

    I'm still working on:

    • making the same location stay under your finger during panning, zooming, etc
    • making fitBounds work better
  7. ansis commented on Aug 26, 2015

    @ansis
    Contributor

    Gesture improvements are finished in https://github.com/mapbox/mapbox-gl-native/commits/perspective-continued

    • when you pan the same location stays under your finger
    • when you zoom the location at the center of the pinch stays the same
    • when you rotate the location at the center of the pinch stays the same
  8. incanus commented on Aug 28, 2015

    @incanus
    ContributorAuthor

    making fitBounds work better

    Is above and/or anything else here still actionable @ansis?

  9. 1ec5 commented on Sep 22, 2015

    @1ec5
    Contributor

    This is still actionable: fitBounds does not account for the trapezoidal shape of the bounds when the map is tilted. As a result, the map’s camera fails to round-trip correctly (tending to zoom out) when the map starts out tilted.

  10. incanus commented on Sep 22, 2015

    @incanus
    ContributorAuthor

    Just a clarification question here — does the fact that MapKit doesn’t use perspective, but just simple tilt, behave differently in this regard? I wonder if MKMapRect etc. automatically account for tilt.

  11. mb12 commented on Sep 22, 2015

    @mb12

    @incanus is it possible to share what's the difference between Mapbox perspective and Map kit tilt and why one picks over the other?

  12. 1ec5 commented on Oct 16, 2015

    @1ec5
    Contributor

    #2259 covers the fitBounds work that needs to take place. Let’s see if we can get @ansis’ work on the perspective-continued branch into master.

  13. 1ec5 commented on Oct 20, 2015

    @1ec5
    Contributor

    The perspective-continued branch appears to have been deleted. @ansis, can you re-push your work towards this issue? Or is that now covered by the perspective-improved-gestures branch? Thanks.

  14. friedbunny commented on Oct 20, 2015

    @friedbunny
    Contributor

    I have re-pushed perspective-continued from my local copy, feel free to delete if unnecessary.

  15. 1ec5 commented on Oct 21, 2015

    @1ec5
    Contributor

    I don’t think that was the tip of perspective-continued. Hopefully @ansis has the fixes described in #2139 (comment) around locally still.

  16. added
    MapKit parity
    and removed
    GL JS parity
    on Aug 15, 2016
  17. added
    Core
    on May 30, 2017
  18. added
    archived
    on Nov 6, 2018
  19. stale commented on Nov 30, 2018

    @stale

    This issue has been automatically detected as stale because it has not had recent activity and will be archived. Thank you for your contributions.

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

    CoreMapKit parityarchivedbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions