UNPKG

@mapgis/webclient-common

Version:

mapgis ES6 format for igserver

1,515 lines (596 loc) 25.4 kB
<header id="page-title" class="page-title"> <span class="page-title-main">类名</span> <span class="page-title-sub">IGSVectorTileSubLayer</span> </header> <section> <article> <div class="container-overview"> <div class='vertical-section'> <div class="members"> <div class="member"> <h4 class="name" id="IGSVectorTileSubLayer"> <a class="href-link" href="#IGSVectorTileSubLayer">#</a> <span class="code-name" id="IGSVectorTileSubLayer" style="font-size:30px"> new IGSVectorTileSubLayer<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>IGS矢量瓦片子图层</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>renderer</code></td> <td class="type"> <span class="param-type"> <a link="BaseRenderer.html" onclick="getTypeHTML(event)" href="BaseRenderer.html">BaseRenderer</a> </span> </td> <td class="default"> </td> <td class="description last"><p>专题图渲染样式对象,支持如下渲染样式:<br/> <a href="UniqueValueRenderer.html"><code>1、单值渲染</code></a><br/> <a href="ClassBreakRenderer.html"><code>2、分段渲染</code></a><br/> <a href="SimpleRenderer.html"><code>3、统一专题图</code></a><br/> 示例请参考<a href="IGSVectorTileLayer.html"><code>IGSVectorTileLayer</code></a></p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>id</code></td> <td class="type"> <span class="param-type"> String </span> </td> <td class="default"> </td> <td class="description last"><p>矢量瓦片子图层的id,当加载MapGIS制作并由IGS发布的矢量瓦片时,如果矢量瓦片样式中有mapinfo参数,则子图层ID对应的是MapX中的图层索引; 如果没有mapinfo参数,则子图层ID对应的是矢量瓦片样式图层ID;当加载第三方发布的矢量瓦片时,子图层ID对应的是矢量瓦片样式图层ID;</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>title</code></td> <td class="type"> <span class="param-type"> String </span> </td> <td class="default"> </td> <td class="description last"><p>矢量瓦片子图层的标题</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>styleLayers</code></td> <td class="type"> <span class="param-type"> Array.&lt;Object> </span> </td> <td class="default"> </td> <td class="description last"><p>矢量瓦片子图层关联的矢量瓦片样式图层数组</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>visible</code></td> <td class="type"> <span class="param-type"> Boolean </span> </td> <td class="default"> true </td> <td class="description last"><p>图层可见性</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>layer</code></td> <td class="type"> <span class="param-type"> <a link="IGSVectorTileLayer.html" onclick="getTypeHTML(event)" href="IGSVectorTileLayer.html">IGSVectorTileLayer</a> </span> </td> <td class="default"> </td> <td class="description last"><p>矢量瓦片父图层</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>labelingInfo</code></td> <td class="type"> <span class="param-type"> Array.&lt;<a onclick="getTypeHTML(event)" link="LabelClass.html">LabelClass</a>> </span> </td> <td class="default"> [] </td> <td class="description last"><p>仅当IGSVectorTileLayer图层的labelsRenderMode参数设置非'off-screen'属性时生效<br> 为性能考虑,当前所有子图层labelingInfo内的LabelClass必须保证其renderMode参数一致,不支持renderMode同时设置label或canvas两种模式<br> 三维注记目前不支持修改透明度和显隐参数<br> 参考示例:<a href='#labels-3d'>[矢量瓦片三维注记]</a><a href='#labels-change'>[切换三维注记样式]</a><br/></p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <h5>示例</h5> <p class="code-caption"><h7 id='labels-3d'>矢量瓦片三维注记</h7></p> <pre class="prettyprint"><code>// ES5引入方式 const { LabelClass } = zondy const { IGSVectorTileLayer } = zondy.layer // ES6引入方式 import { IGSVectorTileLayer, LabelClass } from "@mapgis/webclient-common" // 初始化一个额外的图标DOM对象 const iconImage = new Image() iconImage.src = '图片地址或者base64字符串' // 初始化矢量瓦片图层 const igsVectorTileLayer = new IGSVectorTileLayer({ // 矢量瓦片基地址 url: '', // 开启三维注记 labelsRenderMode: 'on-screen', // 设置要应用三维主句的子图层 sublayers: [{ // 矢量瓦片子图层id id: '矢量瓦片子图层id', // 注记参数,目前仅用填写一个 labelingInfo: [ new LabelClass({ symbol: { // 填充颜色 rgba or 16进制颜色 color: 'rgba(255,255,255,1)', // 描边颜色 haloColor: 'rgba(0,0,0,0.5)', // 描边宽度 haloSize: 2, // 行高 lineHeight: 1.1, // 文本间距 letterSpacing: 2, // 字体样式 参考css font: { size: 14, family: '微软雅黑', weight: 'normal', style: 'normal' }, // 额外的图标 textExtraIcon: iconImage, // 图标的大小 textExtraIconSize:20, // 图标方位 textExtraIconAnchor:'left' }, // 渲染方式 1.canvas 2.label 3.ground renderMode: 'canvas', // 最大可见范围 minScale: 60000000, // 最小可见范围 maxScale: 1, // 布局位置 可选 1.above-left 2.above-center 3.above-right 4.center-left 5.center-center 6.center-right 7.below-left 8.below-center 9.below-right labelPlacement: 'above-center', // 高程采样参数 elevationInfo: { mode: 'OnTheGround', offset: 0 } }) ] }] });</code></pre> <p class="code-caption"><h7 id='labels-change'>切换三维注记样式</h7></p> <pre class="prettyprint"><code>// ES5引入方式 const { LabelClass } = zondy // ES6引入方式 import { LabelClass } from "@mapgis/webclient-common" // 初始化一个额外的图标DOM对象 const iconImage = new Image() iconImage.src = '图片地址或者base64字符串' // 获取矢量瓦片子图层 const sublayer = igsVectorTileLayer.findSublayerById('子图层id') // 设置一个新的矢量瓦片三维注记参数 sublayer.labelingInfo = [ new LabelClass({ symbol: { // 填充颜色 rgba or 16进制颜色 color: 'rgba(1,255,1,1)', // 描边颜色 haloColor: 'rgba(0,0,0,0.5)', // 描边宽度 haloSize: 2, // 行高 lineHeight: 1.1, // 文本间距 letterSpacing: 2, // 字体样式 参考css font: { size: 14, family: '微软雅黑', weight: 'normal', style: 'normal' }, // 额外的图标 textExtraIcon: iconImage, // 图标的大小 textExtraIconSize:20, // 图标方位 textExtraIconAnchor:'left' }, // 渲染方式 1.canvas 2.label 3.ground renderMode: 'canvas', // 最大可见范围 minScale: 60000000, // 最小可见范围 maxScale: 1, // 布局位置 可选 1.above-left 2.above-center 3.above-right 4.center-left 5.center-center 6.center-right 7.below-left 8.below-center 9.below-right labelPlacement: 'above-center', // 高程采样参数 elevationInfo: { mode: 'OnTheGround', offset: 0 } }) ]</code></pre> </div> </div> </div> </div> <h3 class="subsection-title">继承关系</h3> <ul> <li><a link="VectorTileSubLayer.html" onclick="getTypeHTML(event)" href="VectorTileSubLayer.html">VectorTileSubLayer</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="#labelingInfo">labelingInfo</a></code></td> <td class="name"> <code> <span class="param-type"> Array.&lt;<a onclick="getTypeHTML(event)" link="LabelClass.html">LabelClass</a>> </span> </code> </td> <td class="name"><code><p>三维注记参数,仅当igs矢量瓦片图层labelsRenderMode设置非'off-screen'属性时生效。为性能考虑,当前所有子图层labelingInfo内labelClass必须保证renderMode一致,不支持同时设置label或canvas两种形式。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#renderer">renderer</a></code></td> <td class="name"> <code> <span class="param-type"> <a link="UniqueValueRenderer.html" onclick="getTypeHTML(event)" href="UniqueValueRenderer.html">UniqueValueRenderer</a> </span> | <span class="param-type"> <a link="ClassBreakRenderer.html" onclick="getTypeHTML(event)" href="ClassBreakRenderer.html">ClassBreakRenderer</a> </span> | <span class="param-type"> <a link="SimpleRenderer.html" onclick="getTypeHTML(event)" href="SimpleRenderer.html">SimpleRenderer</a> </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="#visible">visible</a></code></td> <td class="name"> <code> <span class="param-type"> Boolean </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"> Array.&lt;<a onclick="getTypeHTML(event)" link="LabelClass.html">LabelClass</a>> </span> </span> <h4 class="name" id="labelingInfo"> <a class="href-link" href="#labelingInfo">#</a> <span class="code-name"> labelingInfo </span> </h4> <div class="description"> <p>三维注记参数,仅当igs矢量瓦片图层labelsRenderMode设置非'off-screen'属性时生效。为性能考虑,当前所有子图层labelingInfo内labelClass必须保证renderMode一致,不支持同时设置label或canvas两种形式。</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="labelingInfo" link="VectorTileSubLayer.html" onclick="getTypeHTML(event)" href="VectorTileSubLayer.html#labelingInfo">VectorTileSubLayer#labelingInfo</a> </li></ul></dd> </dl> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"> <a link="UniqueValueRenderer.html" onclick="getTypeHTML(event)" href="UniqueValueRenderer.html">UniqueValueRenderer</a> </span> | <span class="param-type"> <a link="ClassBreakRenderer.html" onclick="getTypeHTML(event)" href="ClassBreakRenderer.html">ClassBreakRenderer</a> </span> | <span class="param-type"> <a link="SimpleRenderer.html" onclick="getTypeHTML(event)" href="SimpleRenderer.html">SimpleRenderer</a> </span> </span> <h4 class="name" id="renderer"> <a class="href-link" href="#renderer">#</a> <span class="code-name"> renderer </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="renderer" link="VectorTileSubLayer.html" onclick="getTypeHTML(event)" href="VectorTileSubLayer.html#renderer">VectorTileSubLayer#renderer</a> </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="type"> <a class="href-link" href="#type">#</a> <span class='tag'>readonly</span> <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="VectorTileSubLayer.html#type">VectorTileSubLayer#type</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="visible"> <a class="href-link" href="#visible">#</a> <span class="code-name"> visible </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="visible" link="VectorTileSubLayer.html" onclick="getTypeHTML(event)" href="VectorTileSubLayer.html#visible">VectorTileSubLayer#visible</a> </li></ul></dd> <dt class="tag-default">Default Value:</dt> <dd class="tag-default"><ul class="dummy"> <li>true</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> </code> </td> <td class="name"><code><p>通过json对象初始化该对象</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="IGSVectorTileSubLayer.html" onclick="getTypeHTML(event)" href="IGSVectorTileSubLayer.html">IGSVectorTileSubLayer</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">(json)</span> </span> </h4> <div class="description"> <p>通过json对象初始化该对象</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>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>IGSVectorTileSubLayer 新的IGSVectorTileSubLayer图层对象</p></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"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="VectorTileSubLayer.html#clone">VectorTileSubLayer#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>克隆后的图层对象</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type"> <a link="IGSVectorTileSubLayer.html" onclick="getTypeHTML(event)" href="IGSVectorTileSubLayer.html">IGSVectorTileSubLayer</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"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="toJSON" link="VectorTileSubLayer.html" onclick="getTypeHTML(event)" href="VectorTileSubLayer.html#toJSON">VectorTileSubLayer#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>