google maps geometry library provides a function:
computeArea(loop:Array.|MVCArray., radius?:number)
which seems can calculate the area of a circle by providing the radius, but no matter how I tried, it didn’t seem to work. Any help of how I can use the function?
BTW, fowllowing is a sample of calculating the area of a polygon:
var nyc = new google.maps.LatLng(40.715, -74.002);
var london = new google.maps.LatLng(51.506, -0.119);
var rio = new google.maps.LatLng(-22.916, -43.251);
var area = google.maps.geometry.spherical.computeArea([nyc, london, rio]);
That is not the radius to calculate the area of a circle. This function only computes the area of a polygon. The radius parameter is the radius of the earth. The default value is 6378137 meters. If you want the area returned in km, ft, miles, etc you provide the earths radius in the desired unit.