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.

Camera updates get called even when the maps camera's already there. #7295

Closed

Description

@cammace

While looking into whether the same behavior described in #7119 exist on Android also, I noticed we aren't checking whether the camera is already at the position requested. For example, when I call animateCamera to move the camera to a new position, and once the animation ends, call it again using the same position, we are still making a call to nativeFlyTo.

cc: @tobrun

Activity

  1. added
    Android
    on Dec 5, 2016
  2. tobrun commented on Dec 6, 2016

    @tobrun
    Member

    This should be feasible to add, check if the current camera position in Transform.java isn't the same as the newly set one. Note that LatLng values rely on double and you can have some floating point issues.

    eg. moving a camera object to Latitude 37 can result in getting 36.99999999999.

    I see 2 solutions for this:

    • we compare 2 LatLngs with a delta
    • we store previous set camera position from a CameraUpdateFactory method and decouple it from the current cameraPosition found in Transform (this one is being recreated from core).
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

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions