diff --git a/src/objectliterals.jsdoc b/src/objectliterals.jsdoc index 02269b07e0..e938eec2a9 100644 --- a/src/objectliterals.jsdoc +++ b/src/objectliterals.jsdoc @@ -461,6 +461,15 @@ * of `url` when the WMS supports multiple urls for GetMap requests. */ +/** + * @typedef {Object} ol.source.VectorSource2Options + * @property {Array.|undefined} attributions Attributions. + * @property {ol.Extent|undefined} extent Extent. + * @property {Array.|undefined} pointCollections + * Point collections. + * @property {ol.ProjectionLike} projection Projection. + */ + /** * @typedef {Object} ol.source.WMTSOptions * @property {Array.|undefined} attributions Attributions. diff --git a/src/ol/source/vectorsource2.exports b/src/ol/source/vectorsource2.exports new file mode 100644 index 0000000000..1d3cf6c8ed --- /dev/null +++ b/src/ol/source/vectorsource2.exports @@ -0,0 +1 @@ +@exportSymbol ol.source.VectorSource2 diff --git a/src/ol/source/vectorsource2.js b/src/ol/source/vectorsource2.js new file mode 100644 index 0000000000..612c11582b --- /dev/null +++ b/src/ol/source/vectorsource2.js @@ -0,0 +1,37 @@ +goog.provide('ol.source.VectorSource2'); + +goog.require('ol.geom2.PointCollection'); +goog.require('ol.source.Source'); + + + +/** + * @constructor + * @extends {ol.source.Source} + * @param {ol.source.VectorSource2Options} options Options. + */ +ol.source.VectorSource2 = function(options) { + + goog.base(this, { + attributions: options.attributions, + extent: options.extent, + projection: options.projection + }); + + /** + * @private + * @type {Array.} + */ + this.pointCollections_ = goog.isDef(options.pointCollections) ? + options.pointCollections : []; + +}; +goog.inherits(ol.source.VectorSource2, ol.source.Source); + + +/** + * @return {Array.} Point collections. + */ +ol.source.VectorSource2.prototype.getPointCollections = function() { + return this.pointCollections_; +};