类名 PlotServer

# new PlotServer(options)

标绘服务

参数

名称 类型 默认值 描述
options Object

构造参数

url String æ— 

服务基地址

继承关系

成员变量

成员变量概述

名称 类型 描述
clientId Boolean

客户端id

enableGlobeFetch Boolean

是否使用确据唯一的fetch对象,默认为true,当设为false时,会使用自己私有的fetch对象,所有的请求设置不会影响全局

headers String

请求头参数

requestInterceptor function

请求发送拦截器

requestTimeout String

请求超时时间,默认45000ms,即45s

responseInterceptor function

请求响应拦截器

tokenAttachType TokenAttachType

指定token附加到何处

tokenKey String

token名

tokenValue String

token值

url String

服务基地址

成员变量详情

Boolean

# clientId

客户端id

Inherited From:
Boolean

# enableGlobeFetch

是否使用确据唯一的fetch对象,默认为true,当设为false时,会使用自己私有的fetch对象,所有的请求设置不会影响全局

Inherited From:
示例
//设置请求基地址
// ES5引入方式
const { BaseServer } = Zondy.Service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //请求基地址
  url: '你的URL',
  //使用私有的fetch对象
  enableGlobeFetch: false,
  //此时设置token等属性,不会影响全局的fetch对象
  tokenValue: '你的token'
});
//继续使用全局fetch
BaseServer.enableGlobeFetch = true;
String

# headers

请求头参数

Inherited From:
示例
//设置请求头参数
// ES5引入方式
const { BaseServer } = Zondy.Service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //请求头
  headers: {
     //设置Content-Type为multipart/form-data
    'Content-Type': 'multipart/form-data',
     //设置token
    'token': '你的token'
  }
});
//动态修改
BaseServer.headers.token = 'æ–°token';
function

# requestInterceptor

请求发送拦截器

Inherited From:
示例
//设置拦截器,任何一个继承自BaseServer的对象都可以设置,全局唯一
// ES5引入方式
const { BaseServer,RequestInterceptor } = Zondy.Service
// ES6引入方式
import { BaseServer,RequestInterceptor } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //设置请求发送拦截器
  requestInterceptor: new RequestInterceptor({
    //请求发送前进行统一处理
    before: function(config) {
      //执行你的业务逻辑
      //注意必须显示返回config对象,如果返回为空,则不发送请求
      return config;
    },
    //请求发送失败时进行统一处理
    failure: function(error) {
      //执行你的业务逻辑
    }
  })
});
//动态修改
BaseServer.requestInterceptor.before = function() {};
String

# requestTimeout

请求超时时间,默认45000ms,即45s

Inherited From:
示例
//设置超时时间
//初始化AddressServer服务对象
// ES5引入方式
const { BaseServer } = Zondy.Service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //è¶…æ—¶æ—¶é—´
  requestTimeout: 2000
});
//动态修改
BaseServer.requestTimeout = 3000;
function

# responseInterceptor

请求响应拦截器

Inherited From:
示例
//设置拦截器,任何一个继承自BaseServer的对象都可以设置,全局唯一
// ES5引入方式
const { BaseServer,ResponseInterceptor } = Zondy.Service
// ES6引入方式
import { BaseServer,ResponseInterceptor } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //设置请求响应拦截器
  responseInterceptor: new ResponseInterceptor({
    //执行请求响应,接口调用成功时会执行的回调
    success: function(result) {
      //执行你的业务逻辑
      //注意必须显示返回result对象,如果返回为空,则不执行请求响应成功回调
      return result;
    },
    //请求响应成功,接口调用失败时会执行的函数
    failure: function(result) {
      //执行你的业务逻辑
      //注意必须显示返回result对象,如果返回为空,则不执行回调韩式
      return result;
    }
  })
});
//动态修改
BaseServer.responseInterceptor.success = function() {};
TokenAttachType

# tokenAttachType

指定token附加到何处

Inherited From:
示例
//设置token值
// ES5引入方式
const { BaseServer } = Zondy.Service
const { TokenAttachType } = Zondy.Enum
// ES6引入方式
import { BaseServer,TokenAttachType } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //token名
  tokenValue: '你的token值',
  //token值
  tokenValue: '你的token值',
  //指定token附加到url后面
  tokenAttachType: TokenAttachType.url
});
//动态修改
BaseServer.tokenAttachType = TokenAttachType.header;
String

