Skip to content

Instantly share code, notes, and snippets.

@stiucsib86
stiucsib86 / gist:6150321
Created August 4, 2013 13:31
[Google Maps v3] Get Rectangle area with computeArea
var _computeRectangleArea = function(bounds) {
if (!bounds) {
return 0;
}
var sw = bounds.getSouthWest();
var ne = bounds.getNorthEast();
var southWest = new google.maps.LatLng(sw.lat(), sw.lng());
var northEast = new google.maps.LatLng(ne.lat(), ne.lng());
var southEast = new google.maps.LatLng(sw.lat(), ne.lng());
var northWest = new google.maps.LatLng(ne.lat(), sw.lng());