getFeature() for VectorTile layer

This commit is contained in:
Andreas Hocevar
2019-10-07 20:22:54 +02:00
parent e9785317eb
commit 3c243b0236
6 changed files with 143 additions and 24 deletions

View File

@@ -116,6 +116,24 @@ class VectorTileLayer extends BaseVectorLayer {
return new CanvasVectorTileLayerRenderer(this);
}
/**
* Get the topmost feature that intersects the given pixel on the viewport. Returns a promise
* that resolves with an array of features. The array will either contain the topmost feature
* when a hit was detected, or it will be empty.
*
* The hit detection algorithm used for this method is optimized for performance, but is less
* accurate than the one used in {@link import("../PluggableMap.js").default#getFeaturesAtPixel}: Text
* is not considered, and icons are only represented by their bounding box instead of the exact
* image.
*
* @param {import("../pixel.js").Pixel} pixel Pixel.
* @return {Promise<Array<import("../Feature").default>>} Promise that resolves with an array of features.
* @api
*/
getFeatures(pixel) {
return super.getFeatures(pixel);
}
/**
* @return {VectorTileRenderType} The render mode.
*/