Remove unused hasFeatureAtCoordinate from ol/renderer/Layer
This commit is contained in:
committed by
Olivier Guyot
parent
3bca9b5297
commit
933a6297bb
@@ -132,15 +132,6 @@ class LayerRenderer extends Observable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param {import("../coordinate.js").Coordinate} coordinate Coordinate.
|
|
||||||
* @param {import("../PluggableMap.js").FrameState} frameState Frame state.
|
|
||||||
* @return {boolean} Is there a feature at the given coordinate?
|
|
||||||
*/
|
|
||||||
hasFeatureAtCoordinate(coordinate, frameState) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load the image if not already loaded, and register the image change
|
* Load the image if not already loaded, and register the image change
|
||||||
* listener if needed.
|
* listener if needed.
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
import LayerRenderer from '../Layer.js';
|
import LayerRenderer from '../Layer.js';
|
||||||
import WebGLHelper from '../../webgl/Helper.js';
|
import WebGLHelper from '../../webgl/Helper.js';
|
||||||
import {TRUE} from '../../functions.js';
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,13 +82,6 @@ class WebGLLayerRenderer extends LayerRenderer {
|
|||||||
return this.helper.getShaderCompileErrors();
|
return this.helper.getShaderCompileErrors();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @inheritDoc
|
|
||||||
*/
|
|
||||||
hasFeatureAtCoordinate(coordinate, frameState) {
|
|
||||||
const feature = this.forEachFeatureAtCoordinate(coordinate, frameState, 0, TRUE, null);
|
|
||||||
return feature !== undefined;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ describe('ol.renderer.webgl.PointsLayer', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('#forEachFeatureAtCoordinate and #hasFeatureAtCoordinate', function() {
|
describe('#forEachFeatureAtCoordinate', function() {
|
||||||
let layer, renderer, feature;
|
let layer, renderer, feature;
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
@@ -181,7 +181,7 @@ describe('ol.renderer.webgl.PointsLayer', function() {
|
|||||||
viewHints: [],
|
viewHints: [],
|
||||||
coordinateToPixelTransform: transform
|
coordinateToPixelTransform: transform
|
||||||
};
|
};
|
||||||
let found, hit;
|
let found;
|
||||||
const cb = function(feature) {
|
const cb = function(feature) {
|
||||||
found = feature;
|
found = feature;
|
||||||
};
|
};
|
||||||
@@ -196,9 +196,7 @@ describe('ol.renderer.webgl.PointsLayer', function() {
|
|||||||
function checkHit(x, y, expected) {
|
function checkHit(x, y, expected) {
|
||||||
found = null;
|
found = null;
|
||||||
renderer.forEachFeatureAtCoordinate([x, y], frameState, 0, cb, null);
|
renderer.forEachFeatureAtCoordinate([x, y], frameState, 0, cb, null);
|
||||||
hit = renderer.hasFeatureAtCoordinate([x, y], frameState);
|
|
||||||
expect(found).to.be(expected ? feature : null);
|
expect(found).to.be(expected ? feature : null);
|
||||||
expect(hit).to.eql(expected);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkHit(0, 0, true);
|
checkHit(0, 0, true);
|
||||||
|
|||||||
Reference in New Issue
Block a user