My favorites | Sign in
Project Home Issues
New issue   Search
for
  Advanced search   Search tips   Subscriptions
Issue 2595: Return getArea method to v3 polygons
26 people starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  [email protected]
Closed:  Jan 2011


Sign in to add a comment
 
Reported by [email protected], Jul 24, 2010
V2 had a very handy method getArea(), which is missing now. Could you please get it back?

Or to post code from v2 as a workaround.



*********************************************************
For developers viewing this issue: please click the 'star' icon to be
notified of future changes, and to let us know how many of you are
interested in seeing it resolved.
*********************************************************

Sep 19, 2010
#1 [email protected]
(No comment was entered for this change.)
Labels: -ApiType-Javascript ApiType-Javascript3
Oct 6, 2010
Project Member #2 [email protected]
(No comment was entered for this change.)
Status: Acknowledged
Labels: Internal-1814010
Oct 12, 2010
#3 [email protected]
return very handy method getArea()...
Oct 13, 2010
#4 [email protected]
I wish there was more demand for this feature. It'd be of great use to me
Nov 2, 2010
#6 [email protected]
I did some comparing and it looks like that script is good, but in google maps api they use 6378137 metres as Earth radius. If you change it in that script you will get almost the same results.
Nov 3, 2010
#7 [email protected]
Ok, thanks for the comment!
Jan 5, 2011
#8 [email protected]
(No comment was entered for this change.)
Status: Fixed
Labels: Fixed-3.3.6
Jan 7, 2011
#9 [email protected]
Is the ticket resolved? 
I try to use it but get an error as always...
Screen shot 2011-01-07 at 11.05.44 AM.png
14.7 KB   View   Download
Jan 7, 2011
#10 [email protected]
It doesn't work for me either and it has not been added to the API V3 Reference yet.
Thanks for the great enhancements :)



Jan 7, 2011
#11 [email protected]
The GPolygon.getArea() function has been replaced by the google.maps.geometry.spherical.computeArea() function in the spherical geometry library. Be sure to load this library when loading the API:

https://code.google.com/apis/maps/documentation/javascript/basics.html#Libraries

Then call:

var area = google.maps.geometry.spherical.computeArea(polygon.getPath()); 
Aug 22, 2011
#12 [email protected]
The GPolygon.getArea() function has been replaced by the google.maps.geometry.spherical.computeArea() function in the spherical geometry library. Be sure to load this library when loading the API:

https://code.google.com/apis/maps/documentation/javascript/basics.html#Libraries

Then call:

var area = google.maps.geometry.spherical.computeArea(polygon.getPath()); 


i have tried this solution and its working, just change the api reference to 
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?libraries=geometry&sensor=false"></script>
And you have done
Sign in to add a comment

Powered by Google Project Hosting