Add ol.source.VectorSource2

This commit is contained in:
Tom Payne
2013-04-23 18:32:09 +02:00
parent 93ba55d357
commit ac48fae0af
3 changed files with 47 additions and 0 deletions

View File

@@ -461,6 +461,15 @@
* of `url` when the WMS supports multiple urls for GetMap requests.
*/
/**
* @typedef {Object} ol.source.VectorSource2Options
* @property {Array.<ol.Attribution>|undefined} attributions Attributions.
* @property {ol.Extent|undefined} extent Extent.
* @property {Array.<ol.geom2.PointCollection>|undefined} pointCollections
* Point collections.
* @property {ol.ProjectionLike} projection Projection.
*/
/**
* @typedef {Object} ol.source.WMTSOptions
* @property {Array.<ol.Attribution>|undefined} attributions Attributions.

View File

@@ -0,0 +1 @@
@exportSymbol ol.source.VectorSource2

View File

@@ -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.<ol.geom2.PointCollection>}
*/
this.pointCollections_ = goog.isDef(options.pointCollections) ?
options.pointCollections : [];
};
goog.inherits(ol.source.VectorSource2, ol.source.Source);
/**
* @return {Array.<ol.geom2.PointCollection>} Point collections.
*/
ol.source.VectorSource2.prototype.getPointCollections = function() {
return this.pointCollections_;
};