Remove skippeFeatures collection

This commit is contained in:
Éric Lemoine
2014-04-24 20:58:50 +02:00
parent cd878e0ef8
commit f9c0f12f23
2 changed files with 24 additions and 54 deletions

View File

@@ -362,18 +362,6 @@ ol.Map = function(options) {
goog.bind(this.getTilePriority, this),
goog.bind(this.handleTileChange_, this));
/**
* Features to skip at rendering time.
* @type {ol.Collection}
* @private
*/
this.skippedFeatures_ = new ol.Collection();
goog.events.listen(this.skippedFeatures_, ol.CollectionEventType.ADD,
this.handleSkippedFeaturesAdd_, false, this);
goog.events.listen(this.skippedFeatures_, ol.CollectionEventType.REMOVE,
this.handleSkippedFeaturesRemove_, false, this);
this.registerDisposable(this.skippedFeatures_);
/**
* Uids of features to skip at rendering time.
* @type {Object.<string, boolean>}
@@ -821,16 +809,6 @@ ol.Map.prototype.getTilePriority =
};
/**
* Get the collection of features to skip.
* @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.
@@ -930,30 +908,6 @@ ol.Map.prototype.handleSizeChanged_ = function() {
};
/**
* @private
* @param {ol.CollectionEvent} event Collection "add" event.
*/
ol.Map.prototype.handleSkippedFeaturesAdd_ = function(event) {
var feature = /** @type {ol.Feature} */ (event.element);
var featureUid = goog.getUid(feature).toString();
this.skippedFeatureUids_[featureUid] = true;
this.render();
};
/**
* @private
* @param {ol.CollectionEvent} event Collection "remove" event.
*/
ol.Map.prototype.handleSkippedFeaturesRemove_ = function(event) {
var feature = /** @type {ol.Feature} */ (event.element);
var featureUid = goog.getUid(feature).toString();
delete this.skippedFeatureUids_[featureUid];
this.render();
};
/**
* @private
*/
@@ -1348,6 +1302,16 @@ goog.exportProperty(
ol.Map.prototype.setView);
/**
* @param {ol.Feature} feature Feature.
*/
ol.Map.prototype.skipFeature = function(feature) {
var featureUid = goog.getUid(feature).toString();
this.skippedFeatureUids_[featureUid] = true;
this.render();
};
/**
* Force a recalculation of the map viewport size. This should be called when
* third-party code changes the size of the map viewport.
@@ -1371,6 +1335,16 @@ ol.Map.prototype.updateSize = function() {
};
/**
* @param {ol.Feature} feature Feature.
*/
ol.Map.prototype.unskipFeature = function(feature) {
var featureUid = goog.getUid(feature).toString();
delete this.skippedFeatureUids_[featureUid];
this.render();
};
/**
* @typedef {{controls: ol.Collection,
* deviceOptions: olx.DeviceOptions,