fix, time was set to '' when loading data without time

merge-requests/1/head
Julien Veyssier 2016-12-16 02:49:51 +01:00
parent 2adf185432
commit 1adfa4c37a
1 changed files with 4 additions and 2 deletions

View File

@ -604,7 +604,7 @@ function generateGpx(){
var alt = layer._latlngs[i].alt;
var time = layer._latlngs[i].time;
gpxText = gpxText + ' <trkpt lat="'+lat+'" lon="'+lng+'">\n';
if (time !== undefined){
if (time){
gpxText = gpxText + ' <time>'+time+'</time>\n';
}
if (alt !== undefined){
@ -687,9 +687,11 @@ function drawLine(latlngs, name, desc, cmt, gpxtype, times){
});
if (times.length === p._latlngs.length){
for (var i=0; i<times.length; i++){
if (times[i]){
p._latlngs[i].time = times[i];
}
}
}
var layer = onCreated(gpxtype, p);
if (name !== ''){
if (tst === 'p'){