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

update Transform geo/screen conversions for tilt #2139

Closed
incanus opened this issue Aug 20, 2015 · 14 comments
Closed

update Transform geo/screen conversions for tilt #2139

incanus opened this issue Aug 20, 2015 · 14 comments
Labels
archived Archived because of inactivity bug Core The cross-platform C++ core, aka mbgl MapKit parity For feature parity with MapKit on iOS or macOS

Comments

@incanus
Copy link
Contributor

incanus commented Aug 20, 2015

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

@incanus incanus added the GL JS parity For feature parity with Mapbox GL JS label Aug 20, 2015
@incanus incanus mentioned this issue Aug 20, 2015
2 tasks
@1ec5
Copy link
Contributor

1ec5 commented Aug 20, 2015

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

@incanus
Copy link
Contributor Author

incanus commented Aug 20, 2015

Right, this is not just cosmetic.

@ansis ansis self-assigned this Aug 20, 2015
@incanus
Copy link
Contributor Author

incanus commented Aug 20, 2015

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

@incanus incanus added the bug label Aug 24, 2015
@ansis
Copy link
Contributor

ansis commented Aug 24, 2015

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

@ansis
Copy link
Contributor

ansis commented Aug 26, 2015

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

@incanus
Copy link
Contributor Author

incanus commented Aug 28, 2015

making fitBounds work better

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

@1ec5
Copy link
Contributor

1ec5 commented Sep 22, 2015

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.

@incanus
Copy link
Contributor Author

incanus commented Sep 22, 2015

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.

@mb12
Copy link

mb12 commented Sep 22, 2015

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

@1ec5
Copy link
Contributor

1ec5 commented Oct 16, 2015

#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.

@1ec5
Copy link
Contributor

1ec5 commented Oct 20, 2015

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.

@friedbunny
Copy link
Contributor

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

@1ec5
Copy link
Contributor

1ec5 commented Oct 21, 2015

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

@1ec5 1ec5 mentioned this issue Oct 26, 2015
@incanus incanus added the P1 label Nov 4, 2015
@jfirebaugh jfirebaugh removed the P1 label Mar 24, 2016
@1ec5 1ec5 added MapKit parity For feature parity with MapKit on iOS or macOS and removed GL JS parity For feature parity with Mapbox GL JS labels Aug 15, 2016
@kkaefer kkaefer added the Core The cross-platform C++ core, aka mbgl label May 30, 2017
@stale stale bot added the archived Archived because of inactivity label Nov 6, 2018
@stale
Copy link

stale bot commented Nov 30, 2018

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

@stale stale bot closed this as completed Nov 30, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived Archived because of inactivity bug Core The cross-platform C++ core, aka mbgl MapKit parity For feature parity with MapKit on iOS or macOS
Projects
None yet
Development

No branches or pull requests

7 participants