Google MAP 抓取顯示中的範圍

 

透過Map物件,抓取LatLngBounds , 即可再得到東北 , 西南的坐標,接下就可以再做別的事了!

參考:

map.getBounds().getSouthWest();

map.getBounds().getNorthEast();

 

API說明:

Map

https://developers.google.com/maps/documentation/javascript/reference?hl=zh-tw#Map

LatLngBounds

https://developers.google.com/maps/documentation/javascript/reference?hl=zh-tw#LatLngBounds

Related Posts