1,iserver10i通过SIMID查询出模型上的所有数据,在进行修改里面的一个属性值,代码如下
根据SQL查询出
var SQL = "元素ID=377478";
var getFeatureParam, getFeatureBySQLService, getFeatureBySQLParams;
getFeatureParam = new SuperMap.REST.FilterParameter({
attributeFilter: SQL
});
getFeatureBySQLParams = new SuperMap.REST.GetFeaturesBySQLParameters({
queryParameter: getFeatureParam,
toIndex: -1,
datasetNames: ["test:test"]
});
var url = "http://XXXX/iserver/services/data-test/rest/data";
getFeatureBySQLService = new SuperMap.REST.GetFeaturesBySQLService(url, {
eventListeners: {
"processCompleted": onQueryComplete,
"processFailed": processFailed
}
});
getFeatureBySQLService.processAsync(getFeatureBySQLParams);
selectedFeatures 这个值是上面查询出来的。
上面这已经查询出数据,在进行修改属性
var features = {
fieldNames: selectedFeatures[0].fieldNames,
fieldValues: selectedFeatures[0].fieldValues,
geometry: selectedFeatures[0].geometry
};
debugger;
features.geometry.id = feature.fid;
var editFeatureParameter = new SuperMap.REST.EditFeaturesParameters({
features: [features],
editType: SuperMap.REST.EditType.UPDATE,
});
url = "http://xxxx/iserver/services/data-test/rest/data/datasources/test/datasets/test";
var myGetFeaturesByIDsService = new SuperMap.REST.EditFeaturesService(url, {
eventListeners: {
"processCompleted": updateFeaturesProcessCompleted,
"processFailed": processFailed
}
});
myGetFeaturesByIDsService.processAsync(editFeatureParameter);
执行时也没有出现错误,也没有做出任何提示信息,反过去查看构件里面的属性并没有被修改,请问是什么情况,或是代码接口有调整有问题,请指点一二谢谢