本人已经发布了数据服务和三维服务,并设置了图层的setQueryParameter方法,注册了pickEvent事件,但是点击场景,仍然无法触发该事件,请问是什么原因?
代码如下:
var scene = viewer.scene;
var url = "http://localhost:8090/iserver/services/3D-modelCombine/rest/realspace";
var promise = scene.open(url);
Cesium.when(promise, function (layers) {
//设置属性查询参数
var layer = scene.layers.find("modelCombine");
layer.setQueryParameter({
url: 'http://localhost:8090/iserver/services/data-modelCombine/rest/data',
dataSourceName: 'modelCombine',
isMerge: true,
keyWord: 'SmID'
});
datainfo(layer);
}, function (e) {
if (widget._showRenderLoopErrors) {
var title = '渲染时发生错误,已停止渲染。';
widget.showErrorPanel(title, undefined, e);
}
});
//点击对象查询对象属性
var table = document.getElementById("tab");
viewer.pickEvent.addEventListener(function (feature) {
alert("pickEvent事件已生效");
});