forEachFeatureAtPixel shouldn't fail if layer has no source

This commit is contained in:
Pierre GIRAUD
2015-09-16 10:18:31 +02:00
parent e88f06b70f
commit badf14e0f1
2 changed files with 16 additions and 4 deletions

View File

@@ -170,9 +170,11 @@ ol.renderer.Map.prototype.forEachFeatureAtCoordinate =
(ol.layer.Layer.visibleAtResolution(layerState, viewResolution) &&
layerFilter.call(thisArg2, layer))) {
var layerRenderer = this.getLayerRenderer(layer);
result = layerRenderer.forEachFeatureAtCoordinate(
layer.getSource().getWrapX() ? translatedCoordinate : coordinate,
frameState, callback, thisArg);
if (!goog.isNull(layer.getSource())) {
result = layerRenderer.forEachFeatureAtCoordinate(
layer.getSource().getWrapX() ? translatedCoordinate : coordinate,
frameState, callback, thisArg);
}
if (result) {
return result;
}