UNPKG

@mapgis/webclient-common

Version:

mapgis ES6 format for igserver

2,205 lines 28.7 kB
<header id="page-title" class="page-title">
    
        <span class="page-title-main">类名</span>
        <span class="page-title-sub">ArcGisPolygon</span>
    
</header>





<section>

<article>
    <div class="container-overview">
    
        
            <div class='vertical-section'>
                <div class="members">
                    <div class="member">
                        


    
    <h4 class="name" id="ArcGisPolygon">
        <a class="href-link" href="#ArcGisPolygon">#</a>
        
        <span class="code-name" id="ArcGisPolygon" style="font-size:30px">
            
                new ArcGisPolygon<span class="signature">(options)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>ArcGis服务</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>options</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Object
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,构造点对象参数。</p></td>
</tr>


  
    
<tr class="deep-level-1">
  
      <td class="name"><code>rings</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             String
    
</span>



  
  </td>

  

  <td class="description last"><p>可选项。构成多边形的点坐标,坐标必须闭合,可有多个矩形。
Example:rings:[[[x1,y1],[x2,y2],[x3,y3],[x1,y1]],[[x4,y4],[x5,y5],[x6,y6],[x4,y4]]]</p></td>
</tr>


  
    
<tr class="deep-level-1">
  
      <td class="name"><code>spatialReference</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             ArcGisSpatialReference
    
</span>



  
  </td>

  

  <td class="description last"><p>可选项。多边形的空间坐标系,默认4326。</p></td>
</tr>


  



        
        </tbody>
    </table>
</div>






<dl class="details">

    

    

    

    

    

    

    

    

    
    <dt class="tag-author">作者:</dt>
    <dd class="tag-author">
        <ul>
            <li>基础平台-杨琨</li>
        </ul>
    </dd>
    

    

    

    
    

    

    

    
</dl>
























                    </div>
                </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="#addRing">addRing</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>根据ringIndex、pointIndex,更新一个多边形对象</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="#fromExtent">fromExtent</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
<span class="param-type">
    
             ArcGisPolygon
    
</span>



                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>输入一个Extent对象返回一个多边形对象</p></code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#getPoint">getPoint</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>根据ringIndex、pointIndex返回点对象</p></code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#insertPoint">insertPoint</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>根据ringIndex、pointIndex,在pointIndex之后插入一个点对象</p></code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#isClockwise">isClockwise</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="#removePoint">removePoint</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>根据ringIndex、pointIndex删除一个点,并返回该点对象</p></code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#removeRing">removeRing</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>根据index,删除一个多边形点坐标数组</p></code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#setPoint">setPoint</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>根据ringIndex、pointIndex,更新一个点对象</p></code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#toGeometryJSON">toGeometryJSON</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
                                            
                                    </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="addRing">
        <a class="href-link" href="#addRing">#</a>
        
        <span class="code-name" id="addRing" style="font-size:30px">
            
                addRing<span class="signature">(points)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>根据ringIndex、pointIndex,更新一个多边形对象</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>points</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Array
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,要插入的一组多边形点坐标数组,
example:[[x1,y1],[x2,y2],[x3,y3],[x1,y1]]。</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>ArcGisPolygon,多边形对象</p></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"><code>point</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             ArcGisPoint
    
</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="fromExtent">
        <a class="href-link" href="#fromExtent">#</a>
        
        <span class="code-name" id="fromExtent" style="font-size:30px">
            
                fromExtent<span class="signature">(Extent)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>输入一个Extent对象返回一个多边形对象</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>Extent</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             ArcGisExtent
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,要输入的ArcGisExtent对象。</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">
    
             ArcGisPolygon
    
</span>



    </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">(ringIndex, pointIndex)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>根据ringIndex、pointIndex返回点对象</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>ringIndex</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Number
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,要查询的多边形序号。</p></td>
</tr>



        

            
<tr class="deep-level-0">
  
      <td class="name"><code>pointIndex</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>ArcGisPoint,点对象</p></div>
    
    
