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); } }); }