arcgis javascript数据库错误:Linestring或poly boundary是自相交的

时间:2016-06-08 09:23:47

标签: arcgis-js-api

我正在尝试使用arcgis javascript FeatureLayer Eidting ...

但是...经常编辑功能无法正常工作。

编辑不适用于数据库。

我测试如下。

  1. featurelayer load
  2. 编辑开始
  3. 编辑停止
  4. enter image description here

    我不知道...为什么会出现这个错误...

    我在等待答案..

1 个答案:

答案 0 :(得分:0)

我的代码如下:

esriConfig.defaults.geometryService = new esri.tasks.GeometryService(" https://utility.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer");

map.on(" layers-add-result",initEditing);

    var SIDO = new FeatureLayer("http://dev.smui.co.kr:26080/arcgis/rest/services/kios/FEATURE_LP_AA/FeatureServer/0", {`enter code here`
      mode: FeatureLayer.MODE_SNAPSHOT,
      outFields: ["*"]
    });


    map.addLayers(SIDO);

    function initEditing(evt) {
      console.log("initEditing", evt);
      // var map = this;
      var currentLayer = null;
      var layers = arrayUtils.map(evt.layers, function(result) {
        return result.layer;
        console.log("result ==== "+result);
      });
      console.log("layers", layers);

       editToolbar = new Edit(map);
      editToolbar.on("deactivate", function(evt) {
          console.log("deactivate !!!! ");
        currentLayer.applyEdits(null, [evt.graphic], null);
      });

      arrayUtils.forEach(layers, function(layer) {
        var editingEnabled = false;
        layer.on("dbl-click", function(evt) {
          event.stop(evt);
          if (editingEnabled === false) {
            editingEnabled = true;
            editToolbar.activate(Edit.EDIT_VERTICES , evt.graphic);
            pre_evt = evt.graphic;

            console.log("dbl-click  & eidt  true");
          } else {
            currentLayer = this;
            editToolbar.deactivate();
            editingEnabled = false;
            console.log("dbl-click  & eidt false ");
          }
        });