이수홍
이수홍

Reputation: 43

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

I want to search for center the location in my Android application,

I am using Android Google Maps v2.

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

Upvotes: 4

Views: 5250

Answers (2)

BBonDoo
BBonDoo

Reputation: 766

Mr.Lee, Korean.

First, you will have to read this Android official guide

Second, please get the sample code refered to that document above from Here in the Android Guide

Third, You can find what you want to know in the sample code as follows;

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

}

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

For more information about Google Maps API ve, please contact me who live in Seoul.

Upvotes: -2

Berťák
Berťák

Reputation: 7322

try to use googleMap.getCameraPosition().target

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

Upvotes: 9

Related Questions