From 5acd6d11f40da6c583b322c0817f5c8647183f41 Mon Sep 17 00:00:00 2001 From: qnstie Date: Wed, 17 Jul 2013 16:16:23 +0200 Subject: [PATCH] Extended redraw() method to fix behavior during editing --- external/L.Geodesic.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/external/L.Geodesic.js b/external/L.Geodesic.js index 8f2a5fe3..59bf81a9 100644 --- a/external/L.Geodesic.js +++ b/external/L.Geodesic.js @@ -2,6 +2,7 @@ Geodesic extension to Leaflet library, by Fragger https://github.com/Fragger/Leaflet.Geodesic Version from master branch, dated Apr 26, 2013 +Modified by qnstie 2013-07-17 to maintain compatibility with Leaflet.draw */ (function () { function geodesicPoly(Klass, fill) { @@ -15,20 +16,21 @@ Version from master branch, dated Apr 26, 2013 }, setLatLngs: function (latlngs) { this._latlngsinit = this._convertLatLngs(latlngs); - this._latlngs = this._convertLatLngs(L.geodesicConvertLines(this._latlngsinit, fill)); return this.redraw(); }, addLatLng: function (latlng) { this._latlngsinit.push(L.latLng(latlng)); - this._latlngs = this._convertLatLngs(L.geodesicConvertLines(this._latlngsinit, fill)); return this.redraw(); }, spliceLatLngs: function () { // (Number index, Number howMany) var removed = [].splice.apply(this._latlngsinit, arguments); this._convertLatLngs(this._latlngsinit); - this._latlngs = this._convertLatLngs(L.geodesicConvertLines(this._latlngsinit, fill)); this.redraw(); return removed; + }, + redraw: function() { + this._latlngs = this._convertLatLngs(L.geodesicConvertLines(this._latlngsinit, fill)); + return Klass.prototype.redraw.call(this); } }); }