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 displayFeatureInfo = function(pixel) {
|
||||||
var oldHighlight = highlight;
|
var oldHighlight = highlight;
|
||||||
|
|
||||||
var feature;
|
var feature = map.forEachFeatureAtPixel(pixel, function(feature) {
|
||||||
map.forEachFeatureAtPixel(pixel, function(f) {
|
return feature;
|
||||||
if (!feature) {
|
|
||||||
feature = f;
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
var info = document.getElementById('info');
|
var info = document.getElementById('info');
|
||||||
|
|||||||
Reference in New Issue
Block a user