imobile_for_javascript
Version:
iMobile for JavaScript,是SuperMap iMobile推出的一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。
24 lines (21 loc) • 545 B
JavaScript
import {NativeModules} from 'react-native';
let L = NativeModules.JSLegend;
export default class Legend {
async createObjWithMap(map){
try{
var {legendId} = await L.createObjWithMap(map.mapId);
var legend = new Legend();
legend.legendId = legendId;
return legend;
}catch (e){
console.error(e);
}
}
async show(enable){
try{
await L.show(this.legendId,enable);
}catch (e){
console.error(e);
}
}
}