Also listen on loading images

This fixes a bug that occured when an image source was used by multiple maps. In that case the map that didn't load the image wouldn't register a load listener on that image and would therefore not call render to request a re-render of the map.
This commit is contained in:
Éric Lemoine
2015-01-08 16:41:51 +01:00
parent 8e982b0763
commit 4814983306
7 changed files with 44 additions and 35 deletions

View File

@@ -108,7 +108,7 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtPixel =
* @param {goog.events.Event} event Image style change event.
* @private
*/
ol.renderer.webgl.VectorLayer.prototype.handleImageChange_ =
ol.renderer.webgl.VectorLayer.prototype.handleStyleImageChange_ =
function(event) {
this.renderIfReadyAndVisible();
};
@@ -232,7 +232,7 @@ ol.renderer.webgl.VectorLayer.prototype.renderFeature =
loading = ol.renderer.vector.renderFeature(
replayGroup, feature, styles[i],
ol.renderer.vector.getSquaredTolerance(resolution, pixelRatio),
this.handleImageChange_, this) || loading;
this.handleStyleImageChange_, this) || loading;
}
return loading;
};