【发布时间】:2016-02-27 10:18:46
【问题描述】:
假设我以这种方式在 react native 中定义了一个地图:
render() {
return (
<View style={{flex: 1, position: 'relative'}}>
<MapView
style={styles.map}
showsUserLocation={this.state.showsUserLocation}
region={{
latitude: 48.8534100,
longitude: 2.3378000,
latitudeDelta: 0.12,
longitudeDelta: 0.065
}}
onRegionChangeComplete={
() => {
// How to retrieve coordinates and Delta when user moves the map
console.log(this.region);
}
} />
</View>
);
}
用户在地图上移动时如何获取坐标和Delta?
【问题讨论】:
标签: javascript components coordinates react-native