# tokenKey

token名

Inherited From:
示例
//设置token名
// ES5引入方式
const { BaseServer } = Zondy.Service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //token名
  tokenKey: '你的tokenKey'
});
//动态修改
BaseServer.tokenKey = 'æ–°tokenKey';
String

# tokenValue

token值

Inherited From:
示例
//设置token值
// ES5引入方式
const { BaseServer } = Zondy.Service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //token值
  tokenValue: '你的token值'
});
//动态修改
BaseServer.tokenValue = '新token值';
String

# url

服务基地址

Inherited From:
示例
//设置请求基地址
// ES5引入方式
const { BaseServer } = Zondy.Service
// ES6引入方式
import { BaseServer } from "@mapgis/webclient-common"
let BaseServer = new BaseServer({
  //请求基地址
  url: '你的URL'
});
//动态修改
BaseServer.url = 'æ–°URL';

方法

方法概述

名称 返回值类型 描述
deleteAnimationScript

删除态势推演脚本

deleteLayer

删除标绘图层

deleteSymbol

删除标号

getAnimationScript

获取态势推演脚本

getLayer

获取标绘图层

getSymbol

获取标号

getSymbolLib

获取标号库列表

getSymbolLibList

获取标号库列表

queryAnimationScriptList

查询态势推演脚本列表

queryLayerList

获取标绘图层列表

queryServerInfo

获取服务信息,IGS2.0新增服务

updateAnimationScript

更新态势推演脚本

updateLayer

更新标绘图层

方法详情

# deleteAnimationScript(options)

删除态势推演脚本

参数

名称 类型 描述
options

查询参数

scriptId String

脚本id,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# deleteLayer(options)

删除标绘图层

参数

名称 类型 描述
options

查询参数

layerId String

图层id,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# deleteSymbol(options)

删除标号

参数

名称 类型 描述
options

查询参数

libId String

标号库id,必填

symbolId String

标号id,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# getAnimationScript(options)

获取态势推演脚本

参数

名称 类型 描述
options

查询参数

scriptId String

脚本id,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# getLayer(options)

获取标绘图层

参数

名称 类型 描述
options

查询参数

layerId String

图层id,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# getSymbol(options)

获取标号

参数

名称 类型 描述
options

查询参数

libId String

标号库id,必填

symbolId String

标号id,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# getSymbolLib(options)

获取标号库列表

参数

名称 类型 描述
options

查询参数

libId String

标号库id,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# getSymbolLibList(options)

获取标号库列表

参数

名称 类型 描述
options

查询参数

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# queryAnimationScriptList(options)

查询态势推演脚本列表

参数

名称 类型 描述
options

查询参数

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# queryLayerList(options)

获取标绘图层列表

参数

名称 类型 描述
options

查询参数

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

# queryServerInfo(options)

获取服务信息,IGS2.0新增服务

参数

名称 类型 默认值 描述
options

查询参数

success function æ— 

查询成功回调函数,若使用Promise方式则不必填写

failure function æ— 

查询失败回调函数,若使用Promise方式则不必填写

Inherited From:
示例

获取服务信息-回调方式

server.queryServerInfo({
  success: function (result) {
    console.log('请求成功:', result);
  },
  failure: function (result) {
    console.log('请求失败:', result);
  }
});

获取服务信息-promise方式

server.queryServerInfo({
})
.then(function (result) {
  console.log('请求成功:', result);
}).catch(function (result) {
  console.log('请求失败:', result);
});

# updateAnimationScript(options)

更新态势推演脚本

参数

名称 类型 描述
options

查询参数

scriptName String

脚本名称,必填

content String

脚本内容,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

scriptId String

脚本id

# updateLayer(options)

更新标绘图层

参数

名称 类型 描述
options

查询参数

layerName String

图层名称,必填

content FeatureSet

图层内容,必填

success function

查询成功回调函数,若使用Promise方式则不必填写

failure function

查询失败回调函数,若使用Promise方式则不必填写

layerId String

图层id