diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 5c66ab9706..df4e7c4e28 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -500,6 +500,14 @@ * @property {string|undefined} url URL. */ +/** + * @typedef {Object} olx.source.IGCOptions + * @property {ol.format.IGCZ|undefined} altitudeMode Altitude mode. + * Possible values are `barometric`, `gps`, and `none`. Default is `none`. + * @property {string|undefined} text Text. + * @property {string|undefined} url URL. + */ + /** * @typedef {Object} olx.source.MapGuideOptions * @property {string|undefined} url The mapagent url. diff --git a/src/ol/source/igcsource.exports b/src/ol/source/igcsource.exports new file mode 100644 index 0000000000..6d4292225e --- /dev/null +++ b/src/ol/source/igcsource.exports @@ -0,0 +1 @@ +@exportSymbol ol.source.IGC diff --git a/src/ol/source/igcsource.js b/src/ol/source/igcsource.js new file mode 100644 index 0000000000..2ca98e470e --- /dev/null +++ b/src/ol/source/igcsource.js @@ -0,0 +1,26 @@ +goog.provide('ol.source.IGC'); + +goog.require('ol.format.IGC'); +goog.require('ol.source.VectorFile'); + + + +/** + * @constructor + * @extends {ol.source.VectorFile} + * @param {olx.source.IGCOptions=} opt_options Options. + */ +ol.source.IGC = function(opt_options) { + + var options = goog.isDef(opt_options) ? opt_options : {}; + + goog.base(this, { + format: new ol.format.IGC({ + altitudeMode: options.altitudeMode + }), + text: options.text, + url: options.url + }); + +}; +goog.inherits(ol.source.IGC, ol.source.VectorFile);