buffering extent by resolution*hitTolerance
This commit is contained in:
@@ -204,7 +204,7 @@ ol.render.canvas.ReplayGroup.prototype.forEachFeatureAtCoordinate = function(
|
|||||||
if (this.renderBuffer_ !== undefined) {
|
if (this.renderBuffer_ !== undefined) {
|
||||||
hitExtent = ol.extent.createEmpty();
|
hitExtent = ol.extent.createEmpty();
|
||||||
ol.extent.extendCoordinate(hitExtent, coordinate);
|
ol.extent.extendCoordinate(hitExtent, coordinate);
|
||||||
ol.extent.buffer(hitExtent, resolution * this.renderBuffer_, hitExtent);
|
ol.extent.buffer(hitExtent, resolution * (this.renderBuffer_ + hitTolerance), hitExtent);
|
||||||
}
|
}
|
||||||
|
|
||||||
var mask = ol.render.canvas.ReplayGroup.getCircleArray_(hitTolerance);
|
var mask = ol.render.canvas.ReplayGroup.getCircleArray_(hitTolerance);
|
||||||
|
|||||||
@@ -191,13 +191,12 @@ ol.renderer.canvas.VectorTileLayer.prototype.forEachFeatureAtCoordinate = functi
|
|||||||
var tileGrid = source.getTileGrid();
|
var tileGrid = source.getTileGrid();
|
||||||
var found, tileSpaceCoordinate;
|
var found, tileSpaceCoordinate;
|
||||||
var i, ii, origin, replayGroup;
|
var i, ii, origin, replayGroup;
|
||||||
var tile, tileCoord, tileExtent, tilePixelRatio, tileResolution, pointResolution;
|
var tile, tileCoord, tileExtent, tilePixelRatio, tileResolution;
|
||||||
for (i = 0, ii = replayables.length; i < ii; ++i) {
|
for (i = 0, ii = replayables.length; i < ii; ++i) {
|
||||||
tile = replayables[i];
|
tile = replayables[i];
|
||||||
tileCoord = tile.tileCoord;
|
tileCoord = tile.tileCoord;
|
||||||
tileExtent = source.getTileGrid().getTileCoordExtent(tileCoord, this.tmpExtent);
|
tileExtent = source.getTileGrid().getTileCoordExtent(tileCoord, this.tmpExtent);
|
||||||
pointResolution = tile.getProjection().getPointResolution(resolution, coordinate);
|
if (!ol.extent.containsCoordinate(ol.extent.buffer(tileExtent, hitTolerance * resolution), coordinate)) {
|
||||||
if (!ol.extent.containsCoordinate(ol.extent.buffer(tileExtent, hitTolerance * pointResolution), coordinate)) {
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (tile.getProjection().getUnits() === ol.proj.Units.TILE_PIXELS) {
|
if (tile.getProjection().getUnits() === ol.proj.Units.TILE_PIXELS) {
|
||||||
|
|||||||
Reference in New Issue
Block a user