Skip to content

Commit aa303f4

Browse files
committed
Merge pull request #11 from filmaj/master
lat/lon mixup in pointDistance
2 parents ecc1e81 + ec9b906 commit aa303f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

geojson-utils.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,10 @@
154154

155155
// from http://www.movable-type.co.uk/scripts/latlong.html
156156
gju.pointDistance = function (pt1, pt2) {
157-
var lon1 = pt1.coordinates[0],
158-
lat1 = pt1.coordinates[1],
159-
lon2 = pt2.coordinates[0],
160-
lat2 = pt2.coordinates[1],
157+
var lon1 = pt1.coordinates[1],
158+
lat1 = pt1.coordinates[0],
159+
lon2 = pt2.coordinates[1],
160+
lat2 = pt2.coordinates[0],
161161
dLat = gju.numberToRadius(lat2 - lat1),
162162
dLon = gju.numberToRadius(lon2 - lon1),
163163
a = Math.pow(Math.sin(dLat / 2), 2) + Math.cos(gju.numberToRadius(lat1))

0 commit comments

Comments
 (0)