Better type checking in ol.Map

This commit is contained in:
Éric Lemoine
2014-03-20 13:19:54 +01:00
parent 6a4c2bccc5
commit 435e5e6916
2 changed files with 10 additions and 5 deletions

View File

@@ -92,7 +92,7 @@ oli.FrameState.prototype.postRenderFunctions;
oli.FrameState.prototype.size;
/** @type {Object} */
/** @type {Object.<string, boolean>} */
oli.FrameState.prototype.skippedFeaturesHash_;

View File

@@ -372,7 +372,7 @@ ol.Map = function(options) {
/**
* Hash of features uid to skip drawing.
* @type {Object}
* @type {Object.<string, boolean>}
* @private
*/
this.skippedFeaturesHash_ = {};
@@ -939,9 +939,14 @@ ol.Map.prototype.handleSizeChanged_ = function() {
*/
ol.Map.prototype.handleSkippedFeaturesChange_ = function() {
this.skippedFeaturesHash_ = {};
this.skippedFeatures_.forEach(function(feature) {
this.skippedFeaturesHash_[goog.getUid(feature).toString()] = true;
}, this);
this.skippedFeatures_.forEach(
/**
* @param {ol.Feature} feature Feature.
* @this {ol.Map}
*/
function(feature) {
this.skippedFeaturesHash_[goog.getUid(feature).toString()] = true;
}, this);
this.render();
};