Break out of forEachFeatureAtPixel as soon as hit detected in synthetic-points example
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user