Reference Source
public class | source

FeatureImport

Import a given feature dataset into the specific layer.

See:

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

Get instance object (Singleton mode)

Method Summary

Public Methods
public

data(): Object[]

Get data

public

Get last error message

public

Whether server return error

public

queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult>

Import a given feature dataset into the specific layer.

Static Public Methods

public static getInstance(): FeatureImport source

Get instance object (Singleton mode)

Return:

FeatureImport

Public Methods

public data(): Object[] source

Get data

Return:

Object[]

public errorMsg(): String source

Get last error message

Return:

String

public isLastError(): Boolean source

Whether server return error

Return:

Boolean

public queryAsync(options: Object, function_good: function(): null, function_error: function(): null): Promise<TResult> source

Import a given feature dataset into the specific layer.

Params:

NameTypeAttributeDescription
options Object

Feature import options

options.url String

Service url

options.layerId String

Target layer id for import

options.forceImport Number

Force import identification

options.data String

Feature data for import

options.geoSRS String

Spatial reference of the graphics

function_good function(): null

The function will run after querying successfully.

function_error function(): null

The function will run after querying unsuccessfully.

Return:

Promise<TResult>