Break out of forEachFeatureAtPixel as soon as hit detected in synthetic-points example

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

View File

@@ -64,9 +64,8 @@ var map = new ol.Map({
$(map.getViewport()).on('mousemove', function(e) {
var pixel = map.getEventPixel(e.originalEvent);
var hit = false;
map.forEachFeatureAtPixel(pixel, function(feature) {
hit = true;
var hit = map.forEachFeatureAtPixel(pixel, function(feature) {
return true;
});
if (hit) {