Class: MeasureService

mapboxgl.supermap.MeasureService

The MeasureService class.

new mapboxgl.supermap.MeasureService(url, options)

MeasureService.js, line 6
Name Type Description
url string

The url of service. For instance:http://localhost:8090/iserver/services/map-world/rest/maps/World+Map。

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 SuperMap.ServerType SuperMap.ServerType.ISERVER optional

Type of server iServer|iPortal|online。

measureMode SuperMap.MeasureMode SuperMap.MeasureMode.DISTANCE optional

Measurement mode, including distance measurement mode and area measurement mode.

crossOrigin boolean optional

Whether to allow cross-domain requests.

headers Object optional

Request header.

Extends

Events

inherited initialized

ServiceBase.js, line 23

Triggered after the constructor construct succeeds.

Properties:
Name Type Description
this Object

This object.

Methods

measure(params, type, callback){mapboxgl.supermap.MeasureService}

MeasureService.js, line 46

measuring.

Name Type Description
params SuperMap.MeasureParameters

The MeasureParameters class.

type string

Measurement type.

callback RequestCallback

The callback of result data returned by the server side.

Returns:
Type Description
mapboxgl.supermap.MeasureService Measurement service.

measureArea(params, callback)

MeasureService.js, line 36

Measure area.

Name Type Description
params SuperMap.MeasureParameters

The MeasureParameters class.

callback RequestCallback

The callback of result data returned by the server side.

measureDistance(params, callback)

MeasureService.js, line 26

Measure distance.

Name Type Description
params SuperMap.MeasureParameters

The MeasureParameters class.

callback RequestCallback

The callback of result data returned by the server side.