Break out of forEachFeatureAtPixel as soon as hit detected in vector-layer example
This commit is contained in:
@@ -59,11 +59,8 @@ var highlight;
|
||||
var displayFeatureInfo = function(pixel) {
|
||||
var oldHighlight = highlight;
|
||||
|
||||
var feature;
|
||||
map.forEachFeatureAtPixel(pixel, function(f) {
|
||||
if (!feature) {
|
||||
feature = f;
|
||||
}
|
||||
var feature = map.forEachFeatureAtPixel(pixel, function(feature) {
|
||||
return feature;
|
||||
});
|
||||
|
||||
var info = document.getElementById('info');
|
||||
|
||||
Reference in New Issue
Block a user