UNPKG

@mapgis/webclient-common

Version:

mapgis ES6 format for igserver

3,052 lines (1,183 loc) 47.7 kB
<header id="page-title" class="page-title"> <span class="page-title-main">类名</span> <span class="page-title-sub">ThemeServer</span> </header> <section> <article> <div class="container-overview"> <div class='vertical-section'> <div class="members"> <div class="member"> <h4 class="name" id="ThemeServer"> <a class="href-link" href="#ThemeServer">#</a> <span class="code-name" id="ThemeServer" style="font-size:30px"> new ThemeServer<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>专题图服务</p> </div> <h4>参数</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th class="last">描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"> Object </span> </td> <td class="description last"><p>构造参数</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>url</code></td> <td class="type"> <span class="param-type"> String </span> </td> <td class="description last"><p>服务基地址</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <h5>示例</h5> <pre class="prettyprint"><code>// ES5引入方式 const { ThemeServer } = zondy.service // ES6引入方式 import { ThemeServer } from "@mapgis/webclient-common" const themeServer = new ThemeServer({ url: 'http://192.168.82.89:6163/igs/rest/theme/Hubei4326' });</code></pre> </div> </div> </div> </div> <h3 class="subsection-title">继承关系</h3> <ul> <li><a link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html">BaseServer</a></li> </ul> <div class='vertical-section'> <h3 id='member'>成员变量</h3> <h4 style="margin-top: 20px;margin-bottom: 20px;">成员变量概述</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th>描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code><a href="#clientId">clientId</a></code></td> <td class="name"> <code> <span class="param-type"> Boolean </span> </code> </td> <td class="name"><code><p>客户端id</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#enableGlobeFetch">enableGlobeFetch</a></code></td> <td class="name"> <code> <span class="param-type"> Boolean </span> </code> </td> <td class="name"><code><p>是否使用确据唯一的fetch对象,默认为true,当设为false时,会使用自己私有的fetch对象,所有的请求设置不会影响全局</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#headers">headers</a></code></td> <td class="name"> <code> <span class="param-type"> String </span> </code> </td> <td class="name"><code><p>请求头参数</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#requestInterceptor">requestInterceptor</a></code></td> <td class="name"> <code> <span class="param-type"> function </span> </code> </td> <td class="name"><code><p>请求发送拦截器</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#requestTimeout">requestTimeout</a></code></td> <td class="name"> <code> <span class="param-type"> String </span> </code> </td> <td class="name"><code><p>请求超时时间,默认45000ms,即45s</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#responseInterceptor">responseInterceptor</a></code></td> <td class="name"> <code> <span class="param-type"> function </span> </code> </td> <td class="name"><code><p>请求响应拦截器</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#tokenAttachType">tokenAttachType</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="TokenAttachType.html" onclick="getTypeHTML(event)" href="global.html#TokenAttachType">TokenAttachType</a> </span> </code> </td> <td class="name"><code><p>指定token附加到何处</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#tokenKey">tokenKey</a></code></td> <td class="name"> <code> <span class="param-type"> String </span> </code> </td> <td class="name"><code><p>token名</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#tokenValue">tokenValue</a></code></td> <td class="name"> <code> <span class="param-type"> String </span> </code> </td> <td class="name"><code><p>token值</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#url">url</a></code></td> <td class="name"> <code> <span class="param-type"> String </span> </code> </td> <td class="name"><code><p>服务基地址</p></code></td> </tr> </tbody> </table> </div> <h4 style="margin-top: 20px;margin-bottom: 20px;">成员变量详情</h4> <div class="members"> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> Boolean </span> </span> <h4 class="name" id="clientId"> <a class="href-link" href="#clientId">#</a> <span class="code-name"> clientId </span> </h4> <div class="description"> <p>客户端id</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="clientId" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#clientId">BaseServer#clientId</a> </li></ul></dd> </dl> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> Boolean </span> </span> <h4 class="name" id="enableGlobeFetch"> <a class="href-link" href="#enableGlobeFetch">#</a> <span class="code-name"> enableGlobeFetch </span> </h4> <div class="description"> <p>是否使用确据唯一的fetch对象,默认为true,当设为false时,会使用自己私有的fetch对象,所有的请求设置不会影响全局</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="enableGlobeFetch" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#enableGlobeFetch">BaseServer#enableGlobeFetch</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置请求基地址 // 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;</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> String </span> </span> <h4 class="name" id="headers"> <a class="href-link" href="#headers">#</a> <span class="code-name"> headers </span> </h4> <div class="description"> <p>请求头参数</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="headers" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#headers">BaseServer#headers</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置请求头参数 // 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';</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> function </span> </span> <h4 class="name" id="requestInterceptor"> <a class="href-link" href="#requestInterceptor">#</a> <span class="code-name"> requestInterceptor </span> </h4> <div class="description"> <p>请求发送拦截器</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="requestInterceptor" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#requestInterceptor">BaseServer#requestInterceptor</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置拦截器,任何一个继承自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() {};</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> String </span> </span> <h4 class="name" id="requestTimeout"> <a class="href-link" href="#requestTimeout">#</a> <span class="code-name"> requestTimeout </span> </h4> <div class="description"> <p>请求超时时间,默认45000ms,即45s</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="requestTimeout" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#requestTimeout">BaseServer#requestTimeout</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置超时时间 //初始化AddressServer服务对象 // ES5引入方式 const { BaseServer } = zondy.service // ES6引入方式 import { BaseServer } from "@mapgis/webclient-common" let BaseServer = new BaseServer({ //超时时间 requestTimeout: 2000 }); //动态修改 BaseServer.requestTimeout = 3000;</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> function </span> </span> <h4 class="name" id="responseInterceptor"> <a class="href-link" href="#responseInterceptor">#</a> <span class="code-name"> responseInterceptor </span> </h4> <div class="description"> <p>请求响应拦截器</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="responseInterceptor" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#responseInterceptor">BaseServer#responseInterceptor</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置拦截器,任何一个继承自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() {};</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> <a link="TokenAttachType.html" onclick="getTypeHTML(event)" href="global.html#TokenAttachType">TokenAttachType</a> </span> </span> <h4 class="name" id="tokenAttachType"> <a class="href-link" href="#tokenAttachType">#</a> <span class="code-name"> tokenAttachType </span> </h4> <div class="description"> <p>指定token附加到何处</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="tokenAttachType" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#tokenAttachType">BaseServer#tokenAttachType</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置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;</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> String </span> </span> <h4 class="name" id="tokenKey"> <a class="href-link" href="#tokenKey">#</a> <span class="code-name"> tokenKey </span> </h4> <div class="description"> <p>token名</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="tokenKey" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#tokenKey">BaseServer#tokenKey</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置token名 // ES5引入方式 const { BaseServer } = zondy.service // ES6引入方式 import { BaseServer } from "@mapgis/webclient-common" let BaseServer = new BaseServer({ //token名 tokenKey: '你的tokenKey' }); //动态修改 BaseServer.tokenKey = '新tokenKey';</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> String </span> </span> <h4 class="name" id="tokenValue"> <a class="href-link" href="#tokenValue">#</a> <span class="code-name"> tokenValue </span> </h4> <div class="description"> <p>token值</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="tokenValue" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#tokenValue">BaseServer#tokenValue</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置token值 // ES5引入方式 const { BaseServer } = zondy.service // ES6引入方式 import { BaseServer } from "@mapgis/webclient-common" let BaseServer = new BaseServer({ //token值 tokenValue: '你的token值' }); //动态修改 BaseServer.tokenValue = '新token值';</code></pre> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> String </span> </span> <h4 class="name" id="url"> <a class="href-link" href="#url">#</a> <span class="code-name"> url </span> </h4> <div class="description"> <p>服务基地址</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="url" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#url">BaseServer#url</a> </li></ul></dd> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//设置请求基地址 // ES5引入方式 const { BaseServer } = zondy.service // ES6引入方式 import { BaseServer } from "@mapgis/webclient-common" let BaseServer = new BaseServer({ //请求基地址 url: '你的URL' }); //动态修改 BaseServer.url = '新URL';</code></pre> </div> </div> </div> <div class='vertical-section'> <h3 id='function'>方法</h3> <h4 style="margin-top: 20px;margin-bottom: 20px;">方法概述</h4> <div class="members"> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>返回值类型</th> <th>描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code><a href="#addTheme">addTheme</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>添加专题图</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#deleteTheme">deleteTheme</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>删除专题图</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#formatThemInfo">formatThemInfo</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>解析专题图信息</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#queryServerInfo">queryServerInfo</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>获取服务信息,IGS2.0新增服务</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#queryThemeInfo">queryThemeInfo</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>查询专题图参数</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#updateThemesInfo">updateThemesInfo</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>更新专题图</p></code></td> </tr> </tbody> </table> </div> <h4 style="margin-top: 20px;margin-bottom: 20px;">方法详情</h4> <div class="member"> <h4 class="name" id="addTheme"> <a class="href-link" href="#addTheme">#</a> <span class="code-name" id="addTheme" style="font-size:30px"> addTheme<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>添加专题图</p> </div> <h4>参数</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th class="last">描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"> Object </span> </td> <td class="description last"><p>查询参数</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>idxArr</code></td> <td class="type"> <span class="param-type"> String </span> </td> <td class="description last"><p>专题图索引(索引从0开始,例如:&quot;0,1,2/0,0,0&quot;):图层索引/专题图索引,必填</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>themeInfoArray</code></td> <td class="type"> <span class="param-type"> Array </span> </td> <td class="description last"><p>专题图参数,必填</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>success</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询成功回调</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>failure</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询失败回调</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <h5>示例</h5> <pre class="prettyprint"><code>//回调方式 // ES5引入方式 const { Theme } = zondy.object // ES6引入方式 import { Theme } from "@mapgis/webclient-common" //专题图信息数组 var themesInfoArr = []; //初始化Zondy.Object.Theme.ThemesInfo,用于设置需添加的专题相关信息 themesInfoArr[0] = new Theme.ThemesInfo(); //初始化指定图层的专题图信息对象,之后再给该数组赋值 themesInfoArr[0].LayerName = "湖北省市级区划2"; themesInfoArr[0].ThemeArr = []; //实例化CMultiClassTheme类 themesInfoArr[0].ThemeArr[0] = new Theme.CRangeTheme(); themesInfoArr[0].ThemeArr[0].Name = "分段专题图"; //指定为分段专题图 themesInfoArr[0].ThemeArr[0].IsBaseTheme = false; themesInfoArr[0].ThemeArr[0].Visible = true; themesInfoArr[0].ThemeArr[0].GeoInfoType = "Reg"; //未分段值的图形信息设置 themesInfoArr[0].ThemeArr[0].DefaultInfo = new Theme.CThemeInfo(); themesInfoArr[0].ThemeArr[0].DefaultInfo.Caption = "未分类"; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo = new Theme.CRegInfo(); themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.Ovprnt = true; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.Angle = 0; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.EndClr = 0; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.FillClr = 17; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.FillMode = 0; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.FullPatFlg = true; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.PatClr = 45; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.PatHeight = 5; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.PatWidth = 5; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.PatID = 0; themesInfoArr[0].ThemeArr[0].DefaultInfo.RegInfo.OutPenW = 1; //分段取值设置 themesInfoArr[0].ThemeArr[0].Expression = "GDP2016"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr = []; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[0] = new Theme.CRangeThemeInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[0].StartValue = "0"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[0].EndValue = "100"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[0].RegInfo = new Theme.CRegInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[0].RegInfo.FillClr = 110; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[1] = new Theme.CRangeThemeInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[1].StartValue = "100"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[1].EndValue = "150"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[1].RegInfo = new Theme.CRegInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[1].RegInfo.FillClr = 26; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[2] = new Theme.CRangeThemeInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[2].StartValue = "150"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[2].EndValue = "200"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[2].RegInfo = new Theme.CRegInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[2].RegInfo.FillClr = 22; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[3] = new Theme.CRangeThemeInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[3].StartValue = "200"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[3].EndValue = "400"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[3].RegInfo = new Theme.CRegInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[3].RegInfo.FillClr = 16; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[4] = new Theme.CRangeThemeInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[4].StartValue = "400"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[4].EndValue = "6000"; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[4].RegInfo = new Theme.CRegInfo(); themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[4].RegInfo.FillClr = 11; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[0].RegInfo.FillClr = 110; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[1].RegInfo.FillClr = 26; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[2].RegInfo.FillClr = 22; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[3].RegInfo.FillClr = 16; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[4].RegInfo.FillClr = 11; themeServer.addTheme({ idxArr: '1/0', themeInfoArray: themesInfoArr, success: function (result) { console.log('请求成功:', result); }, failure: function (result) { console.log('请求失败:', result); } }); //promise方式 themeServer.addTheme({ idxArr: '1/0', themeInfoArray: themesInfoArr }).then(function (result) { console.log('请求成功:', result); }).catch(function (result) { console.log('请求失败:', result); });</code></pre> </div> <div class="member"> <h4 class="name" id="deleteTheme"> <a class="href-link" href="#deleteTheme">#</a> <span class="code-name" id="deleteTheme" style="font-size:30px"> deleteTheme<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>删除专题图</p> </div> <h4>参数</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th class="last">描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"> Object </span> </td> <td class="description last"><p>查询参数</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>idxArr</code></td> <td class="type"> <span class="param-type"> String </span> </td> <td class="description last"><p>专题图索引(索引从0开始,例如:&quot;0,1,2/0,0,0&quot;):图层索引/专题图索引,必填</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>success</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询成功回调</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>failure</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询失败回调</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <h5>示例</h5> <pre class="prettyprint"><code>// 回调方式 themeServer.deleteTheme({ idxArr: '1/0', success: function (result) { console.log('请求成功:', result); }, failure: function (result) { console.log('请求失败:', result); } }); // promise方式 themeServer.deleteTheme({ idxArr: '1/0' }).then(function (result) { console.log('请求成功:', result); }).catch(function (result) { console.log('请求失败:', result); });</code></pre> </div> <div class="member"> <h4 class="name" id="formatThemInfo"> <a class="href-link" href="#formatThemInfo">#</a> <span class="code-name" id="formatThemInfo" style="font-size:30px"> formatThemInfo<span class="signature">(jsonObj)</span> </span> </h4> <div class="description"> <p>解析专题图信息</p> </div> <h4>参数</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th class="last">描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code>jsonObj</code></td> <td class="type"> <span class="param-type"> Object </span> </td> <td class="description last"><p>专题图信息Json对象</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="queryServerInfo"> <a class="href-link" href="#queryServerInfo">#</a> <span class="code-name" id="queryServerInfo" style="font-size:30px"> queryServerInfo<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>获取服务信息,IGS2.0新增服务</p> </div> <h4>参数</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th style="min-width: 100px;">默认值</th> <th class="last">描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code>options</code></td> <td class="type"> </td> <td class="default"> </td> <td class="description last"><p>查询参数</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>success</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="default"></td> <td class="description last"><p>查询成功回调函数,若使用Promise方式则不必填写</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>failure</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="default"></td> <td class="description last"><p>查询失败回调函数,若使用Promise方式则不必填写</p></td> </tr> </tbody> </table> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="queryServerInfo" link="BaseServer.html" onclick="getTypeHTML(event)" href="BaseServer.html#queryServerInfo">BaseServer#queryServerInfo</a> </li></ul></dd> </dl> <h5>示例</h5> <p class="code-caption"><h5>获取服务信息-回调方式</h5></p> <pre class="prettyprint"><code>server.queryServerInfo({ success: function (result) { console.log('请求成功:', result); }, failure: function (result) { console.log('请求失败:', result); } });</code></pre> <p class="code-caption"><h5>获取服务信息-promise方式</h5></p> <pre class="prettyprint"><code>server.queryServerInfo({ }) .then(function (result) { console.log('请求成功:', result); }).catch(function (result) { console.log('请求失败:', result); });</code></pre> </div> <div class="member"> <h4 class="name" id="queryThemeInfo"> <a class="href-link" href="#queryThemeInfo">#</a> <span class="code-name" id="queryThemeInfo" style="font-size:30px"> queryThemeInfo<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>查询专题图参数</p> </div> <h4>参数</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th class="last">描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"> Object </span> </td> <td class="description last"><p>查询参数</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>idxArr</code></td> <td class="type"> <span class="param-type"> String </span> </td> <td class="description last"><p>专题图索引(索引从0开始,例如:&quot;0,1,2/0,0,0&quot;):图层索引/专题图索引,必填</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>success</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询成功回调</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>failure</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询失败回调</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <h5>示例</h5> <pre class="prettyprint"><code>// 回调方式 themeServer.queryThemeInfo({ idxArr: '1/0', success: function (result) { console.log('请求成功:', result); } }); // promise方式 themeServer.queryThemeInfo({ idxArr: '1/0' }).then(function (result) { console.log('请求成功:', result); }).catch(function (result) { console.log('请求失败:', result); })</code></pre> </div> <div class="member"> <h4 class="name" id="updateThemesInfo"> <a class="href-link" href="#updateThemesInfo">#</a> <span class="code-name" id="updateThemesInfo" style="font-size:30px"> updateThemesInfo<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>更新专题图</p> </div> <h4>参数</h4> <div class="table-container"> <table class="params table"> <thead> <tr> <th>名称</th> <th>类型</th> <th class="last">描述</th> </tr> </thead> <tbody> <tr class="deep-level-0"> <td class="name"><code>options</code></td> <td class="type"> <span class="param-type"> Object </span> </td> <td class="description last"><p>查询参数</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>idxArr</code></td> <td class="type"> <span class="param-type"> String </span> </td> <td class="description last"><p>专题图索引(索引从0开始,例如:&quot;0,1,2/0,0,0&quot;):图层索引/专题图索引,必填</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>themeInfoArray</code></td> <td class="type"> <span class="param-type"> Array </span> </td> <td class="description last"><p>专题图参数,必填</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>success</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询成功回调</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>failure</code></td> <td class="type"> <span class="param-type"> function </span> </td> <td class="description last"><p>查询失败回调</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <h5>示例</h5> <pre class="prettyprint"><code>// 回调方式 // 更新专题图 themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[0].RegInfo.FillClr = 11; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[1].RegInfo.FillClr = 16; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[2].RegInfo.FillClr = 22; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[3].RegInfo.FillClr = 26; themesInfoArr[0].ThemeArr[0].RangeThemeInfoArr[4].RegInfo.FillClr = 110; themeServer.updateThemesInfo({ idxArr: '1/0', themeInfoArray: themesInfoArr, success: function (result) { console.log('请求成功:', result); }, failure: function (result) { console.log('请求失败:', result); } }); // promise方式 themeServer.updateThemesInfo({ idxArr: '1/0', themeInfoArray: themesInfoArr }).then(function (result) { console.log('请求成功:', result); }).catch(function (result) { console.log('请求失败:', result); })</code></pre> </div> </div> </div> </article> </section>