Class: GetFeaturesServiceBase

SuperMap.GetFeaturesServiceBase

The GetFeaturesParametersBase class. The data type of the result is Object. Contains the result property, and the data format of result is determined to be GeoJSON or iServerJSON according to the format parameter.

new SuperMap.GetFeaturesServiceBase(url, options)

GetFeaturesServiceBase.js, line 7
Name Type Description
url string

Data query results resource address. Request data service's data query service, URL: http://{Server address}:{Service port number}/iserver/services/{Data service name}/rest/data/ ; for example: "http://localhost:8090/iserver/services/data-jingjin/rest/data/"

options Object

The parameters.

Name Type Default Description
eventListeners Object

Event listener object. There is a processCompleted property to pass in the callback function after processing. The processFailed property is passed to the callback function after the processing fails.

serverType SuperMap.ServerType SuperMap.ServerType.ISERVER optional

Type of the server iServer|iPortal|Online.

format SuperMap.DataFormat SuperMap.DataFormat.GEOJSON optional

The format of the query result.Two formats of iServerJSON and GeoJSON are currently supported. The parameter format is "ISERVER", "GEOJSON".

Example
var myService = new SuperMap.GetFeaturesServiceBase(url, {
    eventListeners: {
        "processCompleted": getFeatureCompleted,
        "processFailed": getFeatureError
    }
});

Extends

Members

formatstring

The format of the query result.Two formats of iServerJSON and GeoJSON are currently supported. The parameter format is "ISERVER", "GEOJSON".

Default Value:
SuperMap.DataFormat.GEOJSON

fromIndexnumber

The minimum index. If this value greater than the toIndex,the query result is null.

maxFeaturesnumber

When processing the SQL query, it is used to set the number of query result returned by the server. The default value is 1000.。

Default Value:
1000

returnContentboolean

Whether to return the new created resource representation or return the URL of the new resource.
If the result is true, then the new created resource, i.e., the the query result representation.
If the result is false, the URI of the querying result is returned.

Default Value:
true

toIndexnumber

The maximum index. If this value greater than the toIndex, use the maximum index as the termination index.

Default Value:
19

Methods

inherited ajaxPolling()

CommonServiceBase.js, line 248

If the number of remaining requests failed is not 0 after the request fails, recapture the url and send request.

inherited calculatePollingTimes()

CommonServiceBase.js, line 266

Calculate how many times the remaining request failed.

destroy()

GetFeaturesServiceBase.js, line 85

Disposes the resource. The property that references resource is set to null.

inherited getCredential(url){SuperMap.Credential}

CommonServiceBase.js, line 190

Get credential information.

Name Type Description
url string

The service url.

Returns:
Type Description
SuperMap.Credential The credential information object.

getFeatureComplete(result)

GetFeaturesServiceBase.js, line 138

Call this function when query completed.

Name Type Description
result Object

The result object returned by server.

inherited getUrlCompleted(result)

CommonServiceBase.js, line 221

Execute this method after the request is successful.

Name Type Description
result Object

The result object returned by the server side.

inherited getUrlFailed(result)

CommonServiceBase.js, line 232

Execute this method after the request is failed.

Name Type Description
result Object

The result object returned by the server side.

inherited isServiceSupportPolling()

CommonServiceBase.js, line 293

Judge whether the service supports polling.

processAsync(params)

GetFeaturesServiceBase.js, line 99

It is responsible for passing the query parameters from the client to the server.

Name Type Description
params Object

The query parameters.

inherited request(options)

CommonServiceBase.js, line 144
Name Type Description
options Object

Optional parameters.

Name Type Default Description
method string 'GET' optional

Request method, including: "GET","POST","PUT","DELETE".

url string optional

The request URL.

params Object optional

The params are only applicable to the request sent by the GET method as a set of key value pairs added to the URL by query string.

data String optional

The data sent to the server.

success function

The callback function after the success request.

failure function

The callback function after the failure request.

scope Object optional

If the callback function is a common method of the object, set the scope of the object.

isInTheSameDomain boolean optional

Whether the request is in the current domain.

withCredentials boolean false optional

Request whether to carry a cookie.

inherited serviceProcessCompleted(result)

CommonServiceBase.js, line 305

Execute this method if process completed.

Name Type Description
result Object

The result object returned by the server side.

inherited serviceProcessFailed(result)

CommonServiceBase.js, line 317

Execute this method if process failed.

Name Type Description
result Object

The result object returned by the server side.