Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass resolution when requesting features in an extent #1812

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/ol/renderer/canvas/canvasvectorlayerrenderer.js
Expand Up @@ -203,7 +203,8 @@ ol.renderer.canvas.VectorLayer.prototype.prepareFrame =
var tolerance = frameStateResolution / (2 * pixelRatio);
var replayGroup = new ol.render.canvas.ReplayGroup(tolerance, extent,
frameStateResolution);
vectorSource.forEachFeatureInExtent(extent,
vectorSource.forEachFeatureInExtentAtResolution(
extent, frameStateResolution / pixelRatio,
/**
* @param {ol.Feature} feature Feature.
*/
Expand Down
3 changes: 2 additions & 1 deletion src/ol/source/imagevectorsource.js
Expand Up @@ -115,7 +115,8 @@ ol.source.ImageVector.prototype.canvasFunctionInternal_ =
resolution);

var loading = false;
this.source_.forEachFeatureInExtent(extent,
this.source_.forEachFeatureInExtentAtResolution(
extent, resolution / pixelRatio,
/**
* @param {ol.Feature} feature Feature.
*/
Expand Down
15 changes: 15 additions & 0 deletions src/ol/source/vectorsource.js
Expand Up @@ -196,6 +196,21 @@ ol.source.Vector.prototype.forEachFeatureInExtent =
};


/**
* @param {ol.Extent} extent Extent.
* @param {number} resolution Resolution.
* @param {function(this: T, ol.Feature): S} f Callback.
* @param {T=} opt_this The object to use as `this` in `f`.
* @return {S|undefined}
* @template T,S
* @todo stability experimental
*/
ol.source.Vector.prototype.forEachFeatureInExtentAtResolution =
function(extent, resolution, f, opt_this) {
return this.forEachFeatureInExtent(extent, f, opt_this);
};


/**
* @return {Array.<ol.Feature>} Features.
* @todo stability experimental
Expand Down