Search code examples
javascriptgoogle-maps-api-3

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


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


Solution

  • You can call:

    map.getCenter();
    

    to return a LatLng object.