Openlayers 5 ol cesium:有没有办法在ol cesium中选择一个功能并将其追溯到openlayers功能?
我有一个geojson,作为特性向量添加到openlayer。属性部分中的所有geojson都有一些附加信息,我想在3d空间中单击某个功能(例如弹出窗口)时显示这些信息。我使用ol铯覆盖示例创建了一个pop,但仅在启用3d(ol铯)的情况下无法获得功能geojson属性。Openlayers 5 ol cesium:有没有办法在ol cesium中选择一个功能并将其追溯到openlayers功能?,openlayers-5,Openlayers 5,我有一个geojson,作为特性向量添加到openlayer。属性部分中的所有geojson都有一些附加信息,我想在3d空间中单击某个功能(例如弹出窗口)时显示这些信息。我使用ol铯覆盖示例创建了一个pop,但仅在启用3d(ol铯)的情况下无法获得功能geojson属性。 有什么方法可以在3d空间中单击某个功能来获取该功能的详细信息吗?我想我必须这样做 private getOlFeatureFromMouseLocationInOLCS(cesiumMouseEvent: any): OlFe
有什么方法可以在3d空间中单击某个功能来获取该功能的详细信息吗?我想我必须这样做
private getOlFeatureFromMouseLocationInOLCS(cesiumMouseEvent: any): OlFeature | undefined {
if (cesiumMouseEvent.position.x === 0 && cesiumMouseEvent.position.y === 0) {
return;
}
/**
//hoping the below two lines have bee defined early on .
this._ol3d = new OLCesium({ map: this._currentMap });
this.scene = this._ol3d.getCesiumScene();
**/
const pickedFeature = this.scene.pick(cesiumMouseEvent.position);
let olFeature: OlFeature;
if (pickedFeature.primitive) {
olFeature = (pickedFeature.primitive.olFeature)?pickedFeature.primitive.olFeature as OlFeature : undefined;
} else {
olFeature = undefined;
}
return olFeature;
}
找到了一个解决方案并在这里发布