Closed qilovehua closed 2 years ago
使用children即可,maker未激活时显示icon,激活时显示icon并在icon顶部显示图片
使用children即可,maker未激活时显示icon,激活时显示icon并在icon顶部显示图片
我这xcode模拟器上试了不行的,要么显示marker的icon,不然就显示children
你说的激活是点击marker? 不能一直显示吗
children={
this.state.showInfoWin[item.properties.index] ? <View
style={{
paddingVertical: 10,
paddingHorizontal: 5,
width: width * 0.8
}}>
<View
style={{
backgroundColor: Colors.whiteColor,
paddingHorizontal: 5,
paddingVertical: 4,
borderRadius: 5,
}}>
<View
style={{
flexDirection: "row",
paddingHorizontal: 5,
paddingVertical: 4,
borderRadius: 5
}}>
<Iconfont size={16} unicode={`\ue617`} color={Colors.successColor}/>
<Text style={{
fontSize: 14,
fontWeight: "bold",
marginHorizontal: 10,
color: Colors.successColor
}}>{item.properties.title}</Text>
</View>
<Text style={{
fontSize: 12,
color: Colors.darkColor,
paddingHorizontal: 5
}}>地址:{item.properties.address}</Text>
<Text style={{
fontSize: 12,
color: Colors.darkColor,
paddingHorizontal: 5,
marginVertical: 5
}}>联系电话:{item.properties.phone}</Text>
</View>
<View style={{
width: width * 0.8,
flexDirection: "row",
justifyContent: "center",
alignItems: "center"
}}>
<Iconfont size={28} unicode={`\ue8c4`}
color={Colors.successColor}/>
</View>
</View> : <Iconfont size={28} unicode={`\ue8c4`} color={Colors.successColor}/>
}
👍 谢谢! 我试了下放两个image显示不出来,就把两个图ps拼在一起显示了
想着marker上显示一句话,从marker源码并没有需要的参数, 该如何实现呢?
试着用marker的children,children和icon只能显示一个; children里放图片和icon也只能显示一个; 实在不行只能吧图片和icon做到一张图片里显示了。
"react-native": "0.66.4", "react-native-amap3d": "^3.1.1",