Break out of forEachFeatureAtPixel as soon as hit detected in vector-layer example

This commit is contained in:
Tom Payne
2013-12-02 16:25:56 +01:00
parent 41811e6566
commit f1a9f76841

View File

@@ -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');