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
精彩评论