Map stores skippedFeatures instead of layers

This commit is contained in:
Antoine Abt
2014-03-19 14:53:41 +01:00
parent e91db0f9af
commit 0d87516135
5 changed files with 32 additions and 95 deletions

View File

@@ -359,6 +359,13 @@ ol.Map = function(options) {
goog.bind(this.getTilePriority, this),
goog.bind(this.handleTileChange_, this));
/**
* Collection of Features to skip drawing.
* @type {ol.Collection}
* @private
*/
this.skippedFeatures_ = new ol.Collection();
goog.events.listen(
this, ol.Object.getChangeEventType(ol.MapProperty.LAYERGROUP),
this.handleLayerGroupChanged_, false, this);
@@ -797,6 +804,16 @@ ol.Map.prototype.getTilePriority =
};
/**
* Get the collection of features to be skipped.
* @return {ol.Collection} Features collection.
* @todo stability experimental
*/
ol.Map.prototype.getSkippedFeatures = function() {
return this.skippedFeatures_;
};
/**
* @param {goog.events.BrowserEvent} browserEvent Browser event.
* @param {string=} opt_type Type.
@@ -1181,6 +1198,8 @@ ol.Map.prototype.renderFrame_ = function(time) {
pixelToCoordinateMatrix: this.pixelToCoordinateMatrix_,
postRenderFunctions: [],
size: size,
skippedFeaturesIds: goog.array.map(
this.skippedFeatures_.getArray(), goog.getUid),
tileQueue: this.tileQueue_,
time: time,
usedTiles: {},