imobile_for_javascript
Version:
iMobile for JavaScript,是SuperMap iMobile推出的一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。
27 lines (26 loc) • 653 B
JavaScript
/**
* Created by will on 2016/7/13.
*/
import { NativeModules } from 'react-native';
let P = NativeModules.JSPoint;
/**
* @class Point - 像素点类。用于标示移动设备屏幕的像素点。
*/
export default class Point{
/**
* 创建一个Point对象
* @param x - 像素坐标 x 的值
* @param y - 像素坐标 y 的值
* @returns {Promise.<Point>}
*/
async createObj(x,y){
try{
var {pointId} = await P.createObj(x,y);
var point = new Point();
point.pointId = pointId;
return point;
}catch (e){
console.error(e);
}
}
}