Reputation: 147
I want to find position of location(with latitude and longitude).
I try to get the (latitude, longitude) of left-top and right-bottom points of map and lerp to calculate the position.
However, I don't know coordinate of left-top and right-bottom points. How can I get or calculate them?
Upvotes: 0
Views: 818
Reputation: 13321
You are looking for the VisibleRegion class.
From a MapFragment
you can use:
VisibleRegion visibleRegion = getMap().getProjection().getVisibleRegion();
Upvotes: 0
Reputation: 5986
Center:
map.getCameraPosition().target;
Bounds:
LatLngBounds curScreen = map.getProjection().getVisibleRegion().latLngBounds;
Where you then access left-top and right-bottom points using:
curScreen.northeast
and
curScreen.southwest
Upvotes: 2