Merge pull request #1439 from fredj/vector-api-igc-cleanup

Vector api igc cleanup
This commit is contained in:
Tom Payne
2013-12-30 12:32:05 -08:00

View File

@@ -127,14 +127,16 @@ ol.format.IGC.prototype.readFeatureFromText = function(text) {
flatCoordinates.push(date.getTime() / 1000);
}
} else if (line.charAt(0) == 'H') {
m = ol.format.IGC.H_RECORD_RE_.exec(line);
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
if (m) {
properties[m[1]] = goog.string.trim(m[2]);
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
day = parseInt(m[1], 10);
month = parseInt(m[2], 10);
year = 2000 + parseInt(m[3], 10);
} else {
m = ol.format.IGC.H_RECORD_RE_.exec(line);
if (m) {
year = 2000 + parseInt(m[1], 10);
month = parseInt(m[2], 10);
day = parseInt(m[3], 10);
properties[m[1]] = goog.string.trim(m[2]);
m = ol.format.IGC.HFDTE_RECORD_RE_.exec(line);
}
}
}