有没有办法将地图限制在特定区域,以便平移和缩放包含在该区域内,而外部的所有内容都被锁定?我想限制用户可以在地图上看到的区域。
我通过react-native-maps使用谷歌地图https://github.com/react-community/react-native-maps https://github.com/react-community/react-native-maps
这是我的代码,目前您可以缩放多远或可以向两侧平移多少没有限制
<View style={styles.container}>
<MapView style={styles.map}
provider= { PROVIDER_GOOGLE }
customMapStyle={mapStyle}
initialRegion={{
latitude: 59.2937025,
longitude: 18.0813377,
latitudeDelta: 0.012,
longitudeDelta: 0.012,
}}
/>
</View>
None
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)