refs #16 modify cloneLatLng to avoid alt and time loss when L.draw makes layer backups (cancel edition was provoking losses)

merge-requests/1/head
Julien Veyssier 2017-05-24 17:32:57 +02:00
parent 814c681e60
commit daa3597e70
1 changed files with 9 additions and 2 deletions

View File

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