UNPKG

@mapgis/webclient-common

Version:

mapgis ES6 format for igserver

2,997 lines (1,081 loc) 67.9 kB
<header id="page-title" class="page-title"> <span class="page-title-main">类名</span> <span class="page-title-sub">MultiPoint</span> </header> <section> <article> <div class="container-overview"> <div class='vertical-section'> <div class="members"> <div class="member"> <h4 class="name" id="MultiPoint"> <a class="href-link" href="#MultiPoint">#</a> <span class="code-name" id="MultiPoint" style="font-size:30px"> new MultiPoint<span class="signature">(options)</span> </span> </h4> <div class="description"> <p>多点几何对象 <br><br>[ES5引入方式]:<br/> Zondy.Geometry.MultiPoint() <br/> [ES6引入方式]:<br/> import { MultiPoint } from &quot;@mapgis/webclient-common&quot; <br/> <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" id="options"><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" id="coordinates"><code>coordinates</code></td> <td class="type"> <span class="param-type">Array.&lt;Number></span> </td> <td class="default"> [] </td> <td class="description last"><p>几何点的坐标,支持任意单位,参考示例:<a href='#MultiPoint'>[多点几何对象]</a></p></td> </tr> <tr class="deep-level-1"> <td class="name" id="spatialReference"><code>spatialReference</code></td> <td class="type"> <span class="param-type"><a link="SpatialReference.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SpatialReference" SpatialReference.html>SpatialReference</a></span> </td> <td class="default"> new Zondy.SpatialReference('EPSG:4326') </td> <td class="description last"><p>几何点的空间参考系,默认4326,当不是4326时请指定坐标系,方便进行投影转换,参考示例:<a href='#SpatialReference'>[指定坐标系]</a></p></td> </tr> </tbody> </table> </div> <dl class="details"> </dl> <p class="summary"><h5>支持如下方法:</h5> <a href='#addPoint'>[1、添加点坐标]</a><br/> <a href='#getPoint'>[2、返回指定索引处的点]</a><br/> <a href='#removePoint'>[3、从多点中移除一个点]</a><br/> <a href='#setPoint'>[4、更新指定索引处的点]</a><br/> <a href='#getIGSType'>[5、返回IGS所对应的GeometryModule型]</a><br/> <a href='#toOldIGSGeometry'>[6、返回igs1.0的几何对象]</a><br/> <a href='#toString'>[7、返回字符串]</a><br/> <a href='#toDots'>[8、返回Dots对象,仅包括多边形的外圈]</a> <a href='#fromJSON'>[9、通过传入的json构造并返回一个新的几何对象]</a><br/> <a href='#toJSON'>[10、导出为json对象]</a><br/> <a class="mapgis-link-name" title="Geometry#clone" Geometry.html#clone><code>11、克隆几何对象</code></a></p> <h5>示例</h5> <p class="code-caption"><h5 id='MultiPoint'>创建几何对象</h5></p> <pre class="prettyprint"><code>// ES5引入方式 const { MultiPoint } = Zondy.Geometry // ES6引入方式 import { MultiPoint } from "@mapgis/webclient-common" new MultiPoint({ coordinates:[ // 第一个点 [100, 0.0], // 第二个点 [101, 1.0] ] })</code></pre> <p class="code-caption"><h5 id='SpatialReference'>指定坐标系</h5></p> <pre class="prettyprint"><code>// ES5引入方式 const { Point } = Zondy.Geometry const { SpatialReference } = Zondy // ES6引入方式 import { Point, SpatialReference } from "@mapgis/webclient-common" new Point({ // 现在为3857坐标系 coordinates:[ // 第一个点 [12929863.44711455, 3934286.575385226], // 第二个点 [12060733.232006868, 3377247.5680546067] ], // 当不是4326时请指定坐标系,方便进行投影转换 spatialReference: new SpatialReference('EPSG:3857') })</code></pre> </div> </div> </div> </div> <h3 class="subsection-title">继承关系</h3> <ul> <li><a link="Geometry.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Geometry" Geometry.html>Geometry</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="#coordinates">coordinates</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="#extent">extent</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="#hasZ">hasZ</a></code></td> <td class="name"> <code> <span class="param-type">Boolean</span> </code> </td> <td class="name"><code><p>是否含有z坐标</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#spatialReference">spatialReference</a></code></td> <td class="name"> <code> <span class="param-type"><a link="SpatialReference.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SpatialReference" SpatialReference.html>SpatialReference</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">Array</span> </span> <h4 class="name" id="coordinates"> <a class="href-link" href="#coordinates">#</a> <span class="code-name"> coordinates </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="extent"> <a class="href-link" href="#extent">#</a> <span class="code-name"> extent </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 class="mapgis-link-name" title="Geometry#extent" Geometry.html#extent>Geometry#extent</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="hasZ"> <a class="href-link" href="#hasZ">#</a> <span class='tag'>readonly</span> <span class="code-name"> hasZ </span> </h4> <div class="description"> <p>是否含有z坐标</p> </div> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a class="mapgis-link-name" title="Geometry#hasZ" Geometry.html#hasZ>Geometry#hasZ</a> </li></ul></dd> </dl> </div> <div class="member"> <span class="method-parameter is-pulled-right"> <label>类型:</label> <span class="param-type"><a link="SpatialReference.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SpatialReference" SpatialReference.html>SpatialReference</a></span> </span> <h4 class="name" id="spatialReference"> <a class="href-link" href="#spatialReference">#</a> <span class="code-name"> spatialReference </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="spatialReference" link="Geometry.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Geometry#spatialReference" Geometry.html#spatialReference>Geometry#spatialReference</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> </code> </td> <td class="name"><code><p>通过传入的json构造并返回一个新的几何对象</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#addPoint">addPoint</a></code></td> <td class="name"> <code> <span class="param-type"><a link="MultiPoint.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="MultiPoint" MultiPoint.html>MultiPoint</a></span> </code> </td> <td class="name"><code><p>添加点坐标,可以为Point对象、[x, y, z(可选)]数组、Point对象数组、[x, y, z(可选)]对象数组</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="Geometry.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Geometry" Geometry.html>Geometry</a></span> </code> </td> <td class="name"><code><p>克隆几何对象</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#contains">contains</a></code></td> <td class="name"> <code> <span class="param-type">Boolean</span> </code> </td> <td class="name"><code><p>判断多点对象是否包含某一个点</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#fromGeoJSON">fromGeoJSON</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>导入GeoJSON</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getGeometryType">getGeometryType</a></code></td> <td class="name"> <code> <span class="param-type">String</span> </code> </td> <td class="name"><code><p>获取GeometryModule型</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getIGSType">getIGSType</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>返回IGS所对应的GeometryModule型<a id='getIGSType'></a></p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#getPoint">getPoint</a></code></td> <td class="name"> <code> <span class="param-type"><a link="Point.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Point" 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="#getType">getType</a></code></td> <td class="name"> <code> <span class="param-type">String</span> </code> </td> <td class="name"><code><p>返回所对应的GeometryModule型</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#off">off</a></code></td> <td class="name"> <code> <span class="param-type">Object</span> </code> </td> <td class="name"><code><p>移除事件<br/> 示例如下:<br/> <a href='#off1'>[1、移除一个事件的指定回调函数]</a><br/> <a href='#off2'>[2、移除一个事件的所有回调函数]</a><br/> <a href='#off3'>[3、移除多个事件的同一个指定的回调函数]</a><br/> <a href='#off4'>[4、移除多个指定事件的回调函数]</a><br/> <a href='#off5'>[5、删除时指定上下文 - types类型为字符串]</a><br/> <a href='#off6'>[6、删除时指定上下文 - types类型为对象]</a><br/></p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#on">on</a></code></td> <td class="name"> <code> <span class="param-type">Object</span> </code> </td> <td class="name"><code><p>注册一个新的监听事件;<br/> 示例如下:<br/> <a href='#event1'>[1、注册一个事件]</a><br/> <a href='#event2'>[2、一次注册多个事件 - 同一个回调函数]</a><br/> <a href='#event3'>[3、一次注册多个事件 - 分别指回调应函数]</a><br/> <a href='#event4'>[4、当types为字符串时 - 指定上下文]</a><br/> <a href='#event5'>[5、当types为对象时 - 指定上下文]</a><br/></p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#removePoint">removePoint</a></code></td> <td class="name"> <code> <span class="param-type"><a link="Point.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Point" Point.html>Point</a></span> | <span class="param-type">null</span> </code> </td> <td class="name"><code><p>从多点中移除一个点。索引指定要删除的点</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#setPoint">setPoint</a></code></td> <td class="name"> <code> <span class="param-type"><a link="MultiPoint.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="MultiPoint" MultiPoint.html>MultiPoint</a></span> </code> </td> <td class="name"><code><p>更新指定索引处的点</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#toDots">toDots</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>返回Dots对象,仅包括多边形的外圈<a id='toDots'></a></p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#toGeoJSON">toGeoJSON</a></code></td> <td class="name"> <code> <span class="param-type">Object</span> </code> </td> <td class="name"><code><p>导出为GeoJSON</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><a id='toJSON'></a> 导出为json对象</p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#toOldIGSGeometry">toOldIGSGeometry</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>返回igs1.0的几何对象<a id='toOldIGSGeometry'></a></p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#toString">toString</a></code></td> <td class="name"> <code> </code> </td> <td class="name"><code><p>返回如下格式的字符串:&quot;x0,y0,x1,y1,x2,y2&quot;<a id='toString'></a></p></code></td> </tr> <tr class="deep-level-0"> <td class="name"><code><a href="#toXML">toXML</a></code></td> <td class="name"> <code> <span class="param-type">String</span> </code> </td> <td class="name"><code><p>导出为OGC服务要求的xml字符串,子类实现</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 class="signature-attributes">opt</span>)</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" id="json"><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> <h5>示例</h5> <p class="code-caption"><h7 id='fromJSON'>通过传入的json构造并返回一个新的几何对象</h7></p> <pre class="prettyprint"><code>// ES5引入方式 const { MultiPoint } = Zondy.Geometry // ES6引入方式 import { MultiPoint } from "@mapgis/webclient-common" const json = { coordinates:[ // 第一个点 [100, 0.0], // 第二个点 [101, 1.0] ] } const multiPoint = MultiPoint.fromJSON(json)</code></pre> </div> <div class="member"> <h4 class="name" id="addPoint"> <a class="href-link" href="#addPoint">#</a> <span class="code-name" id="addPoint" style="font-size:30px"> addPoint<span class="signature">(point, mode<span class="signature-attributes">opt</span>)</span> </span> </h4> <div class="description"> <p>添加点坐标,可以为Point对象、[x, y, z(可选)]数组、Point对象数组、[x, y, z(可选)]对象数组</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" id="point"><code>point</code></td> <td class="type"> <span class="param-type"><a link="Point.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Point" Point.html>Point</a></span> | <span class="param-type">Array.&lt;Number></span> </td> <td class="default"> </td> <td class="description last"><p>可以是point,也可以是表示XY坐标的数字数组</p></td> </tr> <tr class="deep-level-0"> <td class="name" id="mode"><code>mode</code></td> <td class="type"> <span class="param-type">String</span> </td> <td class="default"> 'add' </td> <td class="description last"><p>添加模式,add:正常添加,deduplication:去除重复点</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>多点对象</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type"><a link="MultiPoint.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="MultiPoint" MultiPoint.html>MultiPoint</a></span> </div> </div> </div> </div> <h5>示例</h5> <p class="code-caption"><h7 id='addPoint'>添加点坐标</h7></p> <pre class="prettyprint"><code>// ES5引入方式 const { MultiPoint } = Zondy.Geometry // ES6引入方式 import { MultiPoint } from "@mapgis/webclient-common" const multiPoint = new MultiPoint({ coordinates:[ // 第一个点 [100, 0.0], // 第二个点 [101, 1.0] ] }) multiPoint.addPoint([102,2.0])</code></pre> </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 class="mapgis-link-name" title="Geometry#clone" Geometry.html#clone>Geometry#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="Geometry.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Geometry" Geometry.html>Geometry</a></span> </div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="contains"> <a class="href-link" href="#contains">#</a> <span class="code-name" id="contains" style="font-size:30px"> contains<span class="signature">(point)</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" id="point"><code>point</code></td> <td class="type"> <span class="param-type"><a link="Point.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Point" Point.html>Point</a></span> | <span class="param-type">Array.&lt;Number></span> </td> <td class="description last"><p>点对象</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>是否包含</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type">Boolean</span> </div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="fromGeoJSON"> <a class="href-link" href="#fromGeoJSON">#</a> <span class="code-name" id="fromGeoJSON" style="font-size:30px"> fromGeoJSON<span class="signature">(GeoJSON)</span> </span> </h4> <div class="description"> <p>导入GeoJSON</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" id="GeoJSON"><code>GeoJSON</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>Object</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="fromGeoJSON" link="Geometry.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Geometry#fromGeoJSON" Geometry.html#fromGeoJSON>Geometry#fromGeoJSON</a> </li></ul></dd> </dl> </div> <div class="member"> <h4 class="name" id="getGeometryType"> <a class="href-link" href="#getGeometryType">#</a> <span class="code-name" id="getGeometryType" style="font-size:30px"> getGeometryType<span class="signature">()</span> </span> </h4> <div class="description"> <p>获取GeometryModule型</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="getGeometryType" link="Geometry.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Geometry#getGeometryType" Geometry.html#getGeometryType>Geometry#getGeometryType</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>GeometryModule型</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type">String</span> </div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="getIGSType"> <a class="href-link" href="#getIGSType">#</a> <span class="code-name" id="getIGSType" style="font-size:30px"> getIGSType<span class="signature">()</span> </span> </h4> <div class="description"> <p>返回IGS所对应的GeometryModule型<a id='getIGSType'></a></p> </div> <dl class="details"> <dt class="tag-overrides">Overrides:</dt> <dd class="tag-overrides"><ul class="dummy"><li> <a class="mapgis-link-name" title="Geometry#getIGSType" Geometry.html#getIGSType>Geometry#getIGSType</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>string GeometryModule型</p></div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="getPoint"> <a class="href-link" href="#getPoint">#</a> <span class="code-name" id="getPoint" style="font-size:30px"> getPoint<span class="signature">(index)</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" id="index"><code>index</code></td> <td class="type"> <span class="param-type">Number</span> </td> <td class="description last"><p>点对象</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>在指定下标处的点</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type"><a link="Point.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Point" Point.html>Point</a></span> </div> </div> </div> </div> <h5>示例</h5> <p class="code-caption"><h7 id='getPoint'>返回指定索引处的点</h7></p> <pre class="prettyprint"><code>// ES5引入方式 const { MultiPoint } = Zondy.Geometry // ES6引入方式 import { MultiPoint } from "@mapgis/webclient-common" const multiPoint = new MultiPoint({ coordinates:[ // 第一个点 [100, 0.0], // 第二个点 [101, 1.0] ] }) const point = multiPoint.getPoint(0)</code></pre> </div> <div class="member"> <h4 class="name" id="getType"> <a class="href-link" href="#getType">#</a> <span class="code-name" id="getType" style="font-size:30px"> getType<span class="signature">()</span> </span> </h4> <div class="description"> <p>返回所对应的GeometryModule型</p> </div> <dl class="details"> <dt class="inherited-from">Inherited From:</dt> <dd class="inherited-from"><ul class="dummy"><li> <a goto="getType" link="Geometry.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Geometry#getType" Geometry.html#getType>Geometry#getType</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>GeometryModule型</p></div> <div class='column is-5 has-text-left'> <label>类型: </label> <span class="param-type">String</span> </div> </div> </div> </div> </div> <div class="member"> <h4 class="name" id="off"> <a class="href-link" href="#off">#</a> <span class="code-name" id="off" style="font-size:30px"> off<span class="signature">(types<span class="signature-attributes">opt</span>, fn<span class="signature-attributes">opt</span>, context<span class="signature-attributes">opt</span>)</span> </span> </h4> <div class="description"> <p>移除事件<br/> 示例如下:<br/> <a href='#off1'>[1、移除一个事件的指定回调函数]</a><br/> <a href='#off2'>[2、移除一个事件的所有回调函数]</a><br/> <a href='#off3'>[3、移除多个事件的同一个指定的回调函数]</a><br/> <a href='#off4'>[4、移除多个指定事件的回调函数]</a><br/> <a href='#off5'>[5、删除时指定上下文 - types类型为字符串]</a><br/> <a href='#off6'>[6、删除时指定上下文 - types类型为对象]</a><br/></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" id="types"><code>types</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last"><p>移除指定事件类型上绑定的回调函数<br/> 当类型为字符串时,可以移除单个或多个事件类型绑定的回调函数,单个事件:&quot;click&quot;,多个事件:以空格分割:&quot;click double-click&quot;;<br/> 当types为对象时,使用如下方式移除事件:{'click': onClickFun, 'mouse-move': onMouseMoveFun}</p></td> </tr> <tr class="deep-level-0"> <td class="name" id="fn"><code>fn</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last"><p>事件回调函数,当types为字符串,且不指定要删除的回调函数时,删除该事件上的所有回调函数</p></td> </tr> <tr class="deep-level-0"> <td class="name" id="context"><code>context</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="description last"><p>事件回调函数的this关键字将指向的对象</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="off" link="Evented.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Evented#off" Evented.html#off>Evented#off</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> <h5>示例</h5> <p class="code-caption"><h5 id='off1'>移除一个事件的指定回调函数</h5></p> <pre class="prettyprint"><code>// 一个事件的回调函数 const clickFunction = function (event) { console.log("点击事件:", event) } // 调用MapView或SceneView的off方法移除一个事件的回调函数 view.off('click', clickFunction)</code></pre> <p class="code-caption"><h5 id='off2'>移除一个事件的所有回调函数</h5></p> <pre class="prettyprint"><code>// 一个事件的回调函数1 const clickFunction1 = function (event) { console.log("点击事件1:", event) } // 一个事件的回调函数2 const clickFunction2 = function (event) { console.log("点击事件2:", event) } // 调用MapView或SceneView的off方法移除一个事件的所有回调函数 // 不指定回调函数,则移除该事件上的所有绑定的回调函数 view.off('click')</code></pre> <p class="code-caption"><h5 id='off3'>移除多个事件的同一个指定的回调函数</h5></p> <pre class="prettyprint"><code>// 多个事件的同一个回调函数 const eventFunction = function (event) { console.log("事件:", event) } // 调用MapView或SceneView的off方法移除多个事件的同一个指定的回调函数 view.off('click double-click', eventFunction)</code></pre> <p class="code-caption"><h5 id='off4'>移除多个指定事件的回调函数</h5></p> <pre class="prettyprint"><code>// 一个事件的回调函数 const clickFunction = function (event) { console.log("click事件:", event) } // 调用MapView或SceneView的off方法移除多个指定事件的回调函数 view.off({ // 移除click事件上一个指定的函数 "click": clickFunction, // 移除double-click上所有指定的函数 "double-click": undefined })</code></pre> <p class="code-caption"><h5 id='off5'>删除时指定上下文 - types类型为字符串</h5></p> <pre class="prettyprint"><code>// 一个事件的回调函数 const clickFunction = function (event) { console.log("点击事件:", event) } // 调用MapView或SceneView的off方法移除一个事件的回调函数 view.off('click', clickFunction, view) // 调用MapView或SceneView的off方法移除一个事件的所有回调函数 view.off('click', undefined, view)</code></pre> <p class="code-caption"><h5 id='off6'>删除时指定上下文 - types类型为对象</h5></p> <pre class="prettyprint"><code>// 一个事件的回调函数 const clickFunction = function (event) { console.log("click事件:", event) } // 调用MapView或SceneView的off方法移除多个指定事件的回调函数 view.off({ // 移除click事件上一个指定的函数 "click": clickFunction, // 移除double-click上所有指定的函数 "double-click": undefined }, view)</code></pre> </div> <div class="member"> <h4 class="name" id="on"> <a class="href-link" href="#on">#</a> <span class="code-name" id="on" style="font-size:30px"> on<span class="signature">(types<span class="signature-attributes">opt</span>, fn<span class="signature-attributes">opt</span>, context<span class="signature-attributes">opt</span>)</span> </span> </h4> <div class="description"> <p>注册一个新的监听事件;<br/> 示例如下:<br/> <a href='#event1'>[1、注册一个事件]</a><br/> <a href='#event2'>[2、一次注册多个事件 - 同一个回调函数]</a><br/> <a href='#event3'>[3、一次注册多个事件 - 分别指回调应函数]</a><br/> <a href='#event4'>[4、当types为字符串时 - 指定上下文]</a><br/> <a href='#event5'>[5、当types为对象时 - 指定上下文]</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" id="types"><code>types</code></td> <td class="type"> <span class="param-type">String</span> | <span class="param-type">Object</span> </td> <td class="default"> null </td> <td class="description last"><p>事件类型<br/> 当types为字符串时,可以定义单个或多个事件,单个事件:&quot;click&quot;,多个事件:以空格分割:&quot;click double-click&quot;;<br/> 当types为对象时,使用如下方式指定事件:{'click': onClickFun, 'mouse-move': onMouseMoveFun}</p></td> </tr> <tr class="deep-level-0"> <td class="name" id="fn"><code>fn</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="default"> null </td> <td class="description last"><p>事件回调函数</p></td> </tr> <tr class="deep-level-0"> <td class="name" id="context"><code>context</code></td> <td class="type"> <span class="param-type">Object</span> </td> <td class="default"> null </td> <td class="description last"><p>事件回调函数的this关键字将指向的对象</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="on" link="Evented.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Evented#on" Evented.html#on>Evented#on</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> <h5>示例</h5> <p class="code-caption"><h5 id='event1'>注册一个事件</h5></p> <pre class="prettyprint"><code>// 初始化一个点击事件回调函数 const clickFunction = function (event) { console.log("点击事件:", event) } // 调用MapView或SceneView的on方法注册一个点击事件 view.on('click', clickFunction)</code></pre> <p class="code-caption"><h5 id='event2'>一次注册多个事件 - 同一个回调函数</h5></p> <pre class="prettyprint"><code>// 初始化一个事件回调函数 const eventFunction = function (event) { console.log("事件:", event) } // 调用MapView或SceneView的on方法注册多个事件 // 多个事件类型使用同一个回调函数 view.on('click right-click-down', eventFunction)</code></pre> <p class="code-caption"><h5 id='event3'>一次注册多个事件 - 分别指回调应函数</h5></p> <pre class="prettyprint"><code>// 初始化一个左键点击事件回调函数 const clickFunction = function (event) { console.log("click事件:", event) } // 初始化一个右键按下事件回调函数 con