进行pickEvent的监听事件,点击时并没有触发该事件。代码如下:
let promise = scene.open(layerService.url); //打开iserver场景服务下所有图层
Cesium.when.all(promise, layers => {
for (let layer of layers) {
let layerName = layer.name.split("@")[0];
if (layerName && layerName != "") {
let datasetName = ModelDatasetNameEnum[layerName];
layer.setQueryParameter({
//设置查询参数
url: layerService.dataUrl,
dataSourceName: "model_filter",
dataSetName: datasetName,
keyWord: "UniqueID"
});
}
}
});
if (scene.pickPositionSupported) {
this.viewer.pickEvent.addEventListener(function(feature) {
//没有进来
console.log(feature)
});
}