Layer extent option

If provided, the layer extent will be used to limit data requests and rendering.  If undefined, to limit will be imposed.
This commit is contained in:
Tim Schaub
2014-07-06 17:56:54 -06:00
parent 42f953d08d
commit 1daf36956c
5 changed files with 156 additions and 0 deletions
+5
View File
@@ -11,6 +11,7 @@ goog.require('ol.CollectionEvent');
goog.require('ol.CollectionEventType');
goog.require('ol.Object');
goog.require('ol.ObjectEventType');
goog.require('ol.extent');
goog.require('ol.layer.Base');
goog.require('ol.source.State');
@@ -211,6 +212,10 @@ ol.layer.Group.prototype.getLayerStatesArray = function(opt_states) {
layerState.maxResolution, ownLayerState.maxResolution);
layerState.minResolution = Math.max(
layerState.minResolution, ownLayerState.minResolution);
if (goog.isDef(ownLayerState.extent) && goog.isDef(layerState.extent)) {
layerState.extent = ol.extent.getIntersection(
layerState.extent, ownLayerState.extent);
}
}
return states;