rn_supermap
Version:
rn_supermap 一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。
52 lines (50 loc) • 1.38 kB
JavaScript
/**
* Created by will on 2016/7/5.
*/
import {NativeModules} from 'react-native';
let HC = NativeModules.JSHotChart;
import ChartView from './ChartView.js';
/**
* @class PieChart
*/
export default class HotChart extends ChartView{
constructor(){
super();
Object.defineProperty(this,"hotChartId",{
get:function(){
return this.chartviewId
},
set:function(hotChartId){
this.chartviewId = hotChartId;
}
})
}
/**
* 构造方法
* @memberOf HotChart
* @param {MapControl} mapControl
* @returns {Promise.<void>}
*/
async createObj(mapControl){
try{
var {hotChartId} = await HC.createObj(mapControl.mapControlId);
var hotchart = new HotChart();
hotchart.hotChartId = hotChartId;
return hotchart;
}catch(e){
console.error(e);
}
}
/**
* 设置色带
* @memberOf ChartView
* @returns {Promise.<void>}
*/
async setColorScheme(colorScheme){
try{
await HC.setColorScheme(this.hotChartId,colorScheme.colorSchemeId);
}catch(e){
console.error(e);
}
}
}