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

Tilt On Android #2805

Closed
bleege opened this issue Oct 26, 2015 · 9 comments
Closed

Tilt On Android #2805

bleege opened this issue Oct 26, 2015 · 9 comments
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@bleege
Copy link
Contributor

bleege commented Oct 26, 2015

The Core GL work to support perspective was done by @ansis at the end of August. @1ec5 added iOS bindings for it #2159 and #2193. Now that the initial version of the Android SDK (v 2.1.0) has been released (as of 21-Oct-2015) we should add support in Android.

/cc @mapbox/mobile @twbell

@bleege bleege added the Android Mapbox Maps SDK for Android label Oct 26, 2015
@bleege bleege added this to the android-v2.2.0 milestone Oct 26, 2015
@ljbade
Copy link
Contributor

ljbade commented Oct 26, 2015

@1ec5 From my reading of relevant tickets, there are still a few bugs and functions that don't take into account tilt?

Just want to make sure we have a list of the ones that have not been fixed to include as known issues with tilt in the release notes.

@1ec5
Copy link
Contributor

1ec5 commented Oct 26, 2015

Now that #2770 is merged, the biggest known issues are #2266, #2259, and possibly #2139. #256 is unimplemented.

@bleege
Copy link
Contributor Author

bleege commented Nov 30, 2015

Looking at the how iOS implemented tilt in https://github.com/mapbox/mapbox-gl-native/pull/2159/files and https://github.com/mapbox/mapbox-gl-native/pull/2193/files it appears that the Core GL has the necessary API for Android implementation. We should be able to wire this up with JNI and have what we need for the Android bindings API.

The outstanding question is going to be how much will the Android bindings API look like the Google Maps for Android Camera API? Google Maps Android API uses. I think we can get by (for now) with simply implementing CameraPosition, CameraPosition.Builder, and MapView.animateCamera(CameraPosition cp) as their example (see below) does. The "extra" API that we don't need for now (as it'll change the Mapbox API) is MapView.animateCamera(CameraUpdate cu) as it deals with zoom, center location, etc.

// Construct a CameraPosition focusing on Mountain View and animate the camera to that position.
CameraPosition cameraPosition = new CameraPosition.Builder()
    .target(MOUNTAIN_VIEW)      // Sets the center of the map to Mountain View
    .zoom(17)                   // Sets the zoom
    .bearing(90)                // Sets the orientation of the camera to east
    .tilt(30)                   // Sets the tilt of the camera to 30 degrees
    .build();                   // Creates a CameraPosition from the builder
map.animateCamera(CameraUpdateFactory.newCameraPosition(cameraPosition));

/cc @zugaldia @tobrun @1ec5

@1ec5
Copy link
Contributor

1ec5 commented Nov 30, 2015

On iOS, we modeled MGLMapCamera after MKMapCamera, since the goal is to more or less match MapKit. The APIs there are intent-driven. You don’t need a lesson on zoom levels and viewing angles to come up with the right values; instead, you decide how high the viewpoint is and what it’s looking at. But if the Google Maps SDK provides literal access to zoom levels and tilt, I think it’d be perfectly reasonable (and more expedient) for the Mapbox Android SDK to do likewise.

@bleege
Copy link
Contributor Author

bleege commented Dec 1, 2015

I've started building out the CameraPosition API bindings. There's still a bit more work to be done on them, but once finished I'll then look to create the JNI bindings and then tie the two layers together.

@zugaldia
Copy link
Member

zugaldia commented Dec 1, 2015

I just added a sample TiltActivity to the TestApp to help test this functionality once is ready. For now it's just a basic map ready to enable a tilt based on the API decisions described above.

bleege added a commit that referenced this issue Dec 2, 2015
…nimateCamera. Setting default location of TiltActivity to DC for more obvious change.
bleege added a commit that referenced this issue Dec 3, 2015
bleege added a commit that referenced this issue Dec 3, 2015
…dding FloatRange annotations to setTilt() and tilt() methods.
@bleege
Copy link
Contributor Author

bleege commented Dec 3, 2015

From chat earlier today @zugaldia and I decided to punt on full Camera API support for the time being. Instead the focus of this ticket / feature will be the Gesture support and the stock getTilt() and setTilt(Double pitch, Long duration) methods on MapView.

bleege added a commit that referenced this issue Dec 3, 2015
bleege added a commit that referenced this issue Dec 3, 2015
…nimateCamera. Setting default location of TiltActivity to DC for more obvious change.
bleege added a commit that referenced this issue Dec 3, 2015
bleege added a commit that referenced this issue Dec 3, 2015
…dding FloatRange annotations to setTilt() and tilt() methods.
@bleege
Copy link
Contributor Author

bleege commented Dec 3, 2015

Rebase, Merge, Done.

@bleege bleege closed this as completed Dec 3, 2015
@zugaldia
Copy link
Member

zugaldia commented Dec 3, 2015

Bravo.

@bleege bleege mentioned this issue Dec 4, 2015
8 tasks
@bleege bleege changed the title Android Camera API (aka Tilt) Tilt On Android Dec 10, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android
Projects
None yet
Development

No branches or pull requests

5 participants