imobile_for_javascript
Version:
iMobile for JavaScript,是SuperMap iMobile推出的一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。
49 lines (46 loc) • 1.22 kB
JavaScript
/**
* Created by will on 2016/7/5.
*/
import {NativeModules} from 'react-native';
import ChartView from './ChartView.js';
let PC = NativeModules.JSPieChart;
/**
* @class PieChart
*/
export default class PieChart extends ChartView{
constructor(){
super();
Object.defineProperty(this,"piechartId",{
get:function(){
return this.chartviewId
},
set:function(piechartId){
this.chartviewId = piechartId;
}
})
}
/**
* 设置图表选中回调
* @memberOf ChartView
* @returns {Promise.<void>}
*/
async setChartOnSelected(){
try{
await PC.setChartOnSelected(this.piechartId);
}catch(e){
console.error(e);
}
}
/**
* 设置选中的对象ID
* @memberOf ChartView
* @returns {Promise.<void>}
*/
async setSelectedGeometryID(geoId){
try{
await PC.setSelectedGeometryID(this.piechartId,geoId);
}catch(e){
console.error(e);
}
}
}