前端调用iserver服务,目前使用EditFeaturesParameters可以添加新要素,但是官网的文档里没有关于更新要素属性的说明,只讲了用update,我就想请教一下这个怎么用?
function addNewFeature(feature) {
var addFeatureParams = new SuperMap.EditFeaturesParameters({
features: feature,
dataSourceName: DATASOURCE,
dataSetName: DATASET,
editType: "add",
returnContent: true
});
new ol.supermap.FeatureService(url).editFeatures(addFeatureParams, serviceResult => {
if (serviceResult.result.succeed) {
addFeature = null;
$(".form-content").hide();
vectorLayer.getSource().clear();
getVectorData();
select.setActive(true);
Notiflix.Notify.Success('添加要素成功');
} else {
Notiflix.Notify.Failure("添加要素失败!");
}
});
}