Skip to content

Bug: GeofenceCircle getCenter() method does not return correct position if circle has been moved #5

@ssak995

Description

@ssak995

I implemented the onMoveCircleEnd() method of the CircleManagerListener interface to get the new coordinates of the circle after it has been dragged on the map. However, it was returning the original coordinates of the marker/circle.

After looking through the code, I found out that its because the internal variable center of GeofenceCircle class is not being updated properly. So, I suggest two solutions:

  1. In public void onCenterUpdated(LatLng center) , update the internal 'center' variable as well

  2. In public LatLng getCenter() { return center; } change to
    public LatLng getCenter() { return centerMarker.getPosition(); }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions