imobile_for_javascript
Version:
iMobile for JavaScript,是SuperMap iMobile推出的一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。
83 lines (74 loc) • 1.82 kB
JavaScript
import {NativeModules} from 'react-native';
let R = NativeModules.JSRecordset;
import Geometry from './Geometry.js';
import Dataset from './Dataset';
/**
* @class Recordset
* @deprecated
*/
export default class Recordset {
async getRecordCount(){
try{
var {recordCount} = await R.getRecordCount(this.recordsetId);
return recordCount;
}catch (e){
console.error(e);
}
}
async dispose(){
try{
await R.dispose(this.recordsetId);
}catch (e){
console.error(e);
}
}
async getGeometry(){
try{
var {geometryId} = await R.getGeometry(this.recordsetId);
var geometry = new Geometry();
geometry.geometryId = geometryId;
return geometry;
}catch (e){
console.error(e);
}
}
async isEOF(){
try{
var isEOF = await R.isEOF(this.recordsetId);
return isEOF;
}catch (e){
console.error(e);
}
}
async getDataset(){
try{
var {datasetId} = await R.getDataset(this.recordsetId);
var dataset = new Dataset();
dataset.datasetId = datasetId;
return dataset;
}catch (e){
console.error(e);
}
}
async addNew(geometry){
try{
await R.addNew(this.recordsetId,geometry.geometryId);
}catch (e){
console.error(e);
}
}
async moveNext(){
try{
await R.moveNext(this.recordsetId);
}catch (e){
console.error(e);
}
}
async update(){
try{
await R.update(this.recordsetId);
}catch (e){
console.error(e);
}
}
}