Replace forEachLayer with forEachVisibleLayer and pass layer renderer

This commit is contained in:
Tom Payne
2012-07-17 14:05:15 +02:00
parent ac80a6e0b6
commit ab702c29e6
+6 -3
View File
@@ -151,13 +151,16 @@ ol.Map.prototype.disposeInternal = function() {
/** /**
* @param {function(this: T, *, number)} f Function. * @param {function(this: T, ol.Layer, ol.LayerRenderer, number)} f Function.
* @param {T=} opt_obj Object. * @param {T=} opt_obj Object.
* @template T * @template T
*/ */
ol.Map.prototype.forEachLayer = function(f, opt_obj) { ol.Map.prototype.forEachVisibleLayer = function(f, opt_obj) {
var layers = this.getLayers(); var layers = this.getLayers();
layers.forEach(f, opt_obj); layers.forEach(function(layer, index) {
var layerRenderer = this.getLayerRenderer(layer);
f.call(opt_obj, layer, layerRenderer, index);
}, this);
}; };