Remove extent option for sources

Most of our uses of source extent were cargo cult programming.  The source extent was seldom and inconsistently used.  Instead, layers can now be configured with an extent, and layer renderers limit rendering (and data requests) to the layer extent.

For vector sources, the `getExtent` method returns the extent of currently loaded features (this was the case before and after this change).  For tile based sources, we will likely want to allow easy construction of tile grids based on an extent (this is not possible before or after this change, but could be added later).
This commit is contained in:
Tim Schaub
2014-07-07 23:05:12 -06:00
parent 7bbd27e68e
commit caa0b568ad
20 changed files with 5 additions and 235 deletions

View File

@@ -22,7 +22,6 @@ ol.source.State = {
/**
* @typedef {{attributions: (Array.<ol.Attribution>|undefined),
* extent: (ol.Extent|undefined),
* logo: (string|olx.LogoOptions|undefined),
* projection: ol.proj.ProjectionLike,
* state: (ol.source.State|string|undefined)}}
@@ -52,14 +51,6 @@ ol.source.Source = function(options) {
*/
this.projection_ = ol.proj.get(options.projection);
/**
* @private
* @type {ol.Extent}
*/
this.extent_ = goog.isDef(options.extent) ?
options.extent : goog.isDef(options.projection) ?
this.projection_.getExtent() : null;
/**
* @private
* @type {Array.<ol.Attribution>}
@@ -106,14 +97,6 @@ ol.source.Source.prototype.getAttributions = function() {
};
/**
* @return {ol.Extent} Extent.
*/
ol.source.Source.prototype.getExtent = function() {
return this.extent_;
};
/**
* @return {string|olx.LogoOptions|undefined} Logo.
*/
@@ -153,14 +136,6 @@ ol.source.Source.prototype.setAttributions = function(attributions) {
};
/**
* @param {ol.Extent} extent Extent.
*/
ol.source.Source.prototype.setExtent = function(extent) {
this.extent_ = extent;
};
/**
* @param {string|olx.LogoOptions|undefined} logo Logo.
*/