Class: FeatureService

mapboxgl.supermap.FeatureService

The FeatureService class. This class provides: get features by IDs, get features by SQL, get features by geometry, get features by bounds, get features by buffer, edit features.

new mapboxgl.supermap.FeatureService(url, options)

FeatureService.js, line 15
Name Type Description
url string

The url of service.

options Object

The optional parameters.

Name Type Default Description
proxy string optional

Service agent address.

withCredentials boolean false optional

Request whether to carry a cookie.

serverType mapboxgl.supermapServerType mapboxgl.supermapServerType.ISERVER optional

Type of server iServer|iPortal|online。

crossOrigin boolean optional

Whether to allow cross-domain requests.

headers Object optional

Request header.

Example
new mapboxgl.supermap.FeatureService(url)
 .getFeaturesByIDs(param,function(result){
    //doSomething
})

Extends

Events

inherited initialized

ServiceBase.js, line 23

Triggered after the constructor construct succeeds.

Properties:
Name Type Description
this Object

This object.

Methods

editFeatures(params, callback)

FeatureService.js, line 148

Edit features.

Name Type Description
params mapboxgl.supermapEditFeaturesParameters

The EditFeaturesParameters class.

callback RequestCallback

The callback of result data returned by the server side.

getFeaturesByBounds(params, callback, resultFormat, params, callback, resultFormat)

FeatureService.js, line 38

Get features by bounds.

Name Type Default Description
params mapboxgl.supermapGetFeaturesByIDsParameters

The GetFeaturesByIDsParameters class.

callback RequestCallback

The callback of result data returned by the server side.

resultFormat mapboxgl.supermapDataFormat DataFormat.GEOJSON optional

The format of result data. getFeaturesByIDs(params, callback, resultFormat) { var me = this; var getFeaturesByIDsService = new GetFeaturesByIDsService(me.url, { proxy: me.options.proxy, withCredentials: me.options.withCredentials, serverType: me.options.serverType, eventListeners: { processCompleted: callback, processFailed: callback }, format: me._processFormat(resultFormat) }); getFeaturesByIDsService.processAsync(me._processParams(params)); }

/**
params mapboxgl.supermapGetFeaturesByBoundsParameters

The GetFeaturesByBoundsParameters class.

callback RequestCallback

The callback of result data returned by the server side.

resultFormat mapboxgl.supermapDataFormat DataFormat.GEOJSON optional

The format of result data.

getFeaturesByBuffer(params, callback, resultFormat)

FeatureService.js, line 81

Get features by buffer.

Name Type Default Description
params mapboxgl.supermapGetFeaturesByBufferParameters

The GetFeaturesByBufferParameters class.

callback RequestCallback

The callback of result data returned by the server side.

resultFormat mapboxgl.supermapDataFormat DataFormat.GEOJSON optional

The format of result data.

getFeaturesByGeometry(params, callback, resultFormat)

FeatureService.js, line 126

Get features by geometry.

Name Type Default Description
params mapboxgl.supermapGetFeaturesByGeometryParameters

The GetFeaturesByGeometryParameters class.

callback RequestCallback

The callback of result data returned by the server side.

resultFormat mapboxgl.supermapDataFormat DataFormat.GEOJSON optional

The format of result data.

getFeaturesBySQL(params, callback, resultFormat)

FeatureService.js, line 103

Get features by SQL.

Name Type Default Description
params mapboxgl.supermapGetFeaturesBySQLParameters

The GetFeaturesBySQLParameters class.

callback RequestCallback

The callback of result data returned by the server side.

resultFormat mapboxgl.supermapDataFormat mapboxgl.supermapDataFormat.GEOJSON optional

The format of result data.