Skip to content

Commit

Permalink
Merge pull request #208 from Zverik/master
Browse files Browse the repository at this point in the history
Fix virtual nodes position (#207)
  • Loading branch information
jacobtoye committed Oct 30, 2013
2 parents 7e19bc1 + 00f86fb commit 197fefa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/edit/handler/Edit.Poly.js
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@ L.Edit.Poly = L.Handler.extend({

_getMiddleLatLng: function (marker1, marker2) {
var map = this._poly._map,
p1 = map.latLngToLayerPoint(marker1.getLatLng()),
p2 = map.latLngToLayerPoint(marker2.getLatLng());
p1 = map.project(marker1.getLatLng()),
p2 = map.project(marker2.getLatLng());

return map.layerPointToLatLng(p1._add(p2)._divideBy(2));
return map.unproject(p1._add(p2)._divideBy(2));
}
});

Expand Down

0 comments on commit 197fefa

Please sign in to comment.