UNPKG

rn_supermap

Version:

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

330 lines (291 loc) 11.4 kB
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>JSDoc: Source: ServiceQueryParameter.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: ServiceQueryParameter.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 SQP = NativeModules.JSServiceQueryParameter; import Rectangle2D from './Rectangle2D.js'; import Geometry from './Geometry.js'; /** * @class ServiceQueryParameter * @property {number} QueryOptionType.ATTRIBUTE - 查询结果中只有属性。 * @property {number} QueryOptionType.ATTRIBUTEANDGEOMETRY - 查询结果中包含属性和几何对象。 * @property {number} QueryOptionType.GEOMETR - 查询结果中只有几何对象。 */ export default class ServiceQueryParameter { /** * 创建一个ServiceQueryParameter参数 * @memberOf ServiceQueryParameter * @returns {Promise.&lt;ServiceQueryParameter>} */ async createObj(){ try{ var {_serviceQueryParameterId_} = await SQP.createObj(); var serviceQueryParameter = new ServiceQueryParameter(); serviceQueryParameter._SMServiceQueryParameterId = _serviceQueryParameterId_; return serviceQueryParameter; }catch (e){ console.error(e); } } /** * 设置查询范围。 * @memberOf ServiceQueryParameter * @param {object} rectangle2D - 查询范围。 * @returns {Promise.&lt;void>} */ async setQueryBounds(rectangle2D){ try{ await SQP.setQueryBounds(this._SMServiceQueryParameterId, rectangle2D._SMRectangle2DId); }catch (e){ console.error(e); } } /** * 获取查询范围。 * @memberOf ServiceQueryParameter * @returns {Promise.&lt;Rectangle2D>} */ async getQueryBounds(){ try{ var {rectangle2DId} = await SQP.getQueryBounds(this._SMServiceQueryParameterId); var rectangle2D = new Rectangle2D(); rectangle2D._SMRectangle2DId = rectangle2DId; return rectangle2D; }catch (e){ console.error(e); } } /** * 设置查询的距离。 * @memberOf ServiceQueryParameter * @param {number} distance - 查询距离 * @returns {Promise.&lt;void>} */ async setQueryDistance(distance){ try{ await SQP.setQueryDistance(this._SMServiceQueryParameterId, distance); }catch (e){ console.error(e); } } /** * 返回查询的距离。 * @memberOf ServiceQueryParameter * @returns {Promise} */ async getQueryDistance(){ try{ var distance = await SQP.getQueryDistance(this._SMServiceQueryParameterId); return distance; }catch (e){ console.error(e); } } /** *返回查询的几何对象。 * @memberOf ServiceQueryParameter * @returns {Promise.&lt;Geometry>} */ async getQueryGeometry(){ try{ var {geometryId} = await SQP.getQueryGeometry(this._SMServiceQueryParameterId); var geometry = new Geometry(); geometry._SMGeometryId = geometryId; return geometry; }catch (e){ console.error(e); } } /** * 设置查询的几何对象。 * @memberOf ServiceQueryParameter * @param {object} geometry - 要设置的几何对象。 * @returns {Promise.&lt;void>} */ async setQueryGeometry(geometry){ try{ await SQP.setQueryGeometry(this._SMServiceQueryParameterId, geometry._SMGeometryId); }catch (e){ console.error(e); } } /** * 获取查询的图层名称。 * @memberOf ServiceQueryParameter * @returns {Promise} */ async getQueryLayerName(){ try{ var name = await SQP.getQueryLayerName(this._SMServiceQueryParameterId); return name; }catch (e){ console.error(e); } } /** * 设置当前查询的图层的名称。 * @memberOf ServiceQueryParameter * @param {string} queryLayerName - 设置当前查询的图层的名称。 * @returns {Promise.&lt;void>} */ async setQueryLayerName(queryLayerName){ try{ await SQP.setQueryLayerName(this._SMServiceQueryParameterId, queryLayerName); }catch (e){ console.error(e); } } /** * 获取服务查询的地图的名称。 * @memberOf ServiceQueryParameter * @returns {Promise} */ async getQueryMapName(){ try{ var name = await SQP.getQueryMapName(this._SMServiceQueryParameterId); return name; }catch (e){ console.error(e); } } /** * 设置查询地图的地图名称。 * @memberOf ServiceQueryParameter * @param {string} mapName - 设置查询地图的地图名称。 * @returns {Promise.&lt;void>} */ async setQueryMapName(mapName){ try{ await SQP.setQueryMapName(this._SMServiceQueryParameterId, mapName); }catch (e){ console.error(e); } } /** * 返回查询结果内容类型。 * @memberOf ServiceQueryParameter * @returns {Promise} */ async getQueryOption(){ try{ var optionName = await SQP.getQueryOption(this._SMServiceQueryParameterId); return optionName; }catch (e){ console.error(e); } } /** * 设置查询结果内容类型。 * @memberOf ServiceQueryParameter * @param {ServiceQueryParameter.QueryOptionType} queryOptionType - 查询结果内容类型 * @returns {Promise.&lt;void>} */ async setQueryOption(queryOptionType){ try{ await SQP.setQueryOption(this._SMServiceQueryParameterId, queryOptionType); }catch (e){ console.error(e); } } /** *获取期望返回的查询记录个数。 * @memberOf ServiceQueryParameter * @returns {Promise} */ async getExpectRecordCount(){ try{ var count = await SQP.getExpectRecordCount(this._SMServiceQueryParameterId); return count; }catch (e){ console.error(e); } } /** * 设置期望返回的查询记录个数。 * @memberOf ServiceQueryParameter * @param {number} count - 设置期望返回的查询记录个数。 * @returns {Promise.&lt;void>} */ async setExpectRecordCount(count){ try{ await SQP.setExpectRecordCount(this._SMServiceQueryParameterId, count); }catch (e){ console.error(e); } } /** * 获取当前查询的服务的实例的服务名称。 * @memberOf ServiceQueryParameter * @returns {Promise} */ async getQueryServiceName(){ try{ var serviceName = await SQP.getQueryServiceName(this._SMServiceQueryParameterId); return serviceName; }catch (e){ console.error(e); } } /** * 获取当前查询的服务的实例的服务名称。 * @memberOf ServiceQueryParameter * @param {string} name - 当前查询的服务的实例的服务名称。 * @returns {Promise.&lt;void>} */ async setQueryServiceName(name){ try{ await SQP.setQueryServiceName(this._SMServiceQueryParameterId, name); }catch (e){ console.error(e); } } /** * 转成Json格式对象 * @memberOf ServiceQueryParameter * @returns {Promise.&lt;void>} */ async toJson(){ try{ var jsonString = await SQP.toJson(this._SMServiceQueryParameterId); var jsonOBj = JSON.parse(jsonString); return jsonOBj; }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>