【发布时间】:2021-11-04 18:31:12
【问题描述】:
反应原生:https://github.com/expo/react-native/archive/sdk-42.0.0.tar.gz 反应:16.13.1 反应原生地图:0.28.0
我想将标记作为快照的一部分。当我们使用takeSnapshot 方法时,所有标记都会被忽略。
const snapshot = this.viewRefTest.takeSnapshot({
format: 'png', // image formats: 'png', 'jpg' (default: 'png')
quality: 0.5, // image quality: 0..1 (only relevant for jpg, default: 1)
result: 'file', // result types: 'file', 'base64' (default: 'file')
});
<MapView
ref={(viewRefTest) => {
this.viewRefTest = viewRefTest;
}}
showsUserLocation={true}
followUserLocation={true}>
<MapView.Marker coordinate={item.location}>
<Image
style={{ width: 30, height: 30 }}
source={require('../../assets/images/trophy.png')}
/>
<Callout style={{ width: 250, flexDirection: 'row', alignItems: 'center' }}>
<Text>$23</Text>
<View>
<Text style={{ fontSize: 12 }}>Custom Text!</Text>
</View>
</Callout>
</MapView.Marker>
</MapView>;
请告诉我这种可能性。
【问题讨论】:
标签: react-native maps react-native-maps