FeatureImport
将给定的要素集导入到指定的图层中
Example:
var feature_import = KQ.Query.FeatureImport.getInstance();
console.log(feature_import);
try {
  var json_data = {
    "type": "Feature",
    "ID": "Feature1",
    "geometry": {
      "type": "Polygon",
      "coordinates": [[[105.357937, 30.100403], [105.357937, 30.103263], [105.36324, 30.103263], [105.36324, 30.100403], [105.357937, 30.100403]]]
    },
    "properties": {
      "BSM": 2075,
      "BZ": " ",
      "DJH": "5120210010110323000",
      "DWXZ": "2",
      "DZ": " ",
      "FHDM": " ",
      "FZMJ": 0.0,
      "HYDM": " ",
      "ISZY": " ",
      "JDLH": " ",
      "JZMD": 0.47000000000000005,
      "JZMJ": 4343.61,
      "JZRJL": 3.2600000000000004,
      "JZWLX": " ",
      "JZWZDMJ": 622.12,
      "NZ": " ",
      "OBJECTID": 200,
      "QDJG": 0.0,
      "QLR": "卫生局杨文礼等",
      "QSDWDM": "512021001011",
      "QSXZ": "20",
      "QSXZMC": "国有土地使用权",
      "SBDJ": 0.0,
      "SCMJ": 0.0,
      "SFFZ": 0,
      "SM": " ",
      "SYQLX": "2",
      "SYQX": " ",
      "SZTF": " ",
      "TDJB": " ",
      "TDYT": "071",
      "TDZH": " ",
      "TDZL": "学沟湾路242",
      "TXDZ": " ",
      "TXQL": " ",
      "XDLH": "071",
      "XZ": " ",
      "YBDJH": "21-1-11-323",
      "YSDJH": " ",
      "YSDM": "16110000",
      "YTDZH": " ",
      "ZDID": 2075,
      "ZDMJ": 1331.1860000000002,
      "ZDTZM": " ",
      "ZGBM": " ",
      "ZLDWDM": "512021001000",
      "ZZRQ": "2010/12/29"
    }
  };
  var options = {
    url: 'http://172.16.0.106:8699/KQGis/rest/services/zy',
    layerId: 77,
    forceImport: true,
    data: JSON.stringify(json_data),
    geoSRS: 'EPSG:4326',
  };
  feature_import.queryAsync(options,
    function query_good () {
      console.log('query_good');
      var data = feature_import.data();
      console.log('feature import data.length:' + data.length);
      data.forEach(function (d) {
        console.log(d.ID);
      })
    },
    function query_error () {
      console.log('query_error');
    }
  );
}
catch (e) {
  console.log('catch error:' + e);
}Static Method Summary
| Static Public Methods | ||
| public static | 获取实例对象 (单例模式) | |
Method Summary
| Public Methods | ||
| public | 获取数据 | |
| public | 获取最后的错误信息 | |
| public | 服务器是否返回了错误 | |
| public | queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> 将给定的要素集导入到指定的图层中 | |
| public | 获取服务器的返回结果 | |
Static Public Methods
Public Methods
public queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> source
将给定的要素集导入到指定的图层中
Params:
| Name | Type | Attribute | Description | 
| options | Object | 要素导入的配置参数 | |
| options.url | String | 服务器的url地址 | |
| options.layerId | String | 入库的目标图层ID | |
| options.forceImport | Number | 强制导入标识 (该参数指定是否在导入图形与原图层中的要素有压盖的情况下, 是否强制导入) | |
| options.data | String | 要导入的要素数据 | |
| options.geoSRS | String | 图形的空间参考 | |
| function_good | function(): null | 查询成功后执行的函数 | |
| function_error | function(): null | 查询失败后执行的函数 | 
 Reference
  Source
  
  Reference
  Source
  
  