new SuperMap.RouteLocatorService(url, options)
common/iServer/RouteLocatorService.js, line 9
| Name | Type | Description | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string |
服务的访问地址。如 http://localhost:8090/iserver/services/spatialanalyst-changchun/restjsr/spatialanalyst。 |
||||||||||||
options |
Object |
参数。
|
Example
实例化该类如下例所示:
(start code)
var routeLocatorParameters_point = new SuperMap.RouteLocatorParameters({
"sourceRoute":{
"type":"LINEM",
"parts":[4],
"points":[
{
"measure":0,
"y":-6674.466867067764,
"x":3817.3527876130133
},
{
"measure":199.57954019411724,
"y":-6670.830929417594,
"x":3617.806369901496
},
{
"measure":609.3656478634477,
"y":-6877.837541432356,
"x":3264.1498746678444
},
{
"measure":936.0174126282958,
"y":-7038.687780615184,
"x":2979.846206068903
}
]
},
"type":"POINT",
"measure":10,
"offset":3,
"isIgnoreGap":true
});
var routeLocatorService = new SuperMap.RouteLocatorService(spatialAnalystURL, {
eventListeners:{
processCompleted:routeLocatorCompleted,
processFailed:routeLocatorFailded
}
);
routeLocatorService.processAsync(routeLocatorParameters_point);
//执行
function routeLocatorCompleted(){todo}
function routeLocatorFailded(){todo}
(end)
Extends
Members
-
formatSuperMap.DataFormat
-
查询结果返回格式,目前支持 iServerJSON 和 GeoJSON 两种格式,参数格式为 "ISERVER","GEOJSON"。
- Default Value: SuperMap.DataFormat.GEOJSON
Methods
-
inherited ajaxPolling()
common/iServer/CommonServiceBase.js, line 247 -
请求失败后,如果剩余请求失败次数不为 0,重新获取 URL 发送请求
-
inherited calculatePollingTimes()
common/iServer/CommonServiceBase.js, line 265 -
计算剩余请求失败执行次数。
-
inherited getCredential(url){SuperMap.Credential}
common/iServer/CommonServiceBase.js, line 189 -
获取凭据信息
Name Type Description urlstring 服务地址。
Returns:
Type Description SuperMap.Credential 凭据信息对象。 -
inherited getUrlCompleted(result)
common/iServer/CommonServiceBase.js, line 220 -
请求成功后执行此方法。
Name Type Description resultObject 服务器返回的结果对象。
-
inherited getUrlFailed(result)
common/iServer/CommonServiceBase.js, line 231 -
请求失败后执行此方法。
Name Type Description resultObject 服务器返回的结果对象。
-
inherited isServiceSupportPolling()
common/iServer/CommonServiceBase.js, line 292 -
判断服务是否支持轮询。
-
processAsync(params)
common/iServer/RouteLocatorService.js, line 81 -
负责将客户端的基于路由对象计算指定点 M 值操作的参数传递到服务端。
Name Type Description paramsSuperMap.RouteLocatorParameters 路由对象定位空间对象的参数类。
-
processAsync(params){Object}
common/iServer/RouteLocatorService.js, line 103 -
将参数转化为 JSON 字符串。
Name Type Description paramsSuperMap.RouteLocatorParameters 路由对象定位空间对象的参数类。
Returns:
Type Description Object 转化后的JSON字符串。 -
inherited request(options)
common/iServer/CommonServiceBase.js, line 149 -
Name Type Description optionsObject 参数。
Name Type Default Description methodstring 'GET' 可选 请求方式,包括 "GET","POST","PUT","DELETE"。
urlstring 可选 发送请求的地址。
paramsObject 可选 作为查询字符串添加到 URL 中的一组键值对,此参数只适用于 GET 方式发送的请求。
datastring 可选 发送到服务器的数据。
successfunction 请求成功后的回调函数。
failurefunction 请求失败后的回调函数。
scopeObject 可选 如果回调函数是对象的一个公共方法,设定该对象的范围。
isInTheSameDomainboolean 可选 请求是否在当前域中。
withCredentialsboolean false 可选 请求是否携带 cookie。
crossOriginboolean 可选 是否允许跨域请求。
headersObject 可选 请求头。
-
inherited serviceProcessCompleted(result)
common/iServer/SpatialAnalystBase.js, line 41 -
分析完成,执行此方法。
Name Type Description resultObject 服务器返回的结果对象。
-
inherited serviceProcessFailed(result)
common/iServer/CommonServiceBase.js, line 316 -
状态失败,执行此方法。
Name Type Description resultObject 服务器返回的结果对象。
-
inherited toGeoJSONResult(result)
common/iServer/SpatialAnalystBase.js, line 67 -
将含有 geometry 的数据转换为 GeoJSON 格式。
Name Type Description resultObject 服务器返回的结果对象。