首页 / 浏览问题 / 三维GIS / 问题详情
编辑添加三维矢量对象到数据集
21EXP 2016年11月24日
能否通过传参的方式将量测得到的line3D和GeoRegion3D [lineDraw(dTotalDis, line3D)/regionDraw(dArea, GeoRegion3D)] 作为geometry,从而实现添加三维矢量对象到数据集中呢?

 var editFeatureParameter,
            editFeatureService,
            features = {
                fieldNames: [],
                fieldValues: [],
                geometry: feature3d
            };

1个回答

您好,三维对象目前暂不支持通过iserver数据服务进行编辑。

跟您带来不便了,不好意思。
3,389EXP 2016年11月24日
之前在技术资源中心的超图代码里面找到一个示例代码,是将二位点转换为三维点,再通过数据服务添加对象的,为什么又不支持了呢?
您好,您可能记错了,是把三维点转换为二维点再通过数据服务添加的。
她实际上添加的也是二维的要素,但是定义了高程字段值,那么线跟面是否有可能实现呢?

onMouseDown:function(e)
              {
                var x = e.get_clientX();
                var y = e.get_clientY();
                //像素坐标点转三维点
                var point = new SuperMap.Pixel(x,y);
                var point3d=sceneControl.pixelToGlobe(point,SuperMap.Web.Realspace.PixelToGlobeMode.TerrainAndModel);
                var z=point3d.z;
                var point2d = new SuperMap.Geometry.Point(point3d.x, point3d.y);
                addFeatureCompleted(point2d,z);
                pan();                                        
              }
            };

function addFeatureCompleted(point2d,z) {
               
                var geometry = point2d;
                geometry.id = "100000";
                var editFeatureParameter,
                        editFeatureService,
                        features = {
                            fieldNames:["ZValue"],
                            fieldValues:[z],
                            geometry:geometry
                        };
                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);
            }
线和面对象有多个节点,无法通过一个字段来存储每个节点的高程。
好的,谢谢
...