Webgl points / read only one pixel for feature hit detection
Also implements `hasFeatureAtCoordinate`. `hitTolerance` is not supported for now.
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
import LayerRenderer from '../Layer.js';
|
||||
import WebGLHelper from '../../webgl/Helper.js';
|
||||
import {TRUE} from '../../functions.js';
|
||||
|
||||
|
||||
/**
|
||||
@@ -81,6 +82,14 @@ class WebGLLayerRenderer extends LayerRenderer {
|
||||
getShaderCompileErrors() {
|
||||
return this.helper.getShaderCompileErrors();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
hasFeatureAtCoordinate(coordinate, frameState) {
|
||||
const feature = this.forEachFeatureAtCoordinate(coordinate, frameState, 0, TRUE, null);
|
||||
return feature !== undefined;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user