Hit detection refactoring

Get the frame state from the map instead of storing values in the layer renderers.
This commit is contained in:
Éric Lemoine
2014-01-13 10:45:51 +01:00
parent 8b38639082
commit f7be1c155e
5 changed files with 21 additions and 31 deletions
+6 -2
View File
@@ -457,9 +457,13 @@ ol.Map.prototype.disposeInternal = function() {
*/
ol.Map.prototype.forEachFeatureAtPixel =
function(pixel, callback, opt_obj, opt_layerFunction, opt_obj2) {
// FIXME this function should probably take an options object
if (goog.isNull(this.frameState_)) {
return;
}
var coordinate = this.getCoordinateFromPixel(pixel);
return this.renderer_.forEachFeatureAtPixel(
pixel, callback, opt_obj, opt_layerFunction, opt_obj2);
coordinate, this.frameState_, callback, opt_obj,
opt_layerFunction, opt_obj2);
};