使用产品:iserver10 iDesktop10i 操作系统:win10 x86
数据类型:文件型
问题详细描述:监听事件进不去,不能查询单体化属性,layer也已经找到了,setQueryParameter也写进去了,就是点击不好用,求解决!!!代码如下:
<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
<title>query</title>
<link href="css/widgets.css" rel="stylesheet">
<link href="css/pretty.css" rel="stylesheet">
<script type="text/javascript" src="js/require.min.js" data-main="js/main"></script>
<script type="text/javascript">
var viewer,url;
function onload(Cesium){
//初始化Viewer和场景部件
viewer=new Cesium.Viewer('cesiumContainer');
var scene= viewer.scene;
//获取场景的url地址
var url="http://localhost:8090/iserver/services/3D-DaYanTa/rest/realspace";
//打开场景
var promise = scene.open(url);
var infoboxContainer = document.getElementById("bubble");
viewer.customInfobox = infoboxContainer;
Cesium.when(promise,function(layers){
console.log(scene.layers);
var layer = scene.layers.find("Config");
scene.camera.setView({destination:Cesium.Cartesian3.fromDegrees(0,0,800)});
console.log(layer);
layer.setQueryParameter({
url: 'http://localhost:8090/iserver/services/data-DaYanTa/rest/data',
dataSourceName: 'dayanta_1',
dataSetName: 'IsoLine_region_1_1_1',
keyWord: 'SmID'
});
});
viewer.pickEvent.addEventListener(function(feature){
alert("监听事件已生效");
});
}
</script>
</head>
<body>
<div id="cesiumContainer" style="width:100%;height:100%"></div>
<blockquote id="bubble" class="bubble">
<h2 id="title"></h2>
<p id="des" class="word"></p>
</blockquote>
</body>
</html>