user10040488
user10040488

Reputation:

Google Maps How do I get the current CameraLocation object?

When I close my map or switch a different activity, the map calls the onSaveInstanseState(). I want to get the current camera position and LatLng so that when the user switches back to the map, they will be in the same location.

Thank you.

Upvotes: 1

Views: 251

Answers (1)

Archie G. Quiñones
Archie G. Quiñones

Reputation: 13668

Google Maps have a getCameraPosition() method.

To get the latLang, you simple have to get the camera position then get the target. Such as:

LatLang latlang = googleMaps.getCameraPosition().target

Upvotes: 1

Related Questions