lat/lons being indexed in reverse order.

This commit is contained in:
Fil Maj 2013-06-23 00:57:45 -07:00
parent ecc1e81576
commit ec9b9060d6

View File

@ -154,10 +154,10 @@
// from http://www.movable-type.co.uk/scripts/latlong.html
gju.pointDistance = function (pt1, pt2) {
var lon1 = pt1.coordinates[0],
lat1 = pt1.coordinates[1],
lon2 = pt2.coordinates[0],
lat2 = pt2.coordinates[1],
var lon1 = pt1.coordinates[1],
lat1 = pt1.coordinates[0],
lon2 = pt2.coordinates[1],
lat2 = pt2.coordinates[0],
dLat = gju.numberToRadius(lat2 - lat1),
dLon = gju.numberToRadius(lon2 - lon1),
a = Math.pow(Math.sin(dLat / 2), 2) + Math.cos(gju.numberToRadius(lat1))