Reference Source
public class | source

FeatureUpdate

Update a given feature dataset into the specific layer.

See:

Example:

var feature_update = KQ.Query.FeatureUpdate.getInstance();
console.log(feature_update);
try {
		var json_data = {
		"type": "Feature",
		"ID": "Feature1",
		"where": "objectid=21094",
		"geometry": {
			"type": "Polygon",
			"coordinates": [[[105.357365, 30.09963], [105.357365, 30.100066], [105.363172, 30.100066], [105.363172, 30.09963], [105.357365, 30.09963]]]
		},
		"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_update.queryAsync(options,
		function query_good () {
			console.log('query_good');

			var data = feature_update.data();
			console.log('feature update 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>

Update a given feature dataset into the specific layer.

Static Public Methods

public static getInstance(): FeatureUpdate source

Get instance object (Singleton mode)

Return:

FeatureUpdate

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

Update a given feature dataset into the specific layer.

Params:

NameTypeAttributeDescription
options Object

Feature update options

options.url String

Service url

options.layerId String

Target layer id for update

options.forceImport Number

Force import identification

options.data String

Feature data for update

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>