谷歌地图api定位角坐标

Web*_*eng 1 javascript google-maps coordinates google-maps-api-3

问题:有没有一种方法可以让我在每次zooms in, zooms out, 或shift地图时找到 google 地图角点的坐标?

详细说明我的意思:

在我的 google maps api 代码中,我为地图提供了特定的宽度和高度:

<style>
    #map {
        width:400px;
        height:300px;
    }
</style>
<script src="https://maps.googleapis.com/maps/api/js"></script>
<div id="map"></div>
<script>
    var mapOptions = {
        center: new google.maps.LatLng(37.7831, -122.4039),
        zoom: 12,
        mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    var map = new google.maps.Map(document.getElementById('map'), mapOptions);
</script>
Run Code Online (Sandbox Code Playgroud)

现在,当用户使用滚动查看地图中更远或更远的地方时,此宽度和高度显然保持不变,但是地图上的坐标位于

top-left corner
top-right corner
bottom-left corner
bottom-right corner
Run Code Online (Sandbox Code Playgroud)

随着用户移动地图而改变。我一直试图找到一种方法来获得这些坐标,但我的尝试失败了。

geo*_*zip 6

map.getBounds() 将返回一个包含地图的北、南、东和西边界(如 SouthWest、NorthEast)的 bounds 对象。