How can I get the center location on v2 maps on Android?

I want to find the center in my Android app,

I am using Android Google Maps v2.

I know that I can get lat and long for the top screen left after using Projection.fromScreenLocation , but how to determine the center location?

+4
source share
2 answers

try using googleMap.getCameraPosition().target

for more information see http://developer.android.com/reference/com/google/android/gms/maps/model/CameraPosition.html#target

+9
source

Mr.Lee, Korean.

You will need to read this official Android manual first.

Secondly, please get an example of the code mentioned above from Here in the Android Guide

Thirdly, you can find what you want to know in the code example as follows:

 private void setUpMap() { mMap.setMyLocationEnabled(true); // if "false", MyLocation Button disappears. } 

Finally, please read this good tutorial and you will get good help.

For more information about the Google Maps API, please contact me who lives in Seoul.

-1
source

All Articles