我在JSAPI中使用了一个特性层,在这里我通过标准选择、更改属性、applyEdits过程来编辑一个特性。在JSAPI中似乎存在一个bug,即3.12和3.14,这使得应用程序编辑在某些特性上失败。回调只是错误的没有任何线索。
有趣的观察结果:
下面是代码的一个快速片段:
sq = buildSelectionQuery();
if (sq) {
all(assetsFeatureLayers.map(function (l) { return l.selectFeatures(sq, esri.layers.FeatureLayer.SELECTION_NEW).promise;})
).then(function (fls) {
console.log('sel res', fls);
all(fls.map(function (r, i) {
var fs = r[0]; // the first is an array of selected features
var l = assetsFeatureLayers[i];
console.log(fs);
if (fs.length > 0) {
console.log("Switching phases to: ", tph);
fs.forEach(function (f) {
f.attributes['phasecode'] = tph;
});
console.log("Saving switched phases for layer: ", l.name);
return l.applyEdits(null, fs, null); //.promise;
} else {
return null;
}
})).then(function (l) {
console.log("Phase switching finished successfully!", l);
clearAllSelections();
}, function (e) {
console.log("Error switching phases!", e);
clearAllSelections();
});
});
} 发布于 2015-09-30 21:11:08
好吧,我找到了根本原因。我们使用的是ESRI的PHP代理,这是一个错误。升级到最新的1.1测试版解决了这个问题。以下是他们回购的链接:https://github.com/Esri/resource-proxy
https://stackoverflow.com/questions/32830758
复制相似问题