UNPKG

imobile_for_javascript

Version:

iMobile for JavaScript,是SuperMap iMobile推出的一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。

40 lines (33 loc) 888 B
/** * Created by will on 2016/7/27. */ let React = require('react'); let {requireNativeComponent,View}=require('react-native'); class SMCallOut extends React.Component{ constructor(){ super(); this._onChange = this._onChange.bind(this); } state = { viewId:0, } static propTypes = { viewId:React.PropTypes.number, ...View.propTypes, }; _onChange = (event) => { console.log("callout viewId:"+event.nativeEvent.callOutId); this.setState({ viewId:event.nativeEvent.callOutId }) } render(){ var props = {...this.props}; props.returnId = true; return <RCTCallOut {...props} onChange={this._onChange}></RCTCallOut>; } } var RCTCallOut = requireNativeComponent('RCTCallOut',SMCallOut,{nativeOnly:{ returnId:true, }}); export default SMCallOut;