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