replace NaN by 0
This commit is contained in:
parent
1e72349026
commit
70e2ec5672
|
@ -66,6 +66,10 @@ function addPointsToTrack(track,body)
|
|||
{
|
||||
f = parseFloat(token.substring(0,10));
|
||||
}
|
||||
if(isNaN(f))
|
||||
{
|
||||
f=0.0;
|
||||
}
|
||||
track.trackData.points[track.trackData.points.length - 1].latitude = f;
|
||||
num++;
|
||||
}
|
||||
|
@ -75,6 +79,10 @@ function addPointsToTrack(track,body)
|
|||
{
|
||||
f = parseFloat(token.substring(0,10));
|
||||
}
|
||||
if(isNaN(f))
|
||||
{
|
||||
f=0.0;
|
||||
}
|
||||
track.trackData.points[track.trackData.points.length - 1].longitude = f;
|
||||
num++;
|
||||
}
|
||||
|
@ -84,6 +92,10 @@ function addPointsToTrack(track,body)
|
|||
{
|
||||
f = parseFloat(token.substring(0,10));
|
||||
}
|
||||
if(isNaN(f))
|
||||
{
|
||||
f=0.0;
|
||||
}
|
||||
track.trackData.points[track.trackData.points.length - 1].course = f;
|
||||
num++;
|
||||
}
|
||||
|
@ -93,6 +105,10 @@ function addPointsToTrack(track,body)
|
|||
{
|
||||
f = parseFloat(token.substring(0,10));
|
||||
}
|
||||
if(isNaN(f))
|
||||
{
|
||||
f=0.0;
|
||||
}
|
||||
track.trackData.points[track.trackData.points.length - 1].speed = f;
|
||||
num++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue