UNPKG

@mapgis/webclient-leaflet-plugin

Version:

开发时需要引入MapGIS Client for JavaScript(Leaflet)开发包;其中包括必备的 CSS 文件和 JS 文件;

3,556 lines (1,140 loc) 83.2 kB
<header id="page-title" class="page-title"> <span class="page-title-main">类名</span> <span class="page-title-sub">GraphThemeLayer</span> </header> <section> <article> <div class="container-overview"> <div class='vertical-section'> <div class="members"> <div class="member"> <h4 class="name" id="GraphThemeLayer"> <a class="href-link" href="#GraphThemeLayer">#</a> <span class="code-name" id="GraphThemeLayer" style="font-size:30px"> new GraphThemeLayer<span class="signature">(name, chartsType, options)</span> </span> </h4> <div class="description"> <p>统计专题图通过为每个要素绘制统计图表来反映其对应的专题值的大小。它可同时表示多个字段属性信息,在区域本身与各区域之间形成横向和纵向的对比。<br>统计专题图多用于具有相关数量特征的地图上,比如表示不同地区多年的粮食产量、GDP、人口等,不同时段客运量、地铁流量等。目前提供的统计图类型有:柱状图(Bar),折线图(Line),饼图(Pie),三维柱状图(Bar3D),点状图(Point),环状图(Ring)。</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>name</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-0"> <td class="name"><code>chartsType</code></td> <td class="type"> <span class="param-type"> string </span> </td> <td class="default"> </td> <td class="description last"><p>图表类型。目前可用:&quot;Bar&quot;,&quot;Bar3D&quot;,&quot;Line&quot;,&quot;Point&quot;,&quot;Pie&quot;,&quot;Ring&quot;。</p></td> </tr> <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>isOverLay</code></td> <td class="type"> <span class="param-type"> boolean </span> </td> <td class="default"> true </td> <td class="description last"><p>是否进行压盖处理,如果设为 true,图表绘制过程中将隐藏对已在图层中绘制的图表产生压盖的图表。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>themeFields</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>cache</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>charts</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>id</code></td> <td class="type"> <span class="param-type"> string </span> </td> <td class="default"> </td> <td class="description last"><p>专题图层 ID。默认使用 CommonUtil.createUniqueID(&quot;themeLayer_&quot;) 创建专题图层 ID。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>opacity</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>chartsSetting</code></td> <td class="type"> <span class="param-type"> Object </span> </td> <td class="default"> </td> <td class="description last"><p>各类型图表的 chartsSetting 对象可设属性请参考具体图表模型类的注释中对 chartsSetting 对象可设属性的描述。chartsSetting 对象通常都具有以下 5 个基础可设属性:</br></p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>chartsSetting.width</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="default"> </td> <td class="description last"><p>专题要素(图表)宽度。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>chartsSetting.height</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="default"> </td> <td class="description last"><p>专题要素(图表)高度。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>chartsSetting.codomain</code></td> <td class="type"> <span class="param-type"> Array.&lt;number> </span> </td> <td class="default"> </td> <td class="description last"><p>值域,长度为 2 的一维数组,第一个元素表示值域下限,第二个元素表示值域上限。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>chartsSetting.XOffset</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="default"> </td> <td class="description last"><p>专题要素(图表)在 X 方向上的偏移值,单位像素。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>chartsSetting.YOffset</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="default"> </td> <td class="description last"><p>专题要素(图表)在 Y 方向上的偏移值,单位像素。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>chartsSetting.dataViewBoxParameter</code></td> <td class="type"> <span class="param-type"> Array.&lt;number> </span> </td> <td class="default"> </td> <td class="description last"><p>数据视图框 dataViewBox 参数,它是指图表框 chartBox (由图表位置、图表宽度、图表高度构成的图表范围框)在左、下,右,上四个方向上的内偏距值,长度为 4 的一维数组。</p></td> </tr> <tr class="deep-level-1"> <td class="name"><code>chartsSetting.decimalNumber</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="default"> </td> <td class="description last"><p>数据值数组 dataValues 元素值小数位数,数据的小数位处理参数,取值范围:[0, 16]。如果不设置此参数,在取数据值时不对数据做小数位处理。</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> </div> </div> </div> </div> <h3 class="subsection-title">继承关系</h3> <ul> <li><a link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html">zondy.themelayer.ThemeLayer</a></li> </ul> <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="#addFeatures">addFeatures</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="#clear">clear</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>清除图层。清除的内容包括数据(features) 、专题要素、缓存。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#clearCache">clearCache</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>判断图表是否大小合适,超过地图范围的1/4的不绘制。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#clearCache">clearCache</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="#createThematicFeature">createThematicFeature</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="#destroyFeatures">destroyFeatures</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="#drawCharts">drawCharts</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="#getEvents">getEvents</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="#getFeatureBy">getFeatureBy</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,返回此 feature(并且只返回第一个)。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getFeatureById">getFeatureById</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>通过给定一个 ID,返回对应的矢量要素,如果不存在则返回 null。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getFeatures">getFeatures</a></code></td> <td class="name"> <code> <span class="param-type"> Array </span> </code> </td> <td class="name"><code><p>查看当前图层中的有效数据。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getFeaturesByAttribute">getFeaturesByAttribute</a></code></td> <td class="name"> <code> <span class="param-type"> Array </span> </code> </td> <td class="name"><code><p>通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getLocalXY">getLocalXY</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="#getShapesByFeatureID">getShapesByFeatureID</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getWeightFieldValue">getWeightFieldValue</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="#initialize">initialize</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="#isChartInMap">isChartInMap</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="#isPointInPoly">isPointInPoly</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="#isQuadrilateralOverLap">isQuadrilateralOverLap</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="#lineIntersection">lineIntersection</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="#off">off</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="#on">on</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="#onRemove">onRemove</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="#redraw">redraw</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>重绘该图层,成功则返回 true,否则返回 false。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#redrawThematicFeatures">redrawThematicFeatures</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="#removeAllFeatures">removeAllFeatures</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="#removeFeatures">removeFeatures</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>从专题图中删除 feature。这个函数删除所有传递进来的矢量要素(数据)。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#setChartsType">setChartsType</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>设置图表类型,此函数可动态改变图表类型。在调用此函数前请通过 chartsSetting 为新类型的图表做相关配置。图表类型,目前支持:&quot;Bar&quot;, &quot;Bar3D&quot;, &quot;Line&quot;,&quot;Point&quot;,&quot;Pie&quot;,&quot;Ring&quot;。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#setOpacity">setOpacity</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>设置图层的不透明度,取值 [0-1] 之间。</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#update">update</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="addFeatures"> <a class="href-link" href="#addFeatures">#</a> <span class="code-name" id="addFeatures" style="font-size:30px"> addFeatures<span class="signature">(features)</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>features</code></td> <td class="type"> <span class="param-type"> L.features </span> </td> <td class="description last"><p>待添加的要素。</p></td> </tr> </tbody> </table> </div> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a href="zondy.themelayer.ThemeLayer.html#addFeatures">zondy.themelayer.ThemeLayer#addFeatures</a> </li></ul></dd> </dl> </div> <div class="member"> <h4 class="name" id="clear"> <a class="href-link" href="#clear">#</a> <span class="code-name" id="clear" style="font-size:30px"> clear<span class="signature">()</span> </span> </h4> <div class="description"> <p>清除图层。清除的内容包括数据(features) 、专题要素、缓存。</p> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="clearCache"> <a class="href-link" href="#clearCache">#</a> <span class="code-name" id="clearCache" style="font-size:30px"> clearCache<span class="signature">(mapPxBounds, chartPxBounds)</span> </span> </h4> <div class="description"> <p>判断图表是否大小合适,超过地图范围的1/4的不绘制。</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>mapPxBounds</code></td> <td class="type"> <span class="param-type"> zondy.Bounds </span> </td> <td class="description last"><p>地图像素范围。</p></td> </tr> <tr class="deep-level-0"> <td class="name"><code>chartPxBounds</code></td> <td class="type"> <span class="param-type"> Array.&lt;Object> </span> </td> <td class="description last"><p>图表范围的四边形节点数组。<br> 例如:[{&quot;x&quot;:1,&quot;y&quot;:1},{&quot;x&quot;:3,&quot;y&quot;:1},{&quot;x&quot;:6,&quot;y&quot;:4},{&quot;x&quot;:2,&quot;y&quot;:10},{&quot;x&quot;:1,&quot;y&quot;:1}]。</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="clearCache"> <a class="href-link" href="#clearCache">#</a> <span class="code-name" id="clearCache" style="font-size:30px"> clearCache<span class="signature">()</span> </span> </h4> <div class="description"> <p>清除缓存数据。</p> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="createThematicFeature"> <a class="href-link" href="#createThematicFeature">#</a> <span class="code-name" id="createThematicFeature" style="font-size:30px"> createThematicFeature<span class="signature">(feature)</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>feature</code></td> <td class="type"> <span class="param-type"> zondy.Feature </span> </td> <td class="description last"><p>待创建的要素。</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="destroyFeatures"> <a class="href-link" href="#destroyFeatures">#</a> <span class="code-name" id="destroyFeatures" style="font-size:30px"> destroyFeatures<span class="signature">(features)</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>features</code></td> <td class="type"> <span class="param-type"> Array.&lt;zondy.Feature.Vector> </span> </td> <td class="description last"><p>将被销毁的要素。</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="destroyFeatures" link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html#destroyFeatures">zondy.themelayer.ThemeLayer#destroyFeatures</a> </li></ul></dd> </dl> </div> <div class="member"> <h4 class="name" id="drawCharts"> <a class="href-link" href="#drawCharts">#</a> <span class="code-name" id="drawCharts" style="font-size:30px"> drawCharts<span class="signature">()</span> </span> </h4> <div class="description"> <p>绘制图表。包含压盖处理。</p> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="getEvents"> <a class="href-link" href="#getEvents">#</a> <span class="code-name" id="getEvents" style="font-size:30px"> getEvents<span class="signature">()</span> </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="getEvents" link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html#getEvents">zondy.themelayer.ThemeLayer#getEvents</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"> Object </span> </div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="getFeatureBy"> <a class="href-link" href="#getFeatureBy">#</a> <span class="code-name" id="getFeatureBy" style="font-size:30px"> getFeatureBy<span class="signature">(property, value)</span> </span> </h4> <div class="description"> <p>在专题图的要素数组 features 里面遍历每一个 feature,当 feature[property] === value 时,返回此 feature(并且只返回第一个)。</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>property</code></td> <td class="type"> <span class="param-type"> string </span> </td> <td class="description last"><p>要的某个属性名。</p></td> </tr> <tr class="deep-level-0"> <td class="name"><code>value</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"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="getFeatureBy" link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html#getFeatureBy">zondy.themelayer.ThemeLayer#getFeatureBy</a> </li></ul></dd> </dl> </div> <div class="member"> <h4 class="name" id="getFeatureById"> <a class="href-link" href="#getFeatureById">#</a> <span class="code-name" id="getFeatureById" style="font-size:30px"> getFeatureById<span class="signature">(featureId)</span> </span> </h4> <div class="description"> <p>通过给定一个 ID,返回对应的矢量要素,如果不存在则返回 null。</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>featureId</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="description last"><p>要素 ID。</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="getFeatureById" link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html#getFeatureById">zondy.themelayer.ThemeLayer#getFeatureById</a> </li></ul></dd> </dl> </div> <div class="member"> <h4 class="name" id="getFeatures"> <a class="href-link" href="#getFeatures">#</a> <span class="code-name" id="getFeatures" style="font-size:30px"> getFeatures<span class="signature">()</span> </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="getFeatures" link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html#getFeatures">zondy.themelayer.ThemeLayer#getFeatures</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"> Array </span> </div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="getFeaturesByAttribute"> <a class="href-link" href="#getFeaturesByAttribute">#</a> <span class="code-name" id="getFeaturesByAttribute" style="font-size:30px"> getFeaturesByAttribute<span class="signature">(attrName, attrValue)</span> </span> </h4> <div class="description"> <p>通过给定一个属性的 key 值和 value 值,返回所有匹配的要素数组。</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>attrName</code></td> <td class="type"> <span class="param-type"> string </span> </td> <td class="description last"><p>key 值。</p></td> </tr> <tr class="deep-level-0"> <td class="name"><code>attrValue</code></td> <td class="type"> <span class="param-type"> string </span> </td> <td class="description last"><p>value 值。</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="getFeaturesByAttribute" link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html#getFeaturesByAttribute">zondy.themelayer.ThemeLayer#getFeaturesByAttribute</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"> Array </span> </div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="getLocalXY"> <a class="href-link" href="#getLocalXY">#</a> <span class="code-name" id="getLocalXY" style="font-size:30px"> getLocalXY<span class="signature">(coordinate)</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>coordinate</code></td> <td class="type"> <span class="param-type"> Array </span> </td> <td class="description last"></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="getLocalXY" link="zondy.themelayer.ThemeLayer.html" onclick="getTypeHTML(event)" href="zondy.themelayer.ThemeLayer.html#getLocalXY">zondy.themelayer.ThemeLayer#getLocalXY</a> </li></ul></dd> </dl> </div> <div class="member"> <h4 class="name" id="getShapesByFeatureID"> <a class="href-link" href="#getShapesByFeatureID">#</a> <span class="code-name" id="getShapesByFeatureID" style="font-size:30px"> getShapesByFeatureID<span class="signature">(featureID)</span> </span> </h4> <div class="description"> <p>通过 FeatureID 获取 feature 关联的所有图形。如果不传入此参数,函数将返回所有图形。</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>featureID</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="description last"><p>要素 ID。</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="getWeightFieldValue"> <a class="href-link" href="#getWeightFieldValue">#</a> <span class="code-name" id="getWeightFieldValue" style="font-size:30px"> getWeightFieldValue<span class="signature">(feature, weightField, defaultValue)</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>feature</code></td> <td class="type"> <span class="param-type"> zondy.Feature.Vector </span> </td> <td class="description last"><p>矢量要素。</p></td> </tr> <tr class="deep-level-0"> <td class="name"><code>weightField</code></td> <td class="type"> <span class="param-type"> Array.&lt;string> </span> </td> <td class="description last"><p>字段名数组。</p></td> </tr> <tr class="deep-level-0"> <td class="name"><code>defaultValue</code></td> <td class="type"> <span class="param-type"> number </span> </td> <td class="description last"><p>当通过 weightField 获取不到权重值时,使用 defaultValue 作为权重值。</p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="initialize"> <a class="href-link" href="#initialize">#</a> <span class="code-name" id="initialize" style="font-size:30px"> initialize<span class="signature">(name, chartsType, 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>name</code></td> <td class="type"> <span class="param-type"> string </span> </td> <td class="description last"><p>专题图名。</p></td> </tr> <tr class="deep-level-0"> <td class="name"><code>chartsType</code></td> <td class="type"> <span class="param-type"> string </span> </td> <td class="description last"><p>图表类型。目前可用:&quot;Bar&quot;,&quot;Bar3D&quot;,&quot;Line&quot;,&quot;Point&quot;,&quot;Pie&quot;,&quot;Ring&quot;。</p></td> </tr> <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> </tbody> </table> </div> <dl class="details"> </dl> </div> <div class="member"> <h4 class="name" id="isChartInMap"> <a class="href-link" href="#isChartInMap">#</a> <span class="code-name" id="isChartInMap" style="font-size:30px"> isChartInMap<span class="signature">(mapPxBounds, chartPxBounds)</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>mapPxBounds</code></td> <td class="type"> <span class="param-type"> zondy.Bounds </span> </td> <td class="description last"><p>地图像素范围。</p></td> </tr> <tr class="deep-level-0"> <td class="name"><code>chartPxBounds</code></td> <td class="type"> <span class="param-type"> Array.&lt;Object> </span> </td> <td class="description last"><p>图表范围的四