| Issue 2595: | Return getArea method to v3 polygons | |
| 26 people starred this issue and may be notified of changes. | Back to list |
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]
Labels:
-ApiType-Javascript ApiType-Javascript3
Oct 6, 2010
(No comment was entered for this change.)
Status:
Acknowledged
Labels: Internal-1814010
Oct 12, 2010
return very handy method getArea()...
Oct 13, 2010
I wish there was more demand for this feature. It'd be of great use to me
Nov 2, 2010
I just found: http://www.birdtheme.org/useful/calculatearea.html
Nov 2, 2010
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
Ok, thanks for the comment!
Jan 5, 2011
(No comment was entered for this change.)
Status:
Fixed
Labels: Fixed-3.3.6
Jan 7, 2011
Is the ticket resolved? I try to use it but get an error as always...
Jan 7, 2011
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
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
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 |