Skip to content

Commit

Permalink
Merge pull request #137 from MGotink/fix-gmaps-circle-to-polygon-conv…
Browse files Browse the repository at this point in the history
…ersion

Fix google maps circle to polygon conversion
  • Loading branch information
arthur-e authored Jul 26, 2019
2 parents cfef6b6 + ac5067a commit 8bed2b7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wicket-gmap3.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
var rlat = (radius / earthsradius) * r2d;
var rlng = rlat / Math.cos(point.lat() * d2r);

for (var n = 0; n <= num_seg; n++) {
for (var n = 0; n < num_seg; n++) {
var theta = Math.PI * (n / (num_seg / 2));
lng = point.lng() + (rlng * Math.cos(theta)); // center a + radius x * cos(theta)
lat = point.lat() + (rlat * Math.sin(theta)); // center b + radius y * sin(theta)
Expand All @@ -412,6 +412,7 @@
y: lat
});
}
verts.push(verts[0]);

response = {
type: 'polygon',
Expand Down

0 comments on commit 8bed2b7

Please sign in to comment.