UNPKG

@mapgis/webclient-common

Version:

mapgis ES6 format for igserver

1,966 lines (682 loc) 30.4 kB
<header id="page-title" class="page-title"> <span class="page-title-main">类名</span> <span class="page-title-sub">IconSymbol3DLayer</span> </header> <section> <article> <div class="container-overview"> <div class='vertical-section'> <div class="members"> <div class="member"> <h4 class="name" id="IconSymbol3DLayer"> <a class="href-link" href="#IconSymbol3DLayer">#</a> <span class="code-name" id="IconSymbol3DLayer" style="font-size:30px"> new IconSymbol3DLayer<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>三维图标符号图层,用来在三维场景中绘制图标,不支持二维地图视图<br/> 支持使用网络图片资源或者使用系统自带的图标资源<br/> 是一个始终朝向屏幕,并且立起来的图标<br/> 示例如下:<br/> <a href='#IconSymbol3DLayer-href'>[1、使用网络资源创建一个三维图标图层对象]</a><br/> <a href='#IconSymbol3DLayer-primitive'>[2、使用系统自带资源创建一个三维图标图层对象]</a><br/></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"> <span class="param-type"> Object </span> </td> <td class="default"> </td> <td class="description last"><p>构造参数</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>resource</code></td> <td class="type"> <span class="param-type"> <a link="IconResource.html" onclick="getTypeHTML(event)" href="IconResource.html">IconResource</a> </span> </td> <td class="default"> new IconResource() </td> <td class="description last"><p>图标的资源,如果没有设置图标资源,则使用系统自带的图标;<br/> 系统支持的图标类型有:'circle'|'square'|'cross'|'x'|'kite'|'triangle'</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>size</code></td> <td class="type"> <span class="param-type"> Number </span> </td> <td class="default"> 1 </td> <td class="description last"><p>图标的大小,单位像素</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>material</code></td> <td class="type"> <span class="param-type"> <a link="ColorMaterial.html" onclick="getTypeHTML(event)" href="ColorMaterial.html">ColorMaterial</a> </span> </td> <td class="default"> new ColorMaterial() </td> <td class="description last"><p>材质,目前支持的材质有:<br/> ColorMaterial: 纯色材质,当图标的资源是网络图片时,指的是图标的覆盖物颜色,通过覆盖物颜色的透明度可以来更改图标的透明度;当图标的资源是是系统自带的图标时,指的是填充颜色</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>outline</code></td> <td class="type"> <span class="param-type"> <a link="PointSymbol3DOutline.html" onclick="getTypeHTML(event)" href="PointSymbol3DOutline.html">PointSymbol3DOutline</a> </span> </td> <td class="default"> new PointSymbol3DOutline() </td> <td class="description last"><p>外边线样式,仅当图标的资源是系统自带的图标时有效</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>anchor</code></td> <td class="type"> <span class="param-type"> <a link="AnchorType.html" onclick="getTypeHTML(event)" href="global.html#AnchorType">AnchorType</a> </span> </td> <td class="default"> AnchorType.center </td> <td class="description last"><p>锚点,指的图标相对于原始坐标点的位置</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>anchorPosition</code></td> <td class="type"> <span class="param-type"> <a link="Point.html" onclick="getTypeHTML(event)" href="Point.html">Point</a> </span> </td> <td class="default"> new Point({coordinates: [0, 0]}) </td> <td class="description last"><p>锚点相对偏移量,即屏幕像素偏移</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <p class="summary"><h5>支持如下方法:</h5> <a href='#fromJSON'>[1、通过json数据构造一个IconSymbol3DLayer对象]</a><br/> <a href='#toJSON'>[2、导出为json数据]</a><br/> <a href='#clone'>[3、克隆并返回一个新的IconSymbol3DLayer对象]</a><br/></p> <h5>示例</h5> <p class="code-caption"><h7 id='IconSymbol3DLayer-href'>使用网络资源创建一个三维图标图层对象</h7></p> <pre class="prettyprint"><code>// ES5引入方式 const { Color } = zondy const { IconSymbol3DLayer, IconResource } = zondy.symbol // ES6引入方式 import { IconSymbol3DLayer, IconResource, Color } from "@mapgis/webclient-common" // 创建三维图标符号图层 const iconSymbol3DLayer = new IconSymbol3DLayer({ // 设置资源地址 resource: new IconResource({ href: '图片的网络资源' }), // 设置图标大小,单位像素 size: 50 })</code></pre> <p class="code-caption"><h7 id='IconSymbol3DLayer-primitive'>使用系统自带资源创建一个三维图标图层对象</h7></p> <pre class="prettyprint"><code>// ES5引入方式 const { Color } = zondy const { IconSymbol3DLayer, IconResource } = zondy.symbol // ES6引入方式 import { IconSymbol3DLayer, IconResource, Color } from "@mapgis/webclient-common" // 创建三维图标符号图层 const iconSymbol3DLayer = new IconSymbol3DLayer({ // 设置资源地址 resource: new IconResource({ // 创建一个圆形图标 primitive: 'circle' }), // 设置图标大小,单位像素 size: 50 })</code></pre> </div> </div> </div> </div> <h3 class="subsection-title">继承关系</h3> <ul> <li><a link="Symbol3DLayer.html" onclick="getTypeHTML(event)" href="Symbol3DLayer.html">Symbol3DLayer</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="#anchor">anchor</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="AnchorType.html" onclick="getTypeHTML(event)" href="global.html#AnchorType">AnchorType</a> </span> </code> </td> <td class="name"><code><p>锚点,指的图标相对于原始坐标点的位置</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#anchorPosition">anchorPosition</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="Point.html" onclick="getTypeHTML(event)" href="Point.html">Point</a> </span> </code> </td> <td class="name"><code><p>锚点相对偏移量,即屏幕像素偏移</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#color">color</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="Color.html" onclick="getTypeHTML(event)" href="Color.html">Color</a> </span> </code> </td> <td class="name"><code><p>颜色</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#extensionOptions">extensionOptions</a></code></td> <td class="name"> <code> <span class="param-type"> Object </span> </code> </td> <td class="name"><code><p>符号的额外构造参数,该构造参数是地图引擎的额外构造参数,在此设置了之后,会覆盖该符号转换好地图引擎的构造参数</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#id">id</a></code></td> <td class="name"> <code> <span class="param-type"> String </span> </code> </td> <td class="name"><code><p>符号id</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#material">material</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="ColorMaterial.html" onclick="getTypeHTML(event)" href="ColorMaterial.html">ColorMaterial</a> </span> </code> </td> <td class="name"><code><p>材质</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#outline">outline</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="PointSymbol3DOutline.html" onclick="getTypeHTML(event)" href="PointSymbol3DOutline.html">PointSymbol3DOutline</a> </span> </code> </td> <td class="name"><code><p>外边线样式</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#resource">resource</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="IconResource.html" onclick="getTypeHTML(event)" href="IconResource.html">IconResource</a> </span> </code> </td> <td class="name"><code><p>图标的资源,如果没有设置图标资源,则使用系统自带的图标</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#size">size</a></code></td> <td class="name"> <code> <span class="param-type"> Number </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"> <a link="Symbol3DLayerType.html" onclick="getTypeHTML(event)" href="global.html#Symbol3DLayerType">Symbol3DLayerType</a> </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"> <a link="AnchorType.html" onclick="getTypeHTML(event)" href="global.html#AnchorType">AnchorType</a> </span> </span> <h4 class="name" id="anchor"> <a class="href-link" href="#anchor">#</a> <span class="code-name"> anchor </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"> <a link="Point.html" onclick="getTypeHTML(event)" href="Point.html">Point</a> </span> </span> <h4 class="name" id="anchorPosition"> <a class="href-link" href="#anchorPosition">#</a> <span class="code-name"> anchorPosition </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"> <a link="Color.html" onclick="getTypeHTML(event)" href="Color.html">Color</a> </span> </span> <h4 class="name" id="color"> <a class="href-link" href="#color">#</a> <span class="code-name"> color </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="color" link="Symbol.html" onclick="getTypeHTML(event)" href="Symbol.html#color">Symbol#color</a> </li></ul></dd> </dl> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> Object </span> </span> <h4 class="name" id="extensionOptions"> <a class="href-link" href="#extensionOptions">#</a> <span class="code-name"> extensionOptions </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="extensionOptions" link="Symbol.html" onclick="getTypeHTML(event)" href="Symbol.html#extensionOptions">Symbol#extensionOptions</a> </li></ul></dd> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"> <li>{}</li> </ul></dd> </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="id"> <a class="href-link" href="#id">#</a> <span class='tag'>readonly</span> <span class="code-name"> id </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="id" link="Symbol.html" onclick="getTypeHTML(event)" href="Symbol.html#id">Symbol#id</a> </li></ul></dd> </dl> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> <a link="ColorMaterial.html" onclick="getTypeHTML(event)" href="ColorMaterial.html">ColorMaterial</a> </span> </span> <h4 class="name" id="material"> <a class="href-link" href="#material">#</a> <span class="code-name"> material </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"> <a link="PointSymbol3DOutline.html" onclick="getTypeHTML(event)" href="PointSymbol3DOutline.html">PointSymbol3DOutline</a> </span> </span> <h4 class="name" id="outline"> <a class="href-link" href="#outline">#</a> <span class="code-name"> outline </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"> <a link="IconResource.html" onclick="getTypeHTML(event)" href="IconResource.html">IconResource</a> </span> </span> <h4 class="name" id="resource"> <a class="href-link" href="#resource">#</a> <span class="code-name"> resource </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"> Number </span> </span> <h4 class="name" id="size"> <a class="href-link" href="#size">#</a> <span class="code-name"> size </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"> <a link="Symbol3DLayerType.html" onclick="getTypeHTML(event)" href="global.html#Symbol3DLayerType">Symbol3DLayerType</a> </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"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Symbol3DLayer.html#type">Symbol3DLayer#type</a> </li></ul></dd> </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="LineCallout3D.html" onclick="getTypeHTML(event)" href="LineCallout3D.html">LineCallout3D</a> </span> </code> </td> <td class="name"><code></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="IconSymbol3DLayer.html" onclick="getTypeHTML(event)" href="IconSymbol3DLayer.html">IconSymbol3DLayer</a> </span> </code> </td> <td class="name"><code></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></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">(json)</span> </span> </h4> <div class="description"> <a id='fromJSON'/> 通过json数据构造一个IconSymbol3DLayer对象 </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>json</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 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>新的IconSymbol3DLayer对象</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type"> <a link="LineCallout3D.html" onclick="getTypeHTML(event)" href="LineCallout3D.html">LineCallout3D</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"> <a id='clone'/> 克隆并返回一个新的IconSymbol3DLayer对象 </div> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Symbol3DLayer.html#clone">Symbol3DLayer#clone</a> </li></ul></dd> </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>新的IconSymbol3DLayer对象</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type"> <a link="IconSymbol3DLayer.html" onclick="getTypeHTML(event)" href="IconSymbol3DLayer.html">IconSymbol3DLayer</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"> <a id='toJSON'/> 导出为json数据 </div> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="Symbol3DLayer.html#toJSON">Symbol3DLayer#toJSON</a> </li></ul></dd> </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>