UNPKG

rn_supermap

Version:

rn_supermap 一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。

4,331 lines (1,074 loc) 45.7 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Class: Map</title> <script src="scripts/prettify/prettify.js"> </script> <script src="scripts/prettify/lang-css.js"> </script> <!--[if lt IE 9]> <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css"> <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css"> </head> <body> <div id="main"> <h1 class="page-title">Class: Map</h1> <section> <header> <h2>Map</h2> </header> <article> <div class="container-overview"> <h4 class="name" id="Map"><span class="type-signature"></span>new Map<span class="signature">()</span><span class="type-signature"></span></h4> <div class="description"> 地图类,负责地图显示环境的管理。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line17">line 17</a> </li></ul></dd> </dl> </div> <h3 class="subsection-title">Methods</h3> <h4 class="name" id=".addDataset"><span class="type-signature">(static) </span>addDataset<span class="signature">(dataset, addToHead)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 用于把一个数据集添加到此地图作为一个普通图层显示,即创建一个普通图层。(@deprecated) </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>dataset</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> <tr> <td class="name"><code>addToHead</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line78">line 78</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".addLayer"><span class="type-signature">(static) </span>addLayer<span class="signature">(dataset, addToHead)</span><span class="type-signature"> &rarr; {Promise.&lt;layer>}</span></h4> <div class="description"> 用于把一个数据集添加到此图层集合作为一个普通图层显示,即创建一个普通图层。其风格由系统默认设置。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>dataset</code></td> <td class="type"> </td> <td class="description last">要添加到图层的数据集。</td> </tr> <tr> <td class="name"><code>addToHead</code></td> <td class="type"> </td> <td class="description last">指定新创建图层是否放在图层集合的最上面一层。当设置为 false 时,则将此新创建图层放在最底层。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line461">line 461</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;layer></span> </dd> </dl> <h4 class="name" id=".addThemeLayer"><span class="type-signature">(static) </span>addThemeLayer<span class="signature">(dataset, theme, addToHead)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Layer.html">Layer</a>>}</span></h4> <div class="description"> 用于将一个数据集添加到此图层集合作为一个专题图层显示,即创建一个专题图层,并指定专题图层的专题图对象。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>dataset</code></td> <td class="type"> </td> <td class="description last">要添加到图层的数据集。</td> </tr> <tr> <td class="name"><code>theme</code></td> <td class="type"> </td> <td class="description last">指定此专题图层的专题图对象。</td> </tr> <tr> <td class="name"><code>addToHead</code></td> <td class="type"> </td> <td class="description last">指定新创建图层是否放在图层集合的最上面一层。当设置为 false 时,则将此新创建图层放在最底层。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line480">line 480</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="Layer.html">Layer</a>></span> </dd> </dl> <h4 class="name" id=".close"><span class="type-signature">(static) </span>close<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 关闭当前地图。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line138">line 138</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".contains"><span class="type-signature">(static) </span>contains<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;number>}</span></h4> <div class="description"> 判断地图是否包含某个名字的图层。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> </td> <td class="description last">图层的名字。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line520">line 520</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> 找到指定图层则返回图层索引,否则返回-1 </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;number></span> </dd> </dl> <h4 class="name" id=".getBounds"><span class="type-signature">(static) </span>getBounds<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Promise.bound>}</span></h4> <div class="description"> 返回当前地图的空间范围。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line257">line 257</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> - 返回Bounds的JSON对象:如{top:0,bottom:0,left:0,right:0,height:0,width:0,center:{x,y}} </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Promise.bound></span> </dd> </dl> <h4 class="name" id=".getCenter"><span class="type-signature">(static) </span>getCenter<span class="signature">(point2D)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 获取当前地图的显示范围的中心点。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>point2D</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line190">line 190</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".getLayer"><span class="type-signature">(static) </span>getLayer<span class="signature">(layerIndex|layerName)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Layer.html">Layer</a>>}</span></h4> <div class="description"> 返回此图层集合中指定索引或名称的图层对象。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>layerIndex|layerName</code></td> <td class="type"> <span class="param-type">number</span> | <span class="param-type">string</span> </td> <td class="description last">指定索引或名称</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line56">line 56</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="Layer.html">Layer</a>></span> </dd> </dl> <h4 class="name" id=".getLayers"><span class="type-signature">(static) </span>getLayers<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Layers>}</span></h4> <div class="description"> 返回当前地图所包含的图层集合对象。 </div> <dl class="details"> <dt class="important tag-deprecated">Deprecated:</dt><dd class="yes-def tag-deprecated"><ul class="dummy"><li>Yes</li></ul></dd> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line93">line 93</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Layers></span> </dd> </dl> <h4 class="name" id=".getLayersCount"><span class="type-signature">(static) </span>getLayersCount<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Promise.count>}</span></h4> <div class="description"> 返回此图层集合中图层对象的总数。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line110">line 110</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Promise.count></span> </dd> </dl> <h4 class="name" id=".getTrackingLayer"><span class="type-signature">(static) </span>getTrackingLayer<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="TrackingLayer.html">TrackingLayer</a>>}</span></h4> <div class="description"> 返回当前地图的跟踪图层。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line222">line 222</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="TrackingLayer.html">TrackingLayer</a>></span> </dd> </dl> <h4 class="name" id=".getViewBounds"><span class="type-signature">(static) </span>getViewBounds<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;Promise.bound>}</span></h4> <div class="description"> 返回当前地图的可见范围,也称显示范围。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line271">line 271</a> </li></ul></dd> </dl> <h5>Returns:</h5> <div class="param-desc"> - 返回Bounds的JSON对象:如{top:0,bottom:0,left:0,right:0,height:0,width:0,center:{x,y}} </div> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Promise.bound></span> </dd> </dl> <h4 class="name" id=".isDynamicProjection"><span class="type-signature">(static) </span>isDynamicProjection<span class="signature">(bounds)</span><span class="type-signature"> &rarr; {Promise.&lt;Promise.is>}</span></h4> <div class="description"> 返回是否允许地图动态投影显示(该接口为安卓端专有接口,iOS无此接口)。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>bounds</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line300">line 300</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Promise.is></span> </dd> </dl> <h4 class="name" id=".mapToPixel"><span class="type-signature">(static) </span>mapToPixel<span class="signature">(point2D)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Point.html">Point</a>>}</span></h4> <div class="description"> 将地图中指定点的地图坐标转换为像素坐标。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>point2D</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line171">line 171</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="Point.html">Point</a>></span> </dd> </dl> <h4 class="name" id=".moveDown"><span class="type-signature">(static) </span>moveDown<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;bool>}</span></h4> <div class="description"> 图层下移一层(图层的索引从 0 开始,从顶层开始依次编号)。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> </td> <td class="description last">图层的名字。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line535">line 535</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;bool></span> </dd> </dl> <h4 class="name" id=".moveUp"><span class="type-signature">(static) </span>moveUp<span class="signature">(name)</span><span class="type-signature"> &rarr; {Promise.&lt;bool>}</span></h4> <div class="description"> 图层上移一层(图层的索引从 0 开始,从顶层开始依次编号)。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>name</code></td> <td class="type"> </td> <td class="description last">图层的名字。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line550">line 550</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;bool></span> </dd> </dl> <h4 class="name" id=".open"><span class="type-signature">(static) </span>open<span class="signature">(mapName)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 打开指定名称的地图。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>mapName</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">地图名称</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line125">line 125</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".pan"><span class="type-signature">(static) </span>pan<span class="signature">(offsetX, offsetY)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 将地图平移指定的距离。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>offsetX</code></td> <td class="type"> <span class="param-type">double</span> </td> <td class="description last">X 方向上的移动距离,单位为坐标单位。</td> </tr> <tr> <td class="name"><code>offsetY</code></td> <td class="type"> <span class="param-type">double</span> </td> <td class="description last">Y 方向上的移动距离,单位为坐标单位。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line418">line 418</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".pixelToMap"><span class="type-signature">(static) </span>pixelToMap<span class="signature">(point)</span><span class="type-signature"> &rarr; {Promise.&lt;<a href="Point2D.html">Point2D</a>>}</span></h4> <div class="description"> 将地图中指定点的像素坐标转换为地图坐标。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>point</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line152">line 152</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;<a href="Point2D.html">Point2D</a>></span> </dd> </dl> <h4 class="name" id=".refresh"><span class="type-signature">(static) </span>refresh<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 重新绘制当前地图。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line42">line 42</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".removeLayer"><span class="type-signature">(static) </span>removeLayer<span class="signature">(index<string/number>)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 用于把一个图层移除。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>index<string/number></code></td> <td class="type"> </td> <td class="description last">要移除图层的名字或序号。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line497">line 497</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".save"><span class="type-signature">(static) </span>save<span class="signature">(mapName)</span><span class="type-signature"> &rarr; {Promise.&lt;Promise.saved>}</span></h4> <div class="description"> 将当前地图保存/另存为指定名称的地图 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>mapName</code></td> <td class="type"> <span class="param-type">string</span> </td> <td class="description last">地图名称(可选参数)</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line239">line 239</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;Promise.saved></span> </dd> </dl> <h4 class="name" id=".setCenter"><span class="type-signature">(static) </span>setCenter<span class="signature">(point2D)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 设置当前地图的显示范围的中心点。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>point2D</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line209">line 209</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".setDynamicProjection"><span class="type-signature">(static) </span>setDynamicProjection<span class="signature">(value)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 设置地图是否动态投影显示,以及地图的投影坐标系 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>value</code></td> <td class="type"> <span class="param-type">boolean</span> </td> <td class="description last">地图是否动态投影</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line315">line 315</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".setMapLoadedListener"><span class="type-signature">(static) </span>setMapLoadedListener<span class="signature">(onMapLoaded)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 获取用于接收地图加载完成的监听器。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>onMapLoaded</code></td> <td class="type"> <span class="param-type">function</span> </td> <td class="description last">地图打开并显示完成后触发该方法。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line329">line 329</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".setMapOperateListener"><span class="type-signature">(static) </span>setMapOperateListener<span class="signature">(events)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 添加一个用于接收地图打开、关闭事件的监听器。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>events</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">传入一个对象作为参数,该对象可以包含两个属性:mapOpened和mapClosed。两个属性的值均为function类型,分部作为打开地图和关闭地图监听事件的处理函数。例:{"mapOpened":()=>return console.log('map opened'),"mapClosed":()=> console.log('map closed')}</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line365">line 365</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".setViewBounds"><span class="type-signature">(static) </span>setViewBounds<span class="signature">(bounds)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 设置当前地图的可见范围,也称显示范围。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>bounds</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last">Bounds的JSON对象:如{top:0,bottom:0,left:0,right:0,height:0,width:0,center:{x,y}}</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line286">line 286</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".setWorkspace"><span class="type-signature">(static) </span>setWorkspace<span class="signature">(workspace)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 设置当前地图所关联的工作空间。地图是对其所关联的工作空间中的数据的显示。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>workspace</code></td> <td class="type"> <span class="param-type">object</span> </td> <td class="description last"></td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line29">line 29</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".viewEntire"><span class="type-signature">(static) </span>viewEntire<span class="signature">()</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 全幅显示此地图。 </div> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line431">line 431</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> <h4 class="name" id=".zoom"><span class="type-signature">(static) </span>zoom<span class="signature">(ratio)</span><span class="type-signature"> &rarr; {Promise.&lt;void>}</span></h4> <div class="description"> 将地图放大或缩小指定的比例。 </div> <h5>Parameters:</h5> <table class="params"> <thead> <tr> <th>Name</th> <th>Type</th> <th class="last">Description</th> </tr> </thead> <tbody> <tr> <td class="name"><code>ratio</code></td> <td class="type"> <span class="param-type">double</span> </td> <td class="description last">缩放地图比例,此值不可以为负。</td> </tr> </tbody> </table> <dl class="details"> <dt class="tag-source">Source:</dt> <dd class="tag-source"><ul class="dummy"><li> <a href="Map.js.html">Map.js</a>, <a href="Map.js.html#line445">line 445</a> </li></ul></dd> </dl> <h5>Returns:</h5> <dl> <dt> Type </dt> <dd> <span class="param-type">Promise.&lt;void></span> </dd> </dl> </article> </section> </div> <nav> <h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="BufferAnalyst.html">BufferAnalyst</a></li><li><a href="BufferAnalystParameter.html">BufferAnalystParameter</a></li><li><a href="DataDownloadService.html">DataDownloadService</a></li><li><a href="Dataset.html">Dataset</a></li><li><a href="DatasetVector.html">DatasetVector</a></li><li><a href="DatasetVectorInfo.html">DatasetVectorInfo</a></li><li><a href="Datasource.html">Datasource</a></li><li><a href="DatasourceConnectionInfo.html">DatasourceConnectionInfo</a></li><li><a href="DataUploadService.html">DataUploadService</a></li><li><a href="Feature.html">Feature</a></li><li><a href="FeatureSet.html">FeatureSet</a></li><li><a href="GeoLine.html">GeoLine</a></li><li><a href="Geometry.html">Geometry</a></li><li><a href="GeoPoint.html">GeoPoint</a></li><li><a href="GeoRegion.html">GeoRegion</a></li><li><a href="GeoStyle.html">GeoStyle</a></li><li><a href="Layer.html">Layer</a></li><li><a href="LayerSetting.html">LayerSetting</a></li><li><a href="LayerSettingVector.html">LayerSettingVector</a></li><li><a href="LocationManager.html">LocationManager</a></li><li><a href="Map.html">Map</a></li><li><a href="MapControl.html">MapControl</a></li><li><a href="MapView.html">MapView</a></li><li><a href="Navigation2.html">Navigation2</a></li><li><a href="OverlayAnalyst.html">OverlayAnalyst</a></li><li><a href="OverlayAnalystParameter.html">OverlayAnalystParameter</a></li><li><a href="Point.html">Point</a></li><li><a href="Point2D.html">Point2D</a></li><li><a href="QueryParameter.html">QueryParameter</a></li><li><a href="QueryService.html">QueryService</a></li><li><a href="Rectangle2D.html">Rectangle2D</a></li><li><a href="Scene.html">Scene</a></li><li><a href="Selection.html">Selection</a></li><li><a href="ServiceBase.html">ServiceBase</a></li><li><a href="ServiceQueryParameter.html">ServiceQueryParameter</a></li><li><a href="Size2D.html">Size2D</a></li><li><a href="Theme.html">Theme</a></li><li><a href="Track.html">Track</a></li><li><a href="TrackingLayer.html">TrackingLayer</a></li><li><a href="TraditionalNavi.html">TraditionalNavi</a></li><li><a href="Workspace.html">Workspace</a></li><li><a href="WorkspaceConnectionInfo.html">WorkspaceConnectionInfo</a></li></ul> </nav> <br class="clear"> <footer> Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Tue Aug 01 2017 16:16:50 GMT+0800 (CST) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>