how to get coordinates of the center of the viewed area in google maps using Google Maps JavaScript API v3
JavascriptGoogle Maps-Api-3Javascript Problem Overview
How to get coordinates using javascript Google Maps JavaScript API v3 of the center of the currently viewed area on google maps? Thanks
Javascript Solutions
Solution 1 - Javascript
You can call:
map.getCenter();
to return a LatLng object.
Solution 2 - Javascript
Updated 2018 The below codes are for Google Maps API for Android. In case anyone needs this Script:
double mylat = mGoogleMap.getCameraPosition().target.latitude;
double mylon = mGoogleMap.getCameraPosition().target.longitude;