-2

I need to make it like in PlacePicker API But i want it to mapsActivity when move screen location is change on center of screen plz guide me

C.Junior
  • 97
  • 1
  • 11

1 Answers1

1

As I can see you are trying to know the centre of the screen and drop a pin on it.(My assumption of your query.) There are numerous posts on which you can try to get the centre point in XY coordinates with respect to the screen. Check this link out https://stackoverflow.com/a/40714006/8117352.

After fetching these coordinates in X and Y points in screen you can use a concept of Projection in the google maps, which allows you to convert these points to latitude and longitude.


Point x_y_points = new Point(x_co, y_co);
    LatLng latLng = 
mGoogleMap.getProjection().fromScreenLocation(x_y_points);

More on projection : https://developers.google.com/android/reference/com/google/android/gms/maps/Projection

Bawender Yandra
  • 200
  • 1
  • 9