Я сообщаю местоположение пользователя в «mapview» со следующими кодами, но когда я переключаюсь на expo sdk 35, я получаю ошибку
constructor(props) {
super(props);
this.state = {
location: {
coords: {
latitude: 37.78825,
longitude: -122.4324,
longitudeDelta: 0.04250270688370961
}
},
};
}
let location = await Location.getCurrentPositionAsync({accuracy: Location.Accuracy.BestForNavigation});
this.setState({ locationResult: JSON.stringify(location) });
this.setState({ latitude:location.coords.latitude, longitude: location.coords.longitude});
this.setState({mapRegion: { latitude: location.coords.latitude, longitude: location.coords.longitude, latitudeDelta: 3, longitudeDelta: 3 }});
this.setState({location: { coords: { latitude: location.coords.latitude, longitude: location.coords.longitude, latitudeDelta: 3, longitudeDelta: 3 } }});
<MapView region={this.state.mapRegion} onRegionChangeComplete={this._handleMapRegionChange} draggable>
<MapView.Marker coordinate={this.state.location.coords} title={strings('Location.Buradasiniz')} />
</MapView>