在 react-native-maps 中旋转叠加层
Rotate Overlay in react-native-maps
有什么方法可以旋转 react-native-maps
中的 Overlay
组件吗?
我尝试使用 bearing
道具。但似乎该道具不可用。也尝试使用 style
道具旋转。也没用
<Overlay
image={IMAGE_URL}
style={{transform: [{ rotate: '90 deg' }]}} // not working
bearing={VALUE} // not working
bounds={BOUNDS}
location={LOCATION}
anchor={[0.5, 0.5]}
width={WIDTH}
height={WIDTH}
/>
我找到了解决方案。从 master 分支安装 react-native-maps
库。在 master 分支中, Overlay
组件具有 bearing
属性。使用以下命令
npm install https://github.com/react-native-maps/react-native-maps.git#master --save
有什么方法可以旋转 react-native-maps
中的 Overlay
组件吗?
我尝试使用 bearing
道具。但似乎该道具不可用。也尝试使用 style
道具旋转。也没用
<Overlay
image={IMAGE_URL}
style={{transform: [{ rotate: '90 deg' }]}} // not working
bearing={VALUE} // not working
bounds={BOUNDS}
location={LOCATION}
anchor={[0.5, 0.5]}
width={WIDTH}
height={WIDTH}
/>
我找到了解决方案。从 master 分支安装 react-native-maps
库。在 master 分支中, Overlay
组件具有 bearing
属性。使用以下命令
npm install https://github.com/react-native-maps/react-native-maps.git#master --save