mobility-toolbox-js
Version:
Toolbox for JavaScript applications in the domains of mobility and logistics.
34 lines (33 loc) • 893 B
JavaScript
import Layer from './Layer';
/**
* @deprecated
*/
class VectorLayer extends Layer {
/**
* @deprecated
*/
clone(newOptions) {
return new VectorLayer(Object.assign(Object.assign({}, this.get('options')), newOptions));
}
/**
* @deprecated
*/
getFeatureInfoAtCoordinate(coordinate) {
let features = [];
const mapInternal = this.getMapInternal();
if (mapInternal) {
const pixel = mapInternal.getPixelFromCoordinate(coordinate);
features =
mapInternal.getFeaturesAtPixel(pixel, {
hitTolerance: this.get('hitTolerance') || 5,
layerFilter: (l) => l === this,
}) || [];
}
return Promise.resolve({
coordinate,
features,
layer: this,
});
}
}
export default VectorLayer;