getFeatureService = new SuperMap.REST.GetFeaturesByBufferService("http://www.supermapol.com/realspace/services/data-compare/rest/data", {
eventListeners: {
"processCompleted": processCompleted,
"processFailed": null
}
});
这里面这个processCompleted这个方法我这没有运行
function processCompleted(getFeaturesEventArgs) {
var dis = 999999;
var data;
getFeaturesEventArgs.result.features.forEach(function (item, i) {
var cart3 = new Cesium.Cartesian3.fromDegrees(Number(item.data.SMX), Number(item.data.SMY), Number(item.data.Z));
var _dis = Cesium.Cartesian3.distance(clickPt, cart3);
if (dis > _dis) {
dis = _dis;
data = item.data;
}
});
viewer.entities.removeAll();
if (getFeaturesEventArgs.result.features.length > 0) {
var pt = {
x: Number(data.SMX),
y: Number(data.SMY),
z: Number(data.Z)
}
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(pt.x, pt.y, pt.z),
point: {
pixelSize: 10,
color: Cesium.Color.RED
}
});
var colorE = getColor(Number(data.GRIDRSCP));
viewer.entities.add({
position: Cesium.Cartesian3.fromDegrees(pt.x, pt.y, pt.z),
box: {
dimensions: new Cesium.Cartesian3(5, 6, 3),
material: Cesium.Color.fromCssColorString(colorE).withAlpha(0.5),
outline: true,
outlineColor: Cesium.Color.BLACK
}
});
valueGRIDRSCP = data.GRIDRSCP;
var entity = new Cesium.Entity({
name: "",
description: createDescription(Cesium, [valueGRIDRSCP])
});
viewer.selectedEntity = entity;
}
}
而且getFeaturesEventArgs也没有 把关于这个参数的代码去掉 也不运行到这