Hit-detect skipped features, but not on unmanaged layer
This commit is contained in:
@@ -131,19 +131,17 @@ ol.renderer.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, fram
|
||||
var viewState = frameState.viewState;
|
||||
var viewResolution = viewState.resolution;
|
||||
|
||||
/** @type {Object.<string, boolean>} */
|
||||
var features = {};
|
||||
|
||||
/**
|
||||
* @param {ol.Feature|ol.render.Feature} feature Feature.
|
||||
* @param {ol.layer.Layer} layer Layer.
|
||||
* @return {?} Callback result.
|
||||
*/
|
||||
function forEachFeatureAtCoordinate(feature) {
|
||||
function forEachFeatureAtCoordinate(feature, layer) {
|
||||
goog.asserts.assert(feature !== undefined, 'received a feature');
|
||||
var key = goog.getUid(feature).toString();
|
||||
if (!(key in features)) {
|
||||
features[key] = true;
|
||||
return callback.call(thisArg, feature, null);
|
||||
if (!(key in frameState.skippedFeatureUids &&
|
||||
!frameState.layerStates[goog.getUid(layer)].managed)) {
|
||||
return callback.call(thisArg, feature, layer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,9 +170,7 @@ ol.renderer.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, fram
|
||||
if (layer.getSource()) {
|
||||
result = layerRenderer.forEachFeatureAtCoordinate(
|
||||
layer.getSource().getWrapX() ? translatedCoordinate : coordinate,
|
||||
frameState,
|
||||
layerState.managed ? callback : forEachFeatureAtCoordinate,
|
||||
thisArg);
|
||||
frameState, forEachFeatureAtCoordinate, thisArg);
|
||||
}
|
||||
if (result) {
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user