Skip to content

Commit

Permalink
fix overscaled featuresAt
Browse files Browse the repository at this point in the history
fix #2103
  • Loading branch information
ansis committed Feb 10, 2016
1 parent a7b8f5a commit ce41eb2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion js/data/feature_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ FeatureTree.prototype.query = function(args, callback) {
var radius, bounds;
if (typeof x !== 'undefined' && typeof y !== 'undefined') {
// a point (or point+radius) query
radius = (params.radius || 0) * EXTENT / args.scale;
radius = (params.radius || 0) * EXTENT / args.tileSize / args.scale;
bounds = [x - radius, y - radius, x + radius, y + radius];
} else {
// a rectangle query
Expand Down
1 change: 1 addition & 0 deletions js/source/source.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ exports._vectorFeaturesAt = function(coord, params, callback) {
x: result.x,
y: result.y,
scale: result.scale,
tileSize: result.tileSize,
source: this.id,
params: params
}, callback, result.tile.workerID);
Expand Down
3 changes: 2 additions & 1 deletion js/source/tile_pyramid.js
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,8 @@ TilePyramid.prototype = {
tile: tile,
x: pos.x,
y: pos.y,
scale: this.transform.worldSize / Math.pow(2, tile.coord.z)
scale: Math.pow(2, this.transform.zoom - tile.coord.z),
tileSize: tile.tileSize
};
}
}
Expand Down

0 comments on commit ce41eb2

Please sign in to comment.