Closed dongchacha closed 6 years ago
没有解决,InfoWindow 里面的 onPress 就是没用的,最多只能用 onInfoWindowPress
这个以前是可以的,升级后步行了呢? 我以前自定义上面按钮是可以的 0.47 现在升级了0.57 不行了
那就是 RN v0.53 之后的自定义 View bug,readme 开头就说了的
@qiuxiang 可不可以发一下 React Native那边的 issue 链接
@heineiuo react native 相关的 issue 并没有找到,也一直没有时间来深究这个问题
@heineiuo 和你遇到同样的问题 react-native: 0.61.2
可以分享一下你的解决方案吗? wxingheng@outlook.com
@wxingheng 改变交互方式,点击maker之后弹出一层盖在MapView上。因为press maker的时候实际上可以拿到maker的位置信息,所以弹出层可以定位到你想要到位置。
rn版本0.56.0 amap3d版本1.0.1 ios真机
图片:
源码: import React, {Component} from 'react'; import { Text, View, Image, Platform, TouchableHighlight, Linking } from 'react-native'; import EStyleSheet from 'react-native-extended-stylesheet'; import { Say, Loading, Confirm } from '@/libs/btOverlay'; import { MapView } from 'react-native-amap3d'; import statisticsService from '@/services/statistics'; import { List, WhiteSpace, Button, WingBlank, NoticeBar, Picker, ActionSheet} from 'antd-mobile-rn'; import Ionicons from "react-native-vector-icons/Ionicons" import GConfig from '@/config' import Util from '@/libs/utils'
export default class Preload extends Component { constructor(props) { super(props); } state = { flowsCount: 0, meterCount: 0, centerPoint: null, pointList: [], currentPosition: null//当前用户定位 }
}
const styles = EStyleSheet.create({ wrapper: { flex: 1 }, tipBar: { backgroundColor: '#00edff63', color: '$red', padding: 10, borderBottomWidth: 1, borderBottomColor: '$lineColor' }, tipText: { // color: '$red', fontSize: 14, // marginBottom: 10, lineHeight: 20 }, tipCount: { // fontWeight: 'bold', fontSize:18, color: '$red' }, mapBox: { flex: 1, backgroundColor: 'red' }, customInfoWindow: { flex: 1, padding: 10, borderRadius: 3, backgroundColor: '#fff', marginTop: -73, marginLeft: -85, borderWidth: 1, borderColor: '$lineColor', position: 'relative', paddingRight: 60 }, overlayInfoText: { fontSize: 12, lineHeight: 20 }, locationBox: { position: 'absolute', right: 10, top: 20, // flex: 1, width: 40, height: 40, backgroundColor: '#48be39', borderRadius: 10, // textAlign: 'center', alignItems: 'center', borderRadius: 20, paddingTop: 5 }, locationIcon: { fontSize: 30, color: '#fff' }, overlayArrow: { position: 'absolute', bottom: -25, left: 80, zIndex: 10 } });