tcx-builder
Version:
47 lines (46 loc) • 2.03 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var _common_1 = require("../_common");
var lodash_1 = require("lodash");
var CoursePoint = /** @class */ (function (_super) {
__extends(CoursePoint, _super);
function CoursePoint(options) {
var _this = _super.call(this) || this;
_this.Name = options.name;
_this.Time = options.time;
_this.Position = options.position;
_this.AltitudeMeters = options.altitudeMeters;
_this.PointType = options.pointType;
_this.Notes = options.notes;
return _this;
}
CoursePoint.prototype.toXml = function () {
var xmlElement = '';
xmlElement += _common_1.BaseObject.buildXmlNode('Name', this.Name);
xmlElement += _common_1.BaseObject.buildXmlNode('Time', this.Time.toISOString());
xmlElement += _common_1.BaseObject.buildXmlNode('Position', this.Position.toXml());
if (!lodash_1.isNil(this.AltitudeMeters)) {
xmlElement += _common_1.BaseObject.buildXmlNode('AltitudeMeters', this.AltitudeMeters.toString());
}
xmlElement += _common_1.BaseObject.buildXmlNode('PointType', this.PointType);
if (!lodash_1.isNil(this.Notes)) {
xmlElement += _common_1.BaseObject.buildXmlNode('Notes', this.Notes);
}
return xmlElement;
};
return CoursePoint;
}(_common_1.BaseObject));
exports.CoursePoint = CoursePoint;