Use frame state for pixel to coord conversion

This commit is contained in:
Tim Schaub
2015-02-07 16:52:34 -07:00
parent a460cb3983
commit d4b7bb7c57
3 changed files with 10 additions and 3 deletions

View File

@@ -9,6 +9,7 @@ goog.require('ol.layer.Vector');
goog.require('ol.render.webgl.ReplayGroup');
goog.require('ol.renderer.vector');
goog.require('ol.renderer.webgl.Layer');
goog.require('ol.vec.Mat4');
@@ -165,7 +166,9 @@ ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtCoordinate =
*/
ol.renderer.webgl.VectorLayer.prototype.forEachLayerAtPixel =
function(pixel, frameState, callback, thisArg) {
var coordinate = this.getMap().getCoordinateFromPixel(pixel);
var coordinate = pixel.slice();
ol.vec.Mat4.multVec2(
frameState.pixelToCoordinateMatrix, coordinate, coordinate);
var hasFeature = this.hasFeatureAtCoordinate(coordinate, frameState);
if (hasFeature) {