From daa3597e704a39fa0387ef439149b9a83de2b5ba Mon Sep 17 00:00:00 2001 From: Julien Veyssier Date: Wed, 24 May 2017 17:32:57 +0200 Subject: [PATCH] refs #16 modify cloneLatLng to avoid alt and time loss when L.draw makes layer backups (cancel edition was provoking losses) --- js/leaflet.draw-src.js | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/js/leaflet.draw-src.js b/js/leaflet.draw-src.js index 2b49356..57afffd 100644 --- a/js/leaflet.draw-src.js +++ b/js/leaflet.draw-src.js @@ -2829,7 +2829,14 @@ L.LatLngUtil = { // @method cloneLatLng(LatLng): L.LatLng // Clone the latLng and return a new LatLng object. cloneLatLng: function (latlng) { - return L.latLng(latlng.lat, latlng.lng); + var ll = L.latLng(latlng.lat, latlng.lng); + if (latlng.alt) { + ll.alt = latlng.alt; + } + if (latlng.time) { + ll.time = latlng.time; + } + return ll; } }; @@ -4384,4 +4391,4 @@ L.EditToolbar.Delete = L.Handler.extend({ }(window, document)); -//# sourceMappingURL=leaflet.draw-src.map \ No newline at end of file +//# sourceMappingURL=leaflet.draw-src.map