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) {
|
$(map.getViewport()).on('mousemove', function(e) {
|
||||||
var pixel = map.getEventPixel(e.originalEvent);
|
var pixel = map.getEventPixel(e.originalEvent);
|
||||||
|
|
||||||
var hit = false;
|
var hit = map.forEachFeatureAtPixel(pixel, function(feature) {
|
||||||
map.forEachFeatureAtPixel(pixel, function(feature) {
|
return true;
|
||||||
hit = true;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
if (hit) {
|
if (hit) {
|
||||||
|
|||||||
Reference in New Issue
Block a user