UNPKG

@mapgis/webclient-common

Version:

mapgis ES6 format for igserver

2,128 lines 35.5 kB
<header id="page-title" class="page-title">
    
        <span class="page-title-main">类名</span>
        <span class="page-title-sub">SketchEditorVideo</span>
    
</header>





<section>

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


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

    









    <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>mapView</code></td>
  

  <td class="type">
  
      
<span class="param-type">
    
             <a link="VideoMapView.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="VideoMapView" VideoMapView.html>VideoMapView</a>
    
</span>



  
  </td>

  

  <td class="description last"><p>视图</p></td>
</tr>


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

  <td class="type">
  
      
<span class="param-type">
    
             <a link="SketchStyle.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchStyle" SketchStyle.html>SketchStyle</a>
    
</span>



  
  </td>

  

  <td class="description last"><p>草图样式</p></td>
</tr>


  



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






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    
    

    

    

    
</dl>
























                    </div>
                </div>
            </div>
        
    
    </div>
    
    
        <h3 class="subsection-title">继承关系</h3>

        


    <ul>
        <li><a link="SketchEditorVideoBase.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchEditorVideoBase" SketchEditorVideoBase.html>SketchEditorVideoBase</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="#coorTransfomrs">coorTransfomrs</a></code></td>
                                <td class="name">
                                    <code>
                                        
<span class="param-type">
    
             <a link="VideoPixelCoordTransforms.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="VideoPixelCoordTransforms" VideoPixelCoordTransforms.html>VideoPixelCoordTransforms</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">
    
             <a link="VideoPixelCoordTransforms.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="VideoPixelCoordTransforms" VideoPixelCoordTransforms.html>VideoPixelCoordTransforms</a>
    
</span>



    </span>

<h4 class="name" id="coorTransfomrs">
    <a class="href-link" href="#coorTransfomrs">#</a>
    
        
            <span class='tag'>readonly</span>
        
    
    <span class="code-name">
        coorTransfomrs
    </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="SketchEditorVideoBase#coorTransfomrs" SketchEditorVideoBase.html#coorTransfomrs>SketchEditorVideoBase#coorTransfomrs</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="#clearGeometry">clearGeometry</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="#getGeometry">getGeometry</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="#getSketchDataType">getSketchDataType</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
<span class="param-type">
    
             <a link="SketchDataType.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchDataType" global.html#SketchDataType>SketchDataType</a>
    
</span>



                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>获取当前草图数据类型</p></code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#getSketchStyle">getSketchStyle</a></code></td>
                                <td class="name">
                                    <code>
                                        
                                                
<span class="param-type">
    
             <a link="SketchStyle.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchStyle" SketchStyle.html>SketchStyle</a>
    
</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>
                                        
                                                
<span class="param-type">
    
             Object
    
</span>



                                            
                                    </code>
                                </td>
                                <td class="name"><code><p>移除事件<br/>
示例如下:<br/>
</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/>
</code></td>
                            </tr>
                        
                            <tr class="deep-level-0">
                                <td class="name"><code><a href="#setSketchStyle">setSketchStyle</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="#start">start</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="#stop">stop</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="clearGeometry">
        <a class="href-link" href="#clearGeometry">#</a>
        
        <span class="code-name" id="clearGeometry" style="font-size:30px">
            
                clearGeometry<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="SketchEditorVideoBase#clearGeometry" SketchEditorVideoBase.html#clearGeometry>SketchEditorVideoBase#clearGeometry</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    
    

    

    

    
</dl>























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


    
    <h4 class="name" id="getGeometry">
        <a class="href-link" href="#getGeometry">#</a>
        
        <span class="code-name" id="getGeometry" style="font-size:30px">
            
                getGeometry<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="SketchEditorVideoBase#getGeometry" SketchEditorVideoBase.html#getGeometry>SketchEditorVideoBase#getGeometry</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='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="getSketchDataType">
        <a class="href-link" href="#getSketchDataType">#</a>
        
        <span class="code-name" id="getSketchDataType" style="font-size:30px">
            
                getSketchDataType<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="SketchEditorVideoBase#getSketchDataType" SketchEditorVideoBase.html#getSketchDataType>SketchEditorVideoBase#getSketchDataType</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='column is-5 has-text-left'>
        <label>类型: </label>
        
<span class="param-type">
    
             <a link="SketchDataType.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchDataType" global.html#SketchDataType>SketchDataType</a>
    
</span>



    </div>
    
