From 4ad2c71a3d833f88db99f2c5780bb115372ca747 Mon Sep 17 00:00:00 2001 From: "Sergey N. Belinsky" Date: Sat, 25 Jul 2015 13:51:04 +0500 Subject: [PATCH] Fixed for Leaflet 1.0.0-beta.2. --- leaflet.measure/leaflet.measure.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/leaflet.measure/leaflet.measure.js b/leaflet.measure/leaflet.measure.js index 6f26303..59ff63b 100644 --- a/leaflet.measure/leaflet.measure.js +++ b/leaflet.measure/leaflet.measure.js @@ -94,7 +94,11 @@ L.Control.Measure = L.Control.extend({ dashArray: '6,3' }).addTo(this._layerPaint); } else { - this._layerPaintPathTemp.spliceLatLngs(0, 2, this._lastPoint, e.latlng); + if (this._layerPaintPathTemp.spliceLatLngs) { + this._layerPaintPathTemp.spliceLatLngs(0, 2, this._lastPoint, e.latlng); + } else { + this._layerPaintPathTemp.setLatLngs([this._lastPoint, e.latlng]); + } } if(this._tooltip) {