开发者

How to detect latitude and longitude edges of map container?

开发者 https://www.devze.com 2023-03-24 05:34 出处:网络
Using Google or Bing开发者_开发百科 maps, how would I detect the latitude and longitude lines of the edges of the map? I need to know this so I can query a database and return all locations (the datab

Using Google or Bing开发者_开发百科 maps, how would I detect the latitude and longitude lines of the edges of the map? I need to know this so I can query a database and return all locations (the database contains proper geo-coded locations) that are within the border of the map.


In Bing Maps, you can use the getBounds() method of the map to return a LocationRect rectangle created from the corners of the current map view: http://msdn.microsoft.com/en-us/library/gg427609.aspx

In Google Maps, the equivalent method is also called getBounds(), and returns a LatLngBounds: http://code.google.com/apis/maps/documentation/javascript/reference.html#Map

0

精彩评论

暂无评论...
验证码 换一张
取 消