可以参考
function addFeatureCompleted(drawGeometryArgs) {
var points = [
new SuperMap.Geometry.Point(116.86186644483,41.046830100301),
new SuperMap.Geometry.Point(116.65000797215, 40.654268812689),
new SuperMap.Geometry.Point(117.99593238682,40.448641471558),
new SuperMap.Geometry.Point(116.86186644483, 41.046830100301)
],
linearRings = new SuperMap.Geometry.LinearRing(points),
region = new SuperMap.Geometry.Polygon([linearRings]);
var polygonVector = new SuperMap.Feature.Vector(region);
vectorLayer.addFeatures(polygonVector);
region.id = "100000";
var editFeatureParameter,
editFeatureService,
features = {
fieldNames: ['NAME'],
fieldValues: ['aaa'],
geometry: region
};
editFeatureParameter = new SuperMap.REST.EditFeaturesParameters({
features: [features],
editType: SuperMap.REST.EditType.ADD,
returnContent: false
});
editFeatureService = new SuperMap.REST.EditFeaturesService(url2, {
eventListeners: {
"processCompleted": addFeaturesProcessCompleted,
"processFailed": processFailed
}
});
editFeatureService.processAsync(editFeatureParameter);
}
根据官网范例简单写了一个功能,添加结束后会有对应的结果被打印出来