@mapgis/webclient-common
Version:
mapgis ES6 format for igserver
3,003 lines (1,091 loc) • 75.8 kB
HTML
<header id="page-title" class="page-title">
<span class="page-title-main">类名</span>
<span class="page-title-sub">Extent</span>
</header>
<section>
<article>
<div class="container-overview">
<div class='vertical-section'>
<div class="members">
<div class="member">
<h4 class="name" id="Extent">
<a class="href-link" href="#Extent">#</a>
<span class="code-name" id="Extent" style="font-size:30px">
new Extent<span class="signature">(options)</span>
</span>
</h4>
<div class="description">
<p>几何范围对象,即左下角和右上角组成的矩形范围几何对象,参考示例:<a href='#Extent'>[几何范围对象]</a>
<br><br>[ES5引入方式]:<br/>
Zondy.Geometry.Extent() <br/>
[ES6引入方式]:<br/>
import { Extent } from "@mapgis/webclient-common" <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="xmin"><code>xmin</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
0
</td>
<td class="description last"><p>x轴最小坐标</p></td>
</tr>
<tr class="deep-level-1">
<td class="name" id="ymin"><code>ymin</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
0
</td>
<td class="description last"><p>y轴最小坐标</p></td>
</tr>
<tr class="deep-level-1">
<td class="name" id="xmax"><code>xmax</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
0
</td>
<td class="description last"><p>x轴最大坐标</p></td>
</tr>
<tr class="deep-level-1">
<td class="name" id="ymax"><code>ymax</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
0
</td>
<td class="description last"><p>y轴最大坐标</p></td>
</tr>
<tr class="deep-level-1">
<td class="name" id="zmin0"><code>zmin0</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
</td>
<td class="description last"><p>Z轴最小坐标</p></td>
</tr>
<tr class="deep-level-1">
<td class="name" id="zmax0"><code>zmax0</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="default">
</td>
<td class="description last"><p>Z轴最大坐标</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='#centerAt'>[1、根据中心点生成新的范围]</a><br/>
<a href='#contains'>[2、输入的几何是否包含在范围内]</a><br/>
<a href='#intersection'>[3、将原始范围与输入范围求交]</a><br/>
<a href='#intersects'>[4、输入的几何图形是否与范围相交]</a><br/>
<a href='#equals'>[5、是否和输入范围相等]</a><br/>
<a href='#expand'>[6、按给定的因子扩大范围]</a><br/>
<a href='#offset'>[7、平移extent]</a><br/>
<a href='#union'>[8、求并]</a><br/>
<a href='#toString'>[9、返回字符串]</a><br/>
<a href='#toIGSOldString'>[10、返回IGS1.0的字符串]</a><br/>
<a href='#getIGSType'>[11、返回IGS所对应的GeometryModule型]</a><br/>
<a href='#fromJSON'>[12、通过传入的json构造并返回一个新的几何对象]</a><br/>
<a href='#toJSON'>[13、导出为json对象]</a><br/>
<a class="mapgis-link-name" title="Geometry#clone" Geometry.html#clone><code>14、克隆几何对象</code></a></p>
<h5>示例</h5>
<p class="code-caption"><h7 id='Extent'>创建几何对象</h7></p>
<pre class="prettyprint"><code>// ES5引入方式
const { Extent } = Zondy.Geometry
// ES6引入方式
import { Extent } from "@mapgis/webclient-common"
new Extent({
xmin: 10,
xmax: 210,
ymin: 0,
ymax: 100
})</code></pre>
<p class="code-caption"><h7 id='spatialReference'>指定坐标系</h7></p>
<pre class="prettyprint"><code>// ES5引入方式
const { Extent } = Zondy.Geometry
const { SpatialReference } = Zondy
// ES6引入方式
import { Extent, SpatialReference } from "@mapgis/webclient-common"
new Extent({
// 3857坐标系的点
xmin: 12060733.232006868,
xmax: 12929863.44711455,
ymin: 3377247.5680546067,
ymax: 3934286.575385226,
// 当不是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="#center">center</a></code></td>
<td class="name">
<code>
<span class="param-type">Array.<Number></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="#height">height</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="#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>
<tr class="deep-level-0">
<td class="name"><code><a href="#width">width</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="#xmax">xmax</a></code></td>
<td class="name">
<code>
<span class="param-type">Number</span>
</code>
</td>
<td class="name"><code><p>x坐标最大值</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#xmin">xmin</a></code></td>
<td class="name">
<code>
<span class="param-type">Number</span>
</code>
</td>
<td class="name"><code><p>x坐标最小值</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#ymax">ymax</a></code></td>
<td class="name">
<code>
<span class="param-type">Number</span>
</code>
</td>
<td class="name"><code><p>y坐标最大值</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#ymin">ymin</a></code></td>
<td class="name">
<code>
<span class="param-type">Number</span>
</code>
</td>
<td class="name"><code><p>y坐标最小值</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#zmax">zmax</a></code></td>
<td class="name">
<code>
<span class="param-type">Number</span>
</code>
</td>
<td class="name"><code><p>z坐标最大值</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#zmin">zmin</a></code></td>
<td class="name">
<code>
<span class="param-type">Number</span>
</code>
</td>
<td class="name"><code><p>z坐标最小值</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.<Number></span>
</span>
<h4 class="name" id="center">
<a class="href-link" href="#center">#</a>
<span class="code-name">
center
</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="inherited-from">Inherited From:</dt>
<dd class="inherited-from"><ul class="dummy"><li>
<a goto="extent" link="Geometry.html" onclick="getTypeHTML(event)" 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">Number</span>
</span>
<h4 class="name" id="height">
<a class="href-link" href="#height">#</a>
<span class="code-name">
height
</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="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 class="member">
<span class="method-parameter is-pulled-right">
<label>类型:</label>
<span class="param-type">Number</span>
</span>
<h4 class="name" id="width">
<a class="href-link" href="#width">#</a>
<span class="code-name">
width
</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="xmax">
<a class="href-link" href="#xmax">#</a>
<span class="code-name">
xmax
</span>
</h4>
<div class="description">
<p>x坐标最大值</p>
</div>
<dl class="details">
<dt class="tag-default">Default Value:</dt>
<dd class="tag-default"><ul class="dummy">
<li>0</li>
</ul></dd>
</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="xmin">
<a class="href-link" href="#xmin">#</a>
<span class="code-name">
xmin
</span>
</h4>
<div class="description">
<p>x坐标最小值</p>
</div>
<dl class="details">
<dt class="tag-default">Default Value:</dt>
<dd class="tag-default"><ul class="dummy">
<li>0</li>
</ul></dd>
</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="ymax">
<a class="href-link" href="#ymax">#</a>
<span class="code-name">
ymax
</span>
</h4>
<div class="description">
<p>y坐标最大值</p>
</div>
<dl class="details">
<dt class="tag-default">Default Value:</dt>
<dd class="tag-default"><ul class="dummy">
<li>0</li>
</ul></dd>
</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="ymin">
<a class="href-link" href="#ymin">#</a>
<span class="code-name">
ymin
</span>
</h4>
<div class="description">
<p>y坐标最小值</p>
</div>
<dl class="details">
<dt class="tag-default">Default Value:</dt>
<dd class="tag-default"><ul class="dummy">
<li>0</li>
</ul></dd>
</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="zmax">
<a class="href-link" href="#zmax">#</a>
<span class="code-name">
zmax
</span>
</h4>
<div class="description">
<p>z坐标最大值</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="zmin">
<a class="href-link" href="#zmin">#</a>
<span class="code-name">
zmin
</span>
</h4>
<div class="description">
<p>z坐标最小值</p>
</div>
<dl class="details">
</dl>
</div>
</div>
</div>
<div class='vertical-section'>
<h3 id='function'>方法</h3>
<h4 style="margin-top: 20px;margin-bottom: 20px;">方法概述</h4>
<div class="members">
<div class="table-container">
<table class="params table">
<thead>
<tr>
<th>名称</th>
<th>返回值类型</th>
<th>描述</th>
</tr>
</thead>
<tbody>
<tr class="deep-level-0">
<td class="name"><code><a href="#fromJSON">fromJSON</a></code></td>
<td class="name">
<code>
</code>
</td>
<td class="name"><code><p>通过传入的json构造并返回一个新的几何对象</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#centerAt">centerAt</a></code></td>
<td class="name">
<code>
<span class="param-type"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></span>
</code>
</td>
<td class="name"><code><p>根据中心点生成新的范围,新范围的宽高为当前范围的宽高</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="#equals">equals</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="#expand">expand</a></code></td>
<td class="name">
<code>
<span class="param-type"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></span>
</code>
</td>
<td class="name"><code><p>按给定的因子扩大范围。例如,值为1.5将将范围扩展到比原始范围大50%。</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="#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="#intersection">intersection</a></code></td>
<td class="name">
<code>
<span class="param-type"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></span>
</code>
</td>
<td class="name"><code><p>将原始范围与输入范围求交</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#intersects">intersects</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="#normalize">normalize</a></code></td>
<td class="name">
<code>
<span class="param-type"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></span>
</code>
</td>
<td class="name"><code><p>归一化计算</p></code></td>
</tr>
<tr class="deep-level-0">
<td class="name"><code><a href="#offset">offset</a></code></td>
<td class="name">
<code>
<span class="param-type"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></span>
</code>
</td>
<td class="name"><code><p>根据输入的dx, dy, dz值,平移extent</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="#toIGSOldString">toIGSOldString</a></code></td>
<td class="name">
<code>
</code>
</td>
<td class="name"><code><p>返回如下格式的字符串:"xmin$ymin$xmax$ymax"<a id='toIGSOldString'></a></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="#toPolygon">toPolygon</a></code></td>
<td class="name">
<code>
<span class="param-type"><a link="Polygon.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Polygon" Polygon.html>Polygon</a></span>
</code>
</td>
<td class="name"><code></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>返回如下格式的字符串:"xmin,ymin,xmax,ymax"<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>
<tr class="deep-level-0">
<td class="name"><code><a href="#union">union</a></code></td>
<td class="name">
<code>
<span class="param-type"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</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="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 { Extent } = Zondy.Geometry
// ES6引入方式
import { Extent } from "@mapgis/webclient-common"
const json = {
xmin: 10,
xmax: 210,
ymin: 0,
ymax: 100
}
const extent = Extent.fromJSON(json)</code></pre>
</div>
<div class="member">
<h4 class="name" id="centerAt">
<a class="href-link" href="#centerAt">#</a>
<span class="code-name" id="centerAt" style="font-size:30px">
centerAt<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>
</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="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></span>
</div>
</div>
</div>
</div>
<h5>示例</h5>
<p class="code-caption"><h7 id='centerAt'>根据中心点生成新的范围</h7></p>
<pre class="prettyprint"><code>// ES5引入方式
const { Extent, Point } = Zondy.Geometry
// ES6引入方式
import { Extent, Point } from "@mapgis/webclient-common"
const extent = new Extent({
xmin: 10,
xmax: 210,
ymin: 0,
ymax: 100
})
const point = new Point({
coordinates: [100.0, 0.0]
})
const newConst = extent.centerAt(point)</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">(geometry)</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="geometry"><code>geometry</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"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></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>如果输入几何图形包含在范围内,则返回true</p></div>
<div class='column is-5 has-text-left'>
<label>类型: </label>
<span class="param-type">Boolean</span>
</div>
</div>
</div>
</div>
<h5>示例</h5>
<p class="code-caption"><h7 id='contains'>输入的几何是否包含在范围内</h7></p>
<pre class="prettyprint"><code>// ES5引入方式
const { Extent, Point } = Zondy.Geometry
// ES6引入方式
import { Extent, Point } from "@mapgis/webclient-common"
const extent = new Extent({
xmin: 10,
xmax: 210,
ymin: 0,
ymax: 100
})
const point = new Point({
coordinates: [100.0, 0.0]
})
const isIn = extent.contains(point)</code></pre>
</div>
<div class="member">
<h4 class="name" id="equals">
<a class="href-link" href="#equals">#</a>
<span class="code-name" id="equals" style="font-size:30px">
equals<span class="signature">(extent)</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="extent"><code>extent</code></td>
<td class="type">
<span class="param-type"><a link="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></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>如果输入范围等于调用equals()的范围,则返回true</p></div>
<div class='column is-5 has-text-left'>
<label>类型: </label>
<span class="param-type">Boolean</span>
</div>
</div>
</div>
</div>
<h5>示例</h5>
<p class="code-caption"><h7 id='equals'>是否和输入范围相等</h7></p>
<pre class="prettyprint"><code>// ES5引入方式
const { Extent } = Zondy.Geometry
// ES6引入方式
import { Extent } from "@mapgis/webclient-common"
const extent = new Extent({
xmin: 10,
xmax: 210,
ymin: 0,
ymax: 100
})
const extent2 = new Extent({
xmin: 10,
xmax: 210,
ymin: 0,
ymax: 100
})
const isEqual = extent.equals(extent2)</code></pre>
</div>
<div class="member">
<h4 class="name" id="expand">
<a class="href-link" href="#expand">#</a>
<span class="code-name" id="expand" style="font-size:30px">
expand<span class="signature">(factor)</span>
</span>
</h4>
<div class="description">
<p>按给定的因子扩大范围。例如,值为1.5将将范围扩展到比原始范围大50%。</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="factor"><code>factor</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last"><p>乘数的值,必须大于等于1</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="Extent.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="Extent" Extent.html>Extent</a></span>
</div>
</div>
</div>
</div>
<h5>示例</h5>
<p class="code-caption"><h7 id='expand'>按给定的因子扩大范围</h7></p>
<pre class="prettyprint"><code>// ES5引入方式
const { Extent } = Zondy.Geometry
// ES6引入方式
import { Extent } from "@mapgis/webclient-common"
const extent = new Extent({
xmin: 10,
xmax: 210,
ymin: 0,
ymax: 100
})
extent.expand(1.5)</code></pre>
</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="