【发布时间】:2019-03-15 04:26:25
【问题描述】:
我正在使用react-native-maps,效果很好。但是我有两个问题。
我可以使用
followsUserLocation自动跟踪用户位置,但是当我移动地图时,它会不断将我拖回用户位置。我该如何解决这个问题?-
我想要刷新按钮,当用户按下按钮时,我希望我的地图视图跟随用户位置。
constructor() { super(); this.state = { followsUserLocation: true, }; } mapView() { return( <MapView style={styles.map} showsUserLocation followsUserLocation={this.state.followsUserLocation} initialRegion={{ latitude: 37.523814, longitude: 126.927494, latitudeDelta: 0.0922, longitudeDelta: 0.0421}}/> ) }
任何 cmets 或建议将不胜感激!提前致谢!
【问题讨论】:
标签: javascript react-native react-native-maps