地物编辑功能

0 投票
你好,我使用地物编辑功能,在 featureService.editFeatures(addFeatureParams, function (serviceResult) {

处,使用    var result23 = serviceResult.result; 获取结果是提示undefine。请问怎么解决

js报

Uncaught DeveloperError: normalized result is not a number
Error
    at new t (eval at <anonymous> (http://localhost:8090/Bitnet_3DMap/Build/Cesium/Cesium.js:25:1), <anonymous>:1:3391)
    at Function.a.normalize (eval at <anonymous> (http://localhost:8090/Bitnet_3DMap/Build/Cesium/Cesium.js:25:1), <anonymous>:1:52205)
    at Function.a.fromRadians (eval at <anonymous> (http://localhost:8090/Bitnet_3DMap/Build/Cesium/Cesium.js:25:1), <anonymous>:1:55681)

代码如下:

    <link href="../Build/Cesium/Widgets/widgets.css" rel="stylesheet">
    <link href="./css/pretty.css" rel="stylesheet">
    <script src="./js/jquery.min.js"></script>
    <script src="./js/config.js"></script>
    <script src="./js/supermap/SuperMap.Include.js"></script>
            <script type="text/javascript" src="../dist/leaflet/include-leaflet.js"></script>

    <script type="text/javascript" src="./js/require.min.js" data-main="js/main"></script>

    <style>
        input[type=text]{
            TEXT-ALIGN: center;
            z-index: 3;
            height: 18px;
            background: none;
            border: none;
            padding: 5px 0;
            -webkit-transition: 0.3s;
            transition: 0.3s;
            border-bottom: 2px solid #b8b2b2;
            color: aliceblue;
        }
    </style>
</head>
<body class="loading">
<div id="cesiumContainer"></div>
<div id="toolbar" class="param-container tool-bar">
    <label style="font: 400 13.3333px Arial;">SQL</label><input type="text" id="SQL" value="SMID>1">
    <button type="button" id="search" class="button black">查询</button>
    <button type="button" id="add" class="button black">添加</button><br>
    <select id="position" style="width: 100%">
        <option value ="1">路灯杆</option>
        <option value ="2">定位点2</option>
        <option value="3">定位点3</option>
        <option value="4">点位点4</option>
    </select>
</div>
<div id="bubble" class="bubble" >
    <div id="tools" style="text-align : right">
    <span  class="fui-cross" title="关闭" id="close" style="color: darkgrey;padding:5px"></span>
    </div>
<div style="overflow-y:scroll;height:150px" id="tableContainer"><table id="tab"></table></div>
</div>
<script>
    function onload(Cesium) {
    
          $("#add").click(function(){
        
        alert("add");
                //实例化地物编辑服务
              //  var url="https://iserver.supermap.io/iserver/services/data-world/rest/data";
                var url = 'http://localhost:8090/iserver/services/data-sql_search/rest/data';

                alert("111");

               

               var xmax = 120, xmin = 100, ymax = 50, ymin = 20,
               point = [];
               point = [
                   Math.floor(Math.random() * (ymax - ymin + 1) + ymin),
                   Math.floor(Math.random() * (xmax - xmin + 1) + xmin)
               ];
               var   marker = L.circleMarker(point, {color: "red"});
                alert("marker:"+marker);
                
                 var featureService = L.supermap.featureService(url);

                alert("featureService:"+featureService);
                
                //设置地物编辑字段参数
                var addFeatureParams = new SuperMap.EditFeaturesParameters({
                    dataSourceName: "qlsource",
                    dataSetName: "LDG_PT",
                    features: marker,
                    editType: "add",
                    returnContent: true
                });
                //使用地物编辑服务向服务端发送请求并获取数据
                featureService.editFeatures(addFeatureParams, function (serviceResult) {

                     // 获取返回数据
                   // var result23 = serviceResult.result;
                     alert("serviceResult:"+serviceResult);
                     alert("serviceResult.result:"+serviceResult.result);

                 // alert("serviceResult.length:"+serviceResult.length);

                });
                
            });
5月 6, 2020 分类:  819次浏览 | 用户: 白色猪 才疏学浅 (10 分)

1个回答

0 投票
问题已解决
5月 7, 2020 用户: 三次鱼疯啦 名扬四海 (2,485 分)
你好  提交请求后一直报错 500

the number of 'fieldNames' and 'fieldValues' are not equal or Geometry is null

这个错误有遇到过吗
...