</div>

                
        </div>
    </div>






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


    
    <h4 class="name" id="getSketchStyle">
        <a class="href-link" href="#getSketchStyle">#</a>
        
        <span class="code-name" id="getSketchStyle" style="font-size:30px">
            
                getSketchStyle<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="SketchEditorVideoBase#getSketchStyle" SketchEditorVideoBase.html#getSketchStyle>SketchEditorVideoBase#getSketchStyle</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='column is-5 has-text-left'>
        <label>类型: </label>
        
<span class="param-type">
    
             <a link="SketchStyle.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchStyle" SketchStyle.html>SketchStyle</a>
    
</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"><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"><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"><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="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a class="mapgis-link-name" title="SketchEditorVideoBase#off" SketchEditorVideoBase.html#off>SketchEditorVideoBase#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"><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"><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"><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="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a class="mapgis-link-name" title="SketchEditorVideoBase#on" SketchEditorVideoBase.html#on>SketchEditorVideoBase#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)
}

// 初始化一个右键按下事件回调函数
const rightClickFunction = function (event) {
  console.log("right-click-down事件:", event)
}

// 调用MapView或SceneView的on方法注册多个事件
// 每一个事件类型,使用单独的回调函数
// 注意使用此种方式,一种类型的事件仅能指定一个回调函数
view.on({
  "click": clickFunction,
  "right-click-down": rightClickFunction
})</code></pre>
    

        <p class="code-caption"><h5 id='event4'>指定上下文 - types类型为字符串</h5></p>
    
    
        <pre class="prettyprint"><code>// 初始化一个点击事件回调函数
const clickFunction = function (event) {
  console.log("点击事件:", event)
  console.log("上下文对象:", this)
}
// 调用MapView或SceneView的on方法注册一个点击事件
// 指定view为回调函数的上下文对象
view.on('click', clickFunction, view)</code></pre>
    

        <p class="code-caption"><h5 id='event5'>指定上下文 - types类型为对象</h5></p>
    
    
        <pre class="prettyprint"><code>// 初始化一个点击事件回调函数
const clickFunction = function (event) {
  console.log("点击事件:", event)
  console.log("上下文对象:", this)
}
// 调用MapView或SceneView的on方法注册一个点击事件
// 指定view为回调函数的上下文对象
view.on({
  "click": clickFunction,
  "right-click-down": clickFunction
}, view)</code></pre>
    


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


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

  <td class="type">
  
      
<span class="param-type">
    
             <a link="SketchStyle.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchStyle" SketchStyle.html>SketchStyle</a>
    
</span>



  
  </td>

  

  <td class="description last"></td>
</tr>



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






<dl class="details">

    

    

    

    
    <dt class="tag-overrides">Overrides:</dt>
    <dd class="tag-overrides"><ul class="dummy"><li>
        <a class="mapgis-link-name" title="SketchEditorVideoBase#setSketchStyle" SketchEditorVideoBase.html#setSketchStyle>SketchEditorVideoBase#setSketchStyle</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    
    

    

    

    
</dl>























    <h5>示例</h5>
    
    
        <pre class="prettyprint"><code>// ES5引入方式
const { SimpleFillSymbol, SimpleLineSymbol } = zondy.symbol
const { Color, SketchStyle } = zondy
// ES6引入方式
import { SimpleFillSymbol, SimpleLineSymbol, Color, SketchStyle } from "@mapgis/webclient-common"
// 新建一个填充样式
const fillStyle = new SimpleFillSymbol({
  color: new Color(0, 255, 255, 1),
  outline: new SimpleLineSymbol({
    color: new Color(255, 0, 0, 1),
    width: 2
  })
})
// 新建一个草图样式
const sketchStyle = new SketchStyle({
  // 传入填充样式给区注记使用
  fillStyle: fillStyle,
  // 绘制线注记时显示分段长度
  isShowSegmentLength: true,
  // 绘制区注记时显示面积
  isShowArea: true
})
sketchEditorVideo.setSketchStyle(sketchStyle)</code></pre>
    


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


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

  <td class="type">
  
      
<span class="param-type">
    
             <a link="SketchDataType.html" onclick="getTypeHTML(event)" class="mapgis-link-name" title="SketchDataType" global.html#SketchDataType>SketchDataType</a>
    
</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 class="mapgis-link-name" title="SketchEditorVideoBase#start" SketchEditorVideoBase.html#start>SketchEditorVideoBase#start</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    
    

    

    

    
</dl>























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


    
    <h4 class="name" id="stop">
        <a class="href-link" href="#stop">#</a>
        
        <span class="code-name" id="stop" style="font-size:30px">
            
                stop<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="SketchEditorVideoBase#stop" SketchEditorVideoBase.html#stop>SketchEditorVideoBase#stop</a>
    </li></ul></dd>
    

    

    

    

    

    

    

    

    
    

    

    

    
</dl>























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

    

    
</article>

</section>