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

Refine Camera API #3358

Closed
bleege opened this issue Dec 19, 2015 · 6 comments
Closed

Refine Camera API #3358

bleege opened this issue Dec 19, 2015 · 6 comments
Assignees
Labels
Android Mapbox Maps SDK for Android

Comments

@bleege
Copy link
Contributor

bleege commented Dec 19, 2015

The fundamentals of the Camera API were built in #3244 , now the developer API can be refined to be more consistent with the Google Maps API. This means the following:

Make Core GL Methods Private

The Core GL animation methods are jumpTo(), easeTo(), and flyTo(). They are currently public methods which means developers can access them directly. They need to be made private and only accessible via the Google Maps like API wrapper methods ( animateCamera(), moveCamera(), and easeCamera() ).

Add moveCamera() Method

The Google Maps API has a moveCamera() method which should be the wrapper method for Core GL's jumpTo().

Create easeCamera() Method

The Google Maps API does not have a method for "easing the camera", only for animation (aka animateCamera()). Create a new easeCamera() method to wrap Core GL's easeTo() method. This will expose Mapbox's additional functionality, while sticking with the familiar naming convention.

Update TestApp's CameraActivity Buttons

The three buttons in the CameraActivity currently call the three different iterations of the animateCamera() method. Update them to directly invoke: moveCamera(), easeCamera(), and animateCamera().

@bleege bleege added the Android Mapbox Maps SDK for Android label Dec 19, 2015
@bleege bleege self-assigned this Dec 19, 2015
@bleege bleege added this to the android-v2.4.0 milestone Dec 19, 2015
@1ec5
Copy link
Contributor

1ec5 commented Dec 19, 2015

The Google Maps API does not have a method for "easing the camera", only for animation (aka animateCamera()).

So if you call Google’s animateCamera() with a CameraUpdate that changes the LatLng, you get a zoom-out-pan-zoom-in motion like with flyTo()?

@bleege
Copy link
Contributor Author

bleege commented Dec 20, 2015

So if you call Google’s animateCamera() with a CameraUpdate that changes the LatLng, you get a zoom-out-pan-zoom-in motion like with flyTo()?

Yep. I built an example app using the Google Maps API which on load centers on a Marker in Sydney, Australia. I added an "Animate" button which calls the exact 1 argument animateCamera() method. The result is that it does a flyTo() animation from Sydney to new location in Green Bay, Wisconsin.

bleege added a commit that referenced this issue Dec 20, 2015
…amera() API method. Updating CameraActivity to use only animateCamera() and moveCamera() API.
@bleege
Copy link
Contributor Author

bleege commented Dec 20, 2015

My first iteration made the Core GL camera methods private, added moveCamera(), and updated the TestApp's CameraActivity to only use moveCamera() and animateCamera(). As part of this I also changed the animateCamera() zero second duration choice to use easeTo() instead of jumpTo(). However when testing it, it still behaved as an immediate move so it looks like a standalone easeCamera() method is going to be needed as originally thought.

@bleege
Copy link
Contributor Author

bleege commented Dec 20, 2015

I created the following screen recording videos to help illustrate the differences between what the Camera API methods do:

@bleege
Copy link
Contributor Author

bleege commented Dec 20, 2015

I just rebased and merged these into release-android-v2.4.0. I'll produce a new 2.4.0-SNAPSHOT now so that others can test the API out.

@bleege
Copy link
Contributor Author

bleege commented Dec 20, 2015

Just started the SNAPSHOT build process on Bitrise. Should be on Maven Central's SNAPSHOT server in 30 minutes.

/cc @zugaldia @1ec5 @tobrun

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

3 participants