forEachFeatureAtPixel shouldn't fail if layer has no source
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user