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.

Refine Camera API #3358

Closed
Closed

Description

@bleege

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().

Activity

  1. added
    Android
    on Dec 19, 2015
  2. self-assigned this
    on Dec 19, 2015
  3. added this to the milestone on Dec 19, 2015
  4. 1ec5 commented on Dec 19, 2015

    @1ec5
    Contributor

    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()?

  5. bleege commented on Dec 20, 2015

    @bleege
    ContributorAuthor

    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.

  6. added a commit that references this issue on Dec 20, 2015
  7. bleege commented on Dec 20, 2015

    @bleege
    ContributorAuthor

    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.

  8. added 2 commits that reference this issue on Dec 20, 2015
  9. bleege commented on Dec 20, 2015

    @bleege
    ContributorAuthor

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

  10. bleege commented on Dec 20, 2015

    @bleege
    ContributorAuthor

    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.

  11. bleege commented on Dec 20, 2015

    @bleege
    ContributorAuthor

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Android

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions