我已将 react native 地图与我最新的 react native 应用程序集成在一起。在地图中,我想为地图设置边界。官方文档建议了该方法
setMapBoundaries
,但它需要这样的论点northEast: LatLng, southWest: LatLng
。
我怎样才能获得这些参数的值。我的mapView是这样的。
<MapView
showsUserLocation
provider={MapView.PROVIDER_GOOGLE}
style={styles.map}
region={region}
onRegionChangeComplete={this.onRegionChangeComplete}
setMapBoundaries={}
onUserLocationChange={this.onUserLocationChange}
>