UNPKG

rn_supermap

Version:

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

204 lines (174 loc) 7.35 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: FeatureSet.js</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">Source: FeatureSet.js</h1> <section> <article> <pre class="prettyprint source linenums"><code>/********************************************************************************* Copyright © SuperMap. All rights reserved. Author: Wang zihao E-mail: pridehao@gmail.com **********************************************************************************/ import {NativeModules} from 'react-native'; let FS = NativeModules.JSFeatureSet; import Geometry from './Geometry.js'; /** * @class FeatureSet * @description 要素资源集合类。 */ export default class FeatureSet { /** * 删除要素 * @description 物理性删除指定要素集中的所有要素,即把要素从设备的物理存储介质上删除,无法恢复。 * @memberOf FeatureSet * @returns {Promise.&lt;void>} */ async deleteAll(){ try{ await FS.deleteAll(this._SMFeatureSetId); }catch (e){ console.error(e); } } /** * 用于删除当前要素,成功则返回 true。 * @memberOf FeatureSet * @returns {Promise.&lt;void>} */ async delete(){ try{ await FS.delete(this._SMFeatureSetId); }catch (e){ console.error(e); } } /** * 返回要素集合中要素的个数。 * @memberOf FeatureSet * @returns {Promise&lt;number>} */ async getFeatureCount(){ try{ var count = await FS.getFeatureCount(this._SMFeatureSetId); return count; }catch (e){ console.error(e); } } /** * 根据字段名指定字段,返回当前要素该字段的值。 * @memberOf FeatureSet * @param {string} fieldName - 字段名。 * @returns {Promise&lt;string>} */ async getFieldValue(fieldName){ try{ var value = await FS.getFieldValue(this._SMFeatureSetId,fieldName); return value; }catch (e){ console.error(e); } } /** * 获取当前要素中的几何对象。 * @memberOf FeatureSet * @returns {Promise.&lt;Geometry>} */ async getGeometry(){ try{ var {geometryId} = await FS.getGeometry(this._SMFeatureSetId); var geometry = new Geometry(); geometry._SMGeometryId = geometryId; return geometry; }catch (e){ console.error(e); } } /** * 返回要素集是否是只读的,如果是只读的,则返回 true,表示要素集中的信息将不可被修改。 * @memberOf FeatureSet * @returns {Promise.&lt;void>} */ async isReadOnly(){ try{ await FS.isReadOnly(this._SMFeatureSetId); }catch (e){ console.error(e); } } /** * 用于移动当前要素位置到第一个要素,使第一个要素成为当前要素。 * @memberOf FeatureSet * @returns {Promise.&lt;void>} */ async moveFirst(){ try{ await FS.moveFirst(this._SMFeatureSetId); }catch (e){ console.error(e); } } /** * 用于移动当前要素位置到最后一个要素,使最后一个要素成为当前要素。 * @memberOf FeatureSet * @returns {Promise.&lt;void>} */ async moveLast(){ try{ await FS.moveLast(this._SMFeatureSetId); }catch (e){ console.error(e); } } /** * 移动当前要素位置到下一个要素,使该要素成为当前要素。 * @memberOf FeatureSet * @returns {Promise.&lt;void>} */ async moveNext(){ try{ await FS.moveNext(this._SMFeatureSetId); }catch (e){ console.error(e); } } /** * 移动当前要素位置到上一个要素,使该要素成为当前要素。 * @memberOf FeatureSet * @returns {Promise.&lt;void>} */ async movePrev(){ try{ await FS.movePrev(this._SMFeatureSetId); }catch (e){ console.error(e); } } } </code></pre> </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:49 GMT+0800 (CST) </footer> <script> prettyPrint(); </script> <script src="scripts/linenumber.js"> </script> </body> </html>