</div>

                
        </div>
    </div>






</div>
            
                <div class="member">


    
    <h4 class="name" id="insertPoint">
        <a class="href-link" href="#insertPoint">#</a>
        
        <span class="code-name" id="insertPoint" style="font-size:30px">
            
                insertPoint<span class="signature">(ringIndex, pointIndex, point)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>根据ringIndex、pointIndex,在pointIndex之后插入一个点对象</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>ringIndex</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Number
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,要插入的多边形序号。</p></td>
</tr>



        

            
<tr class="deep-level-0">
  
      <td class="name"><code>pointIndex</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Number
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,在第pointIndex之后插入一个点,线标从0开始。</p></td>
</tr>



        

            
<tr class="deep-level-0">
  
      <td class="name"><code>point</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>ArcGisPolygon,多边形对象</p></div>
    
    
</div>

                
        </div>
    </div>






</div>
            
                <div class="member">


    
    <h4 class="name" id="isClockwise">
        <a class="href-link" href="#isClockwise">#</a>
        
        <span class="code-name" id="isClockwise" style="font-size:30px">
            
                isClockwise<span class="signature">(ring)</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>ring</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Array
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,[ArcGisPoint]或[[x,y,z]]或[x,y],输入值必须是一组点坐标或对象数组(就是一条线,封闭线就是多边形),不能是多维数组。</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="removePoint">
        <a class="href-link" href="#removePoint">#</a>
        
        <span class="code-name" id="removePoint" style="font-size:30px">
            
                removePoint<span class="signature">(ringIndex, pointIndex)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>根据ringIndex、pointIndex删除一个点,并返回该点对象</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>ringIndex</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Number
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,要删除的点所在的多边形序号。</p></td>
</tr>



        

            
<tr class="deep-level-0">
  
      <td class="name"><code>pointIndex</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Number
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,在pointIndex处,删除这个点。</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>ArcGisPoint,点对象</p></div>
    
    
</div>

                
        </div>
    </div>






</div>
            
                <div class="member">


    
    <h4 class="name" id="removeRing">
        <a class="href-link" href="#removeRing">#</a>
        
        <span class="code-name" id="removeRing" style="font-size:30px">
            
                removeRing<span class="signature">(index)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>根据index,删除一个多边形点坐标数组</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>index</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Array
    
</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>[ArcGisPoint],被删除的多边形点对象数组</p></div>
    
    
</div>

                
        </div>
    </div>






</div>
            
                <div class="member">


    
    <h4 class="name" id="setPoint">
        <a class="href-link" href="#setPoint">#</a>
        
        <span class="code-name" id="setPoint" style="font-size:30px">
            
                setPoint<span class="signature">(ringIndex, pointIndex, point)</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>根据ringIndex、pointIndex,更新一个点对象</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>ringIndex</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Number
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,要更新的点所在的多边形序号。</p></td>
</tr>



        

            
<tr class="deep-level-0">
  
      <td class="name"><code>pointIndex</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             Number
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,在pointIndex处,更新这个点。</p></td>
</tr>



        

            
<tr class="deep-level-0">
  
      <td class="name"><code>point</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             ArcGisPoint
    
</span>



  
  </td>

  

  <td class="description last"><p>必选项,ArcGisPoint对象或者[x,y]或[x,y,z]数组,要更新的点。</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>ArcGisPolygon,多边形对象</p></div>
    
    
</div>

                
        </div>
    </div>






</div>
            
                <div class="member">


    
    <h4 class="name" id="toGeometryJSON">
        <a class="href-link" href="#toGeometryJSON">#</a>
        
        <span class="code-name" id="toGeometryJSON" style="font-size:30px">
            
                toGeometryJSON<span class="signature">()</span>
            
        </span>
    </h4>
    

    
    <div class="description">
        <p>将点坐标转换为Json对象</p>
    </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>String</p></div>
    
    
</div>

                
        </div>
    </div>






</div>
            
            </div>
        </div>
    

    

    
</article>

</section>