Avoid unnecessary getImageData calls in hit detection

If a feature is outside the hit extent, don't execute the end
geometry instruction that calls getImageData.
This commit is contained in:
Kevin Schmidt
2016-07-13 19:10:33 -06:00
parent 57af1a9b24
commit 1d585f8924

View File

@@ -270,7 +270,7 @@ ol.render.canvas.Replay.prototype.replay_ = function(
i = /** @type {number} */ (instruction[2]);
} else if (opt_hitExtent !== undefined && !ol.extent.intersects(
opt_hitExtent, feature.getGeometry().getExtent())) {
i = /** @type {number} */ (instruction[2]);
i = /** @type {number} */ (instruction[2]) + 1;
} else {
++i;
}