From f4500c8f893a4af447651fe1833acf9229bb6233 Mon Sep 17 00:00:00 2001 From: tsauerwein Date: Thu, 29 Jan 2015 12:20:40 +0100 Subject: [PATCH] Rename *AtPixel to *AtCoordinate if coordinate --- src/ol/map.js | 4 ++-- src/ol/render/canvas/canvasreplay.js | 2 +- src/ol/render/webgl/webglreplay.js | 6 +++--- .../renderer/canvas/canvasimagelayerrenderer.js | 6 +++--- .../renderer/canvas/canvasvectorlayerrenderer.js | 4 ++-- src/ol/renderer/dom/domimagelayerrenderer.js | 4 ++-- src/ol/renderer/dom/domvectorlayerrenderer.js | 4 ++-- src/ol/renderer/layerrenderer.js | 8 ++++---- src/ol/renderer/maprenderer.js | 14 +++++++------- src/ol/renderer/webgl/webglimagelayerrenderer.js | 10 +++++----- src/ol/renderer/webgl/webglmaprenderer.js | 15 ++++++++------- .../renderer/webgl/webglvectorlayerrenderer.js | 16 ++++++++-------- src/ol/source/imagevectorsource.js | 4 ++-- src/ol/source/source.js | 2 +- src/ol/source/vectorsource.js | 4 ++-- .../canvas/canvasvectorlayerrenderer.test.js | 8 ++++---- 16 files changed, 56 insertions(+), 55 deletions(-) diff --git a/src/ol/map.js b/src/ol/map.js index 5a21e4a7d0..9b019ed2eb 100644 --- a/src/ol/map.js +++ b/src/ol/map.js @@ -583,7 +583,7 @@ ol.Map.prototype.forEachFeatureAtPixel = var layerFilter = goog.isDef(opt_layerFilter) ? opt_layerFilter : goog.functions.TRUE; var thisArg2 = goog.isDef(opt_this2) ? opt_this2 : null; - return this.renderer_.forEachFeatureAtPixel( + return this.renderer_.forEachFeatureAtCoordinate( coordinate, this.frameState_, callback, thisArg, layerFilter, thisArg2); }; @@ -649,7 +649,7 @@ ol.Map.prototype.hasFeatureAtPixel = var layerFilter = goog.isDef(opt_layerFilter) ? opt_layerFilter : goog.functions.TRUE; var thisArg = goog.isDef(opt_this) ? opt_this : null; - return this.renderer_.hasFeatureAtPixel( + return this.renderer_.hasFeatureAtCoordinate( coordinate, this.frameState_, layerFilter, thisArg); }; diff --git a/src/ol/render/canvas/canvasreplay.js b/src/ol/render/canvas/canvasreplay.js index 866823231e..e8f70c7c1d 100644 --- a/src/ol/render/canvas/canvasreplay.js +++ b/src/ol/render/canvas/canvasreplay.js @@ -1866,7 +1866,7 @@ ol.render.canvas.ReplayGroup.prototype.finish = function() { * @return {T|undefined} Callback result. * @template T */ -ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtPixel = function( +ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtCoordinate = function( coordinate, resolution, rotation, skippedFeaturesHash, callback) { var transform = this.hitDetectionTransform_; diff --git a/src/ol/render/webgl/webglreplay.js b/src/ol/render/webgl/webglreplay.js index 2913c010a7..5432e0aab6 100644 --- a/src/ol/render/webgl/webglreplay.js +++ b/src/ol/render/webgl/webglreplay.js @@ -1171,7 +1171,7 @@ ol.render.webgl.ReplayGroup.prototype.replayHitDetection_ = function(context, * @return {T|undefined} Callback result. * @template T */ -ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtPixel = function( +ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtCoordinate = function( coordinate, context, center, resolution, rotation, size, pixelRatio, opacity, brightness, contrast, hue, saturation, skippedFeaturesHash, callback) { @@ -1228,9 +1228,9 @@ ol.render.webgl.ReplayGroup.prototype.forEachFeatureAtPixel = function( * @param {number} hue Global hue. * @param {number} saturation Global saturation. * @param {Object} skippedFeaturesHash Ids of features to skip. - * @return {boolean} Is there a feature at the given pixel? + * @return {boolean} Is there a feature at the given coordinate? */ -ol.render.webgl.ReplayGroup.prototype.hasFeatureAtPixel = function( +ol.render.webgl.ReplayGroup.prototype.hasFeatureAtCoordinate = function( coordinate, context, center, resolution, rotation, size, pixelRatio, opacity, brightness, contrast, hue, saturation, skippedFeaturesHash) { var gl = context.getGL(); diff --git a/src/ol/renderer/canvas/canvasimagelayerrenderer.js b/src/ol/renderer/canvas/canvasimagelayerrenderer.js index f87b6723ba..8edd16d709 100644 --- a/src/ol/renderer/canvas/canvasimagelayerrenderer.js +++ b/src/ol/renderer/canvas/canvasimagelayerrenderer.js @@ -56,14 +56,14 @@ goog.inherits(ol.renderer.canvas.ImageLayer, ol.renderer.canvas.Layer); /** * @inheritDoc */ -ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtPixel = +ol.renderer.canvas.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var layer = this.getLayer(); var source = layer.getSource(); var resolution = frameState.viewState.resolution; var rotation = frameState.viewState.rotation; var skippedFeatureUids = frameState.skippedFeatureUids; - return source.forEachFeatureAtPixel( + return source.forEachFeatureAtCoordinate( coordinate, resolution, rotation, skippedFeatureUids, /** * @param {ol.Feature} feature Feature. @@ -88,7 +88,7 @@ ol.renderer.canvas.ImageLayer.prototype.forEachLayerAtPixel = // for ImageVector sources use the original hit-detection logic, // so that for example also transparent polygons are detected var coordinate = this.getMap().getCoordinateFromPixel(pixel); - var hasFeature = this.forEachFeatureAtPixel( + var hasFeature = this.forEachFeatureAtCoordinate( coordinate, frameState, goog.functions.TRUE, this); if (hasFeature) { diff --git a/src/ol/renderer/canvas/canvasvectorlayerrenderer.js b/src/ol/renderer/canvas/canvasvectorlayerrenderer.js index e8baf6274c..219288c185 100644 --- a/src/ol/renderer/canvas/canvasvectorlayerrenderer.js +++ b/src/ol/renderer/canvas/canvasvectorlayerrenderer.js @@ -116,7 +116,7 @@ ol.renderer.canvas.VectorLayer.prototype.composeFrame = /** * @inheritDoc */ -ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtPixel = +ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { if (goog.isNull(this.replayGroup_)) { return undefined; @@ -126,7 +126,7 @@ ol.renderer.canvas.VectorLayer.prototype.forEachFeatureAtPixel = var layer = this.getLayer(); /** @type {Object.} */ var features = {}; - return this.replayGroup_.forEachFeatureAtPixel(coordinate, + return this.replayGroup_.forEachFeatureAtCoordinate(coordinate, resolution, rotation, frameState.skippedFeatureUids, /** * @param {ol.Feature} feature Feature. diff --git a/src/ol/renderer/dom/domimagelayerrenderer.js b/src/ol/renderer/dom/domimagelayerrenderer.js index 334357da44..cce9db4785 100644 --- a/src/ol/renderer/dom/domimagelayerrenderer.js +++ b/src/ol/renderer/dom/domimagelayerrenderer.js @@ -47,14 +47,14 @@ goog.inherits(ol.renderer.dom.ImageLayer, ol.renderer.dom.Layer); /** * @inheritDoc */ -ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtPixel = +ol.renderer.dom.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var layer = this.getLayer(); var source = layer.getSource(); var resolution = frameState.viewState.resolution; var rotation = frameState.viewState.rotation; var skippedFeatureUids = frameState.skippedFeatureUids; - return source.forEachFeatureAtPixel( + return source.forEachFeatureAtCoordinate( coordinate, resolution, rotation, skippedFeatureUids, /** * @param {ol.Feature} feature Feature. diff --git a/src/ol/renderer/dom/domvectorlayerrenderer.js b/src/ol/renderer/dom/domvectorlayerrenderer.js index fe7cee6af2..bcb5ec63f8 100644 --- a/src/ol/renderer/dom/domvectorlayerrenderer.js +++ b/src/ol/renderer/dom/domvectorlayerrenderer.js @@ -176,7 +176,7 @@ ol.renderer.dom.VectorLayer.prototype.dispatchEvent_ = /** * @inheritDoc */ -ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtPixel = +ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { if (goog.isNull(this.replayGroup_)) { return undefined; @@ -186,7 +186,7 @@ ol.renderer.dom.VectorLayer.prototype.forEachFeatureAtPixel = var layer = this.getLayer(); /** @type {Object.} */ var features = {}; - return this.replayGroup_.forEachFeatureAtPixel(coordinate, + return this.replayGroup_.forEachFeatureAtCoordinate(coordinate, resolution, rotation, frameState.skippedFeatureUids, /** * @param {ol.Feature} feature Feature. diff --git a/src/ol/renderer/layerrenderer.js b/src/ol/renderer/layerrenderer.js index 35dad5de78..1519d679d1 100644 --- a/src/ol/renderer/layerrenderer.js +++ b/src/ol/renderer/layerrenderer.js @@ -53,7 +53,7 @@ goog.inherits(ol.renderer.Layer, goog.Disposable); * @return {T|undefined} Callback result. * @template S,T */ -ol.renderer.Layer.prototype.forEachFeatureAtPixel = goog.nullFunction; +ol.renderer.Layer.prototype.forEachFeatureAtCoordinate = goog.nullFunction; /** @@ -67,7 +67,7 @@ ol.renderer.Layer.prototype.forEachFeatureAtPixel = goog.nullFunction; ol.renderer.Layer.prototype.forEachLayerAtPixel = function(pixel, frameState, callback, thisArg) { var coordinate = this.getMap().getCoordinateFromPixel(pixel); - var hasFeature = this.forEachFeatureAtPixel( + var hasFeature = this.forEachFeatureAtCoordinate( coordinate, frameState, goog.functions.TRUE, this); if (hasFeature) { @@ -81,9 +81,9 @@ ol.renderer.Layer.prototype.forEachLayerAtPixel = /** * @param {ol.Coordinate} coordinate Coordinate. * @param {olx.FrameState} frameState Frame state. - * @return {boolean} Is there a feature at the given pixel? + * @return {boolean} Is there a feature at the given coordinate? */ -ol.renderer.Layer.prototype.hasFeatureAtPixel = goog.functions.FALSE; +ol.renderer.Layer.prototype.hasFeatureAtCoordinate = goog.functions.FALSE; /** diff --git a/src/ol/renderer/maprenderer.js b/src/ol/renderer/maprenderer.js index c57765c4e5..bc6ba4666c 100644 --- a/src/ol/renderer/maprenderer.js +++ b/src/ol/renderer/maprenderer.js @@ -121,7 +121,7 @@ ol.renderer.Map.expireIconCache_ = function(map, frameState) { * @return {T|undefined} Callback result. * @template S,T,U */ -ol.renderer.Map.prototype.forEachFeatureAtPixel = +ol.renderer.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg, layerFilter, thisArg2) { var result; @@ -131,7 +131,7 @@ ol.renderer.Map.prototype.forEachFeatureAtPixel = if (!goog.isNull(this.replayGroup)) { /** @type {Object.} */ var features = {}; - result = this.replayGroup.forEachFeatureAtPixel(coordinate, + result = this.replayGroup.forEachFeatureAtCoordinate(coordinate, viewResolution, viewRotation, {}, /** * @param {ol.Feature} feature Feature. @@ -158,7 +158,7 @@ ol.renderer.Map.prototype.forEachFeatureAtPixel = if (ol.layer.Layer.visibleAtResolution(layerState, viewResolution) && layerFilter.call(thisArg2, layer)) { var layerRenderer = this.getLayerRenderer(layer); - result = layerRenderer.forEachFeatureAtPixel( + result = layerRenderer.forEachFeatureAtCoordinate( coordinate, frameState, callback, thisArg); if (result) { return result; @@ -193,7 +193,7 @@ ol.renderer.Map.prototype.forEachLayerAtPixel = if (!goog.isNull(this.replayGroup)) { var coordinate = this.getMap().getCoordinateFromPixel(pixel); - var hasFeature = this.replayGroup.forEachFeatureAtPixel(coordinate, + var hasFeature = this.replayGroup.forEachFeatureAtCoordinate(coordinate, viewResolution, viewRotation, {}, goog.functions.TRUE); if (hasFeature) { @@ -231,12 +231,12 @@ ol.renderer.Map.prototype.forEachLayerAtPixel = * returns `true` will be tested for features. By default, all visible * layers will be tested. * @param {U} thisArg Value to use as `this` when executing `layerFilter`. - * @return {boolean} Is there a feature at the given pixel? + * @return {boolean} Is there a feature at the given coordinate? * @template U */ -ol.renderer.Map.prototype.hasFeatureAtPixel = +ol.renderer.Map.prototype.hasFeatureAtCoordinate = function(coordinate, frameState, layerFilter, thisArg) { - var hasFeature = this.forEachFeatureAtPixel( + var hasFeature = this.forEachFeatureAtCoordinate( coordinate, frameState, goog.functions.TRUE, this, layerFilter, thisArg); return goog.isDef(hasFeature); diff --git a/src/ol/renderer/webgl/webglimagelayerrenderer.js b/src/ol/renderer/webgl/webglimagelayerrenderer.js index 418efd1ae7..af74c1e244 100644 --- a/src/ol/renderer/webgl/webglimagelayerrenderer.js +++ b/src/ol/renderer/webgl/webglimagelayerrenderer.js @@ -73,14 +73,14 @@ ol.renderer.webgl.ImageLayer.prototype.createTexture_ = function(image) { /** * @inheritDoc */ -ol.renderer.webgl.ImageLayer.prototype.forEachFeatureAtPixel = +ol.renderer.webgl.ImageLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { var layer = this.getLayer(); var source = layer.getSource(); var resolution = frameState.viewState.resolution; var rotation = frameState.viewState.rotation; var skippedFeatureUids = frameState.skippedFeatureUids; - return source.forEachFeatureAtPixel( + return source.forEachFeatureAtCoordinate( coordinate, resolution, rotation, skippedFeatureUids, /** @@ -214,9 +214,9 @@ ol.renderer.webgl.ImageLayer.prototype.updateProjectionMatrix_ = /** * @inheritDoc */ -ol.renderer.webgl.ImageLayer.prototype.hasFeatureAtPixel = +ol.renderer.webgl.ImageLayer.prototype.hasFeatureAtCoordinate = function(coordinate, frameState) { - var hasFeature = this.forEachFeatureAtPixel( + var hasFeature = this.forEachFeatureAtCoordinate( coordinate, frameState, goog.functions.TRUE, this); return goog.isDef(hasFeature); }; @@ -235,7 +235,7 @@ ol.renderer.webgl.ImageLayer.prototype.forEachLayerAtPixel = // for ImageVector sources use the original hit-detection logic, // so that for example also transparent polygons are detected var coordinate = this.getMap().getCoordinateFromPixel(pixel); - var hasFeature = this.forEachFeatureAtPixel( + var hasFeature = this.forEachFeatureAtCoordinate( coordinate, frameState, goog.functions.TRUE, this); if (hasFeature) { diff --git a/src/ol/renderer/webgl/webglmaprenderer.js b/src/ol/renderer/webgl/webglmaprenderer.js index 14ed190a15..7fd95f3580 100644 --- a/src/ol/renderer/webgl/webglmaprenderer.js +++ b/src/ol/renderer/webgl/webglmaprenderer.js @@ -540,7 +540,7 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) { /** * @inheritDoc */ -ol.renderer.webgl.Map.prototype.forEachFeatureAtPixel = +ol.renderer.webgl.Map.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg, layerFilter, thisArg2) { var result; @@ -560,7 +560,7 @@ ol.renderer.webgl.Map.prototype.forEachFeatureAtPixel = // use default color values var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_; - result = this.replayGroup.forEachFeatureAtPixel(coordinate, + result = this.replayGroup.forEachFeatureAtCoordinate(coordinate, context, viewState.center, viewState.resolution, viewState.rotation, frameState.size, frameState.pixelRatio, d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {}, @@ -589,7 +589,7 @@ ol.renderer.webgl.Map.prototype.forEachFeatureAtPixel = if (ol.layer.Layer.visibleAtResolution(layerState, viewState.resolution) && layerFilter.call(thisArg2, layer)) { var layerRenderer = this.getLayerRenderer(layer); - result = layerRenderer.forEachFeatureAtPixel( + result = layerRenderer.forEachFeatureAtCoordinate( coordinate, frameState, callback, thisArg); if (result) { return result; @@ -603,7 +603,7 @@ ol.renderer.webgl.Map.prototype.forEachFeatureAtPixel = /** * @inheritDoc */ -ol.renderer.webgl.Map.prototype.hasFeatureAtPixel = +ol.renderer.webgl.Map.prototype.hasFeatureAtCoordinate = function(coordinate, frameState, layerFilter, thisArg) { var hasFeature = false; @@ -619,7 +619,7 @@ ol.renderer.webgl.Map.prototype.hasFeatureAtPixel = // use default color values var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_; - hasFeature = this.replayGroup.hasFeatureAtPixel(coordinate, + hasFeature = this.replayGroup.hasFeatureAtCoordinate(coordinate, context, viewState.center, viewState.resolution, viewState.rotation, frameState.size, frameState.pixelRatio, d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {}); @@ -636,7 +636,8 @@ ol.renderer.webgl.Map.prototype.hasFeatureAtPixel = if (ol.layer.Layer.visibleAtResolution(layerState, viewState.resolution) && layerFilter.call(thisArg, layer)) { var layerRenderer = this.getLayerRenderer(layer); - hasFeature = layerRenderer.hasFeatureAtPixel(coordinate, frameState); + hasFeature = + layerRenderer.hasFeatureAtCoordinate(coordinate, frameState); if (hasFeature) { return true; } @@ -666,7 +667,7 @@ ol.renderer.webgl.Map.prototype.forEachLayerAtPixel = var d = ol.renderer.webgl.Map.DEFAULT_COLOR_VALUES_; var coordinate = this.getMap().getCoordinateFromPixel(pixel); - var hasFeature = this.replayGroup.hasFeatureAtPixel(coordinate, + var hasFeature = this.replayGroup.hasFeatureAtCoordinate(coordinate, context, viewState.center, viewState.resolution, viewState.rotation, frameState.size, frameState.pixelRatio, d.opacity, d.brightness, d.contrast, d.hue, d.saturation, {}); diff --git a/src/ol/renderer/webgl/webglvectorlayerrenderer.js b/src/ol/renderer/webgl/webglvectorlayerrenderer.js index 845770f017..7a3de9e676 100644 --- a/src/ol/renderer/webgl/webglvectorlayerrenderer.js +++ b/src/ol/renderer/webgl/webglvectorlayerrenderer.js @@ -106,7 +106,7 @@ ol.renderer.webgl.VectorLayer.prototype.disposeInternal = function() { /** * @inheritDoc */ -ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtPixel = +ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtCoordinate = function(coordinate, frameState, callback, thisArg) { if (goog.isNull(this.replayGroup_) || goog.isNull(this.layerState_)) { return undefined; @@ -118,7 +118,7 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtPixel = var layerState = this.layerState_; /** @type {Object.} */ var features = {}; - return this.replayGroup_.forEachFeatureAtPixel(coordinate, + return this.replayGroup_.forEachFeatureAtCoordinate(coordinate, context, viewState.center, viewState.resolution, viewState.rotation, frameState.size, frameState.pixelRatio, layerState.opacity, layerState.brightness, layerState.contrast, @@ -142,8 +142,8 @@ ol.renderer.webgl.VectorLayer.prototype.forEachFeatureAtPixel = /** * @inheritDoc */ -ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtPixel = - function(pixel, frameState) { +ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtCoordinate = + function(coordinate, frameState) { if (goog.isNull(this.replayGroup_) || goog.isNull(this.layerState_)) { return false; } else { @@ -151,8 +151,7 @@ ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtPixel = var context = mapRenderer.getContext(); var viewState = frameState.viewState; var layerState = this.layerState_; - var coordinate = this.getMap().getCoordinateFromPixel(pixel); - return this.replayGroup_.hasFeatureAtPixel(coordinate, + return this.replayGroup_.hasFeatureAtCoordinate(coordinate, context, viewState.center, viewState.resolution, viewState.rotation, frameState.size, frameState.pixelRatio, layerState.opacity, layerState.brightness, layerState.contrast, @@ -165,8 +164,9 @@ ol.renderer.webgl.VectorLayer.prototype.hasFeatureAtPixel = * @inheritDoc */ ol.renderer.webgl.VectorLayer.prototype.forEachLayerAtPixel = - function(coordinate, frameState, callback, thisArg) { - var hasFeature = this.hasFeatureAtPixel(coordinate, frameState); + function(pixel, frameState, callback, thisArg) { + var coordinate = this.getMap().getCoordinateFromPixel(pixel); + var hasFeature = this.hasFeatureAtCoordinate(coordinate, frameState); if (hasFeature) { return callback.call(thisArg, this.getLayer()); diff --git a/src/ol/source/imagevectorsource.js b/src/ol/source/imagevectorsource.js index 0ce9683a6f..521ad8e8ae 100644 --- a/src/ol/source/imagevectorsource.js +++ b/src/ol/source/imagevectorsource.js @@ -152,14 +152,14 @@ ol.source.ImageVector.prototype.canvasFunctionInternal_ = /** * @inheritDoc */ -ol.source.ImageVector.prototype.forEachFeatureAtPixel = function( +ol.source.ImageVector.prototype.forEachFeatureAtCoordinate = function( coordinate, resolution, rotation, skippedFeatureUids, callback) { if (goog.isNull(this.replayGroup_)) { return undefined; } else { /** @type {Object.} */ var features = {}; - return this.replayGroup_.forEachFeatureAtPixel( + return this.replayGroup_.forEachFeatureAtCoordinate( coordinate, resolution, 0, skippedFeatureUids, /** * @param {ol.Feature} feature Feature. diff --git a/src/ol/source/source.js b/src/ol/source/source.js index 0113df474d..a54d304caa 100644 --- a/src/ol/source/source.js +++ b/src/ol/source/source.js @@ -85,7 +85,7 @@ goog.inherits(ol.source.Source, ol.Observable); * @return {T|undefined} Callback result. * @template T */ -ol.source.Source.prototype.forEachFeatureAtPixel = +ol.source.Source.prototype.forEachFeatureAtCoordinate = goog.nullFunction; diff --git a/src/ol/source/vectorsource.js b/src/ol/source/vectorsource.js index de1783e130..ccfe2cbaa0 100644 --- a/src/ol/source/vectorsource.js +++ b/src/ol/source/vectorsource.js @@ -295,7 +295,7 @@ ol.source.Vector.prototype.forEachFeature = function(callback, opt_this) { * @return {S|undefined} The return value from the last call to the callback. * @template T,S */ -ol.source.Vector.prototype.forEachFeatureAtCoordinate = +ol.source.Vector.prototype.forEachFeatureAtCoordinateDirect = function(coordinate, callback, opt_this) { var extent = [coordinate[0], coordinate[1], coordinate[0], coordinate[1]]; return this.forEachFeatureInExtent(extent, function(feature) { @@ -409,7 +409,7 @@ ol.source.Vector.prototype.getFeatures = function() { */ ol.source.Vector.prototype.getFeaturesAtCoordinate = function(coordinate) { var features = []; - this.forEachFeatureAtCoordinate(coordinate, function(feature) { + this.forEachFeatureAtCoordinateDirect(coordinate, function(feature) { features.push(feature); }); return features; diff --git a/test/spec/ol/renderer/canvas/canvasvectorlayerrenderer.test.js b/test/spec/ol/renderer/canvas/canvasvectorlayerrenderer.test.js index a1165aebaa..2457dae729 100644 --- a/test/spec/ol/renderer/canvas/canvasvectorlayerrenderer.test.js +++ b/test/spec/ol/renderer/canvas/canvasvectorlayerrenderer.test.js @@ -58,7 +58,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { }); - describe('#forEachFeatureAtPixel', function() { + describe('#forEachFeatureAtCoordinate', function() { var renderer; beforeEach(function() { @@ -70,8 +70,8 @@ describe('ol.renderer.canvas.VectorLayer', function() { map.getRenderer(), layer); var replayGroup = {}; renderer.replayGroup_ = replayGroup; - replayGroup.forEachFeatureAtPixel = function(resolution, - rotation, coordinate, skippedFeaturesUids, callback) { + replayGroup.forEachFeatureAtCoordinate = function(coordinate, + resolution, rotation, skippedFeaturesUids, callback) { var geometry = new ol.geom.Point([0, 0]); var feature = new ol.Feature(); callback(geometry, feature); @@ -89,7 +89,7 @@ describe('ol.renderer.canvas.VectorLayer', function() { rotation: 0 } }; - renderer.forEachFeatureAtPixel( + renderer.forEachFeatureAtCoordinate( coordinate, frameState, spy, undefined); expect(spy.callCount).to.be(1); });