Skip to main content
1 of 2

var stateFeature = map.forEachFeatureAtPixel(evt.pixel, function (feature, layer) { // If layer is undefined, that means it's a feature from a FeatureOverlay if (layer) { return feature; } }, null, function (layer) { return layer === statesLayer; });

The feature is undefined.