Geometry library: computeHeading does not work as documented

129 views
Skip to first unread message

Joseph Elfelt

unread,
Jul 7, 2012, 10:16:19 AM7/7/12
to google-map...@googlegroups.com
If you use the computeHeading feature of the geometry library, then you should be aware that it does not work as described in the documentation.  The documentation for computeHeading states:  "Returns the heading (expressed in degrees clockwise from north) from one LatLng to another LatLng."

However, instead of returning bearings in the range 180 to 360, computeHeading uses counterclockwise rotation and returns bearings in the range *minus* 180 to zero.

Personally, I do not care how it works as long as the workings and documentation are consistent.  After all, I can code for it either way.

Small test map:
http://www.mappingsupport.com/p/demo_maps/bearing_test_08.html

If this issue concerns you then please star the bug report I filed:
http://code.google.com/p/gmaps-api-issues/issues/detail?id=4251&q=apitype%3AJavascript3&sort=-id&colspec=ID%20Type%20Status%20Introduced%20Fixed%20Summary%20Internal%20Stars
Reply all
Reply to author
Forward
0 new messages