diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 8b594a8868..8db688424c 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -536,6 +536,19 @@ * @property {Object|undefined} params Additional parameters. */ +/** + * @typedef {Object} olx.source.KMLOptions + * @property {Array.|undefined} attributions Attributions. + * @property {Document|undefined} doc Document. + * @property {ol.Extent|undefined} extent Extent. + * @property {string|undefined} logo Logo. + * @property {Node|undefined| node Node. + * @property {ol.proj.ProjectionLike} projection Projection. + * @property {ol.proj.ProjectionLike} reprojectTo Re-project to. + * @property {string|undefined} text Text. + * @property {string|undefined} url URL. + */ + /** * @typedef {Object} olx.source.MapQuestOptions * @property {ol.TileLoadFunctionType|undefined} tileLoadFunction Optional diff --git a/src/ol/source/kmlsource.exports b/src/ol/source/kmlsource.exports new file mode 100644 index 0000000000..45c5580867 --- /dev/null +++ b/src/ol/source/kmlsource.exports @@ -0,0 +1 @@ +@exportSymbol ol.source.KML diff --git a/src/ol/source/kmlsource.js b/src/ol/source/kmlsource.js new file mode 100644 index 0000000000..ef951220ed --- /dev/null +++ b/src/ol/source/kmlsource.js @@ -0,0 +1,31 @@ +goog.provide('ol.source.KML'); + +goog.require('ol.format.KML'); +goog.require('ol.source.VectorFile'); + + + +/** + * @constructor + * @extends {ol.source.VectorFile} + * @param {olx.source.KMLOptions=} opt_options Options. + */ +ol.source.KML = function(opt_options) { + + var options = goog.isDef(opt_options) ? opt_options : {}; + + goog.base(this, { + attributions: options.attributions, + doc: options.doc, + extent: options.extent, + format: new ol.format.KML(), + logo: options.logo, + node: options.node, + projection: options.projection, + reprojectTo: options.reprojectTo, + text: options.text, + url: options.url + }); + +}; +goog.inherits(ol.source.KML, ol.source.VectorFile);