UNPKG

rn_supermap

Version:

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

44 lines (37 loc) 946 B
/** * Created by will on 2016/7/27. */ let React = require('react'); let {requireNativeComponent, View, ViewPropTypes, } = require('react-native'); import PropTypes from 'prop-types'; class SMCallOut extends React.Component{ constructor(){ super(); this._onChange = this._onChange.bind(this); } state = { viewId:0, } static propTypes = { viewId: PropTypes.number, ...ViewPropTypes, }; _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;