editFeatures 怎么把要素新建的属性信息保存到数据集中?

0 投票

面数据集服务  新建属性信息  前端保存绘制的多边形时,传参数就报错  求帮忙!!!

3月 8 分类:  91次浏览 | 用户: 爱好者 (5 分)
重新分类 3月 9 用户:邬袁凯

1个回答

1 投票
 
已采纳

可以参考

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);
    }

根据官网范例简单写了一个功能,添加结束后会有对应的结果被打印出来

3月 9 用户: 于浩 登峰造极 (5,665 分)
采纳于 3月 9 用户:爱好者

vectorLayer.addFeatures(polygonVector);

其中这个vectorLayer 是指什么?  怎么声明?

根据您的参考可以成功把绘制的多边形要素保存到服务了,现在需要修改已保存的多边形要素的形状,整不出来迷茫中angel(如下图鼠标拖动修改的方式)

...