Skip to content

Commit 92465eb

Browse files
author
Montago
committed
correction of the lat/lon -> x/y mixup ..
1 parent 46a6d36 commit 92465eb

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

wicket-gmap3.js

+11-13
Original file line numberDiff line numberDiff line change
@@ -146,19 +146,17 @@
146146
polygon: function (config, component) {
147147
var j, k, c, rings, verts;
148148

149-
var polygonIsClockwise = function (coords) {
150-
var area = 0,
151-
j = null,
152-
i = 0;
153-
154-
for (i = 0; i < coords.length; i++) {
155-
j = (i + 1) % coords.length;
156-
area += coords[i].x * coords[j].x;
157-
area -= coords[j].y * coords[i].y;
158-
}
159-
160-
return area > 0;
161-
};
149+
var polygonIsClockwise = function (coords) {
150+
var area = 0.0, j;
151+
152+
for (var i = 0; i < coords.length; i++) {
153+
j = (i + 1) % coords.length;
154+
area += coords[i].y * coords[j].x;
155+
area -= coords[j].y * coords[i].x;
156+
}
157+
158+
return area > 0;
159+
};
162160

163161
c = component || this.components;
164162

0 commit comments

Comments
 (0)