Skip to content

Commit

Permalink
Merge pull request #136 from scottlepp/master
Browse files Browse the repository at this point in the history
#135 leaflet 1.x  getLatLng() now returns an array of arrays of coord…
  • Loading branch information
arthur-e authored Mar 19, 2019
2 parents 26fbb36 + e366d78 commit ddb0622
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions wicket-leaflet.js
Original file line number Diff line number Diff line change
Expand Up @@ -300,19 +300,19 @@
if (obj.constructor === L.Polygon || obj.constructor === L.polygon) {
rings = [];
verts = [];
tmp = obj.getLatLngs();
boundary = obj.getLatLngs()[0];

// First, we deal with the boundary points
for (i = 0; i < obj._latlngs.length; i += 1) {
for (i = 0; i < boundary.length; i += 1) {
verts.push({ // Add the first coordinate again for closure
x: tmp[i].lng,
y: tmp[i].lat
x: boundary[i].lng,
y: boundary[i].lat
});
}

verts.push({ // Add the first coordinate again for closure
x: tmp[0].lng,
y: tmp[0].lat
x: boundary[0].lng,
y: boundary[0].lat
});

rings.push(verts);
Expand Down Expand Up @@ -430,4 +430,4 @@
};

return Wkt;
}));
}));

0 comments on commit ddb0622

Please sign in to comment.