Javascript – how to get coordinates of the center of the viewed area in google maps using Google Maps JavaScript API v3

google-maps-api-3javascript

How to get coordinates using javascript Google Maps JavaScript API v3 of the center of the currently viewed area on google maps? Thanks

Best Answer

You can call:

map.getCenter();

to return a LatLng object.