@mapgis/webclient-common
Version:
mapgis ES6 format for igserver
1,187 lines (407 loc) • 16.4 kB
HTML
<header id="page-title" class="page-title">
<span class="page-title-main">类名</span>
<span class="page-title-sub">VisualVariable</span>
</header>
<section>
<article>
<div class="container-overview">
<div class='vertical-section'>
<div class="members">
<div class="member">
<h4 class="name" id="VisualVariable">
<a class="href-link" href="#VisualVariable">#</a>
<span class="code-name" id="VisualVariable" style="font-size:30px">
new VisualVariable<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>field</code></td>
<td class="type">
<span class="param-type">
String
</span>
</td>
<td class="description last"><p>视觉变量字段</p></td>
</tr>
<tr class="deep-level-1">
<td class="name"><code>valueExpression</code></td>
<td class="type">
<span class="param-type">
String
</span>
</td>
<td class="description last"><p>字段表达式</p></td>
</tr>
<tr class="deep-level-1">
<td class="name"><code>valueExpressionTitle</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>
<p class="code-caption">支持的视觉变量</p>
<pre class="prettyprint"><code><a href="ColorVariable.html"><code>1、color视觉变量</code></a>
<a href="OpacityVariable.html"><code>2、opactiy视觉变量</code></a>
<a href="SizeVariable.html"><code>3、size视觉变量</code></a></code></pre>
<p class="code-caption">多个视觉变量叠加</p>
<pre class="prettyprint"><code>// 从图层上获取renderer
const renderer = layer.renderer
// 设置多个视觉变量。
// 需要注意相同视觉变量作用效果一致,按照加入顺序会覆盖前面的效果。
// 颜色视觉变量和透明度视觉变量同时作用时,需要将颜色视觉变量放于透明度视觉变量之前。
renderer.visualVariables = [
{
type: "color",
valueExpression: "$feature.FID",
stops: [
{
color: "#FFFCD4",
value: 0,
},
{
color: "#350242",
value: 200,
},
],
},
{
type: "size",
valueExpression: "$feature.FID",
stops:[
{
size:5,
value:0
},
{
size:20,
value:300
}
]
},
{
type: "opacity",
valueExpression: "$feature.FID",
stops: [
{
opacity: 0.2,
value: 0,
},
{
opacity: 1.0,
value:300,
}
],
}
]</code></pre>
</div>
</div>
</div>
</div>
<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="#field">field</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="#type">type</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="#valueExpression">valueExpression</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="#valueExpressionTitle">valueExpressionTitle</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">
String
</span>
</span>
<h4 class="name" id="field">
<a class="href-link" href="#field">#</a>
<span class="code-name">
field
</span>
</h4>
<div class="description">
<p>视觉变量字段</p>
</div>
<dl class="details">
</dl>
</div>
<div class="member">
<span class="method-parameter is-pulled-right">
<label>类型:</label>
<span class="param-type">
String
</span>
</span>
<h4 class="name" id="type">
<a class="href-link" href="#type">#</a>
<span class="code-name">
type
</span>
</h4>
<div class="description">
<p>视觉变量默认类型</p>
</div>
<dl class="details">
</dl>
</div>
<div class="member">
<span class="method-parameter is-pulled-right">
<label>类型:</label>
<span class="param-type">
String
</span>
</span>
<h4 class="name" id="valueExpression">
<a class="href-link" href="#valueExpression">#</a>
<span class="code-name">
valueExpression
</span>
</h4>
<div class="description">
<p>视觉变量字段表达式</p>
</div>
<dl class="details">
</dl>
</div>
<div class="member">
<span class="method-parameter is-pulled-right">
<label>类型:</label>
<span class="param-type">
String
</span>
</span>
<h4 class="name" id="valueExpressionTitle">
<a class="href-link" href="#valueExpressionTitle">#</a>
<span class="code-name">
valueExpressionTitle
</span>
</h4>
<div class="description">
<p>字段表达式标题</p>
</div>
<dl class="details">
</dl>
</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="#fromJSON">fromJSON</a></code></td>
<td class="name">
<code>
<span class="param-type">
<a link="VisualVariable.html" onclick="getTypeHTML(event)" href="VisualVariable.html">VisualVariable</a>
</span>
</code>
</td>
<td class="name"><code><p>通过json构造VisualVariable对象</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#clone">clone</a></code></td>
<td class="name">
<code>
<span class="param-type">
<a link="VisualVariable.html" onclick="getTypeHTML(event)" href="VisualVariable.html">VisualVariable</a>
</span>
</code>
</td>
<td class="name"><code><p>克隆对象</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#toJSON">toJSON</a></code></td>
<td class="name">
<code>
<span class="param-type">
Object
</span>
</code>
</td>
<td class="name"><code><p>导出为json对象</p></code></td>
</tr>
</tbody>
</table>
</div>
<h4 style="margin-top: 20px;margin-bottom: 20px;">方法详情</h4>
<div class="member">
<h4 class="name" id=".fromJSON">
<a class="href-link" href="#.fromJSON">#</a>
<span class='tag'>static</span>
<span class="code-name" id="fromJSON" style="font-size:30px">
fromJSON<span class="signature">()</span>
</span>
</h4>
<div class="description">
<p>通过json构造VisualVariable对象</p>
</div>
<dl class="details">
</dl>
<div class='columns method-parameter'>
<div class="column is-2"><label>返回值</label></div>
<div class="column is-10">
<div class="columns">
<div class='param-desc column is-7'><p>json对象</p></div>
<div class='column is-5 has-text-left'>
<label>类型: </label>
<span class="param-type">
<a link="VisualVariable.html" onclick="getTypeHTML(event)" href="VisualVariable.html">VisualVariable</a>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="member">
<h4 class="name" id="clone">
<a class="href-link" href="#clone">#</a>
<span class="code-name" id="clone" style="font-size:30px">
clone<span class="signature">()</span>
</span>
</h4>
<div class="description">
<p>克隆对象</p>
</div>
<dl class="details">
</dl>
<div class='columns method-parameter'>
<div class="column is-2"><label>返回值</label></div>
<div class="column is-10">
<div class="columns">
<div class='param-desc column is-7'><p>克隆后的VisualVariable对象</p></div>
<div class='column is-5 has-text-left'>
<label>类型: </label>
<span class="param-type">
<a link="VisualVariable.html" onclick="getTypeHTML(event)" href="VisualVariable.html">VisualVariable</a>
</span>
</div>
</div>
</div>
</div>
</div>
<div class="member">
<h4 class="name" id="toJSON">
<a class="href-link" href="#toJSON">#</a>
<span class="code-name" id="toJSON" style="font-size:30px">
toJSON<span class="signature">()</span>
</span>
</h4>
<div class="description">
<p>导出为json对象</p>
</div>
<dl class="details">
</dl>
<div class='columns method-parameter'>
<div class="column is-2"><label>返回值</label></div>
<div class="column is-10">
<div class="columns">
<div class='param-desc column is-7'><p>json对象</p></div>
<div class='column is-5 has-text-left'>
<label>类型: </label>
<span class="param-type">
Object
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</article>
</section>