更新属性时出错' Initial Reiongion'视图管理的视图:airmap
我正在使用expo
创建一个需要地图的应用程序。我探索并找到了mapView
React-Native-Maps
NPM软件包中的组件。我已经安装了它,然后仅在其文档中添加了以下代码,仅在其文档中仅请参阅。但是它显示了此错误:
Error while updating property 'initialRegion' of a view managed by: AIRMap
代码
import React, { useState } from "react";
import { StyleSheet, Text, View} from "react-native";
import MapView from "react-native-maps";
const Map = () => {
return (
<View style={styles.container}>
<Text style={styles.text}>
Maps
</Text>
<MapView
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
</View>
)
}
const styles = StyleSheet.create({
container: {
flex:1,
justifyContent:'center',
alignItems:'center'
},
text:{
fontSize:40,
margin:40,
}
})
export default Map;
,我仍然发现此错误
ScreenShot_2022-06-09-09-43-44-44-44-44-46_F73B71075B1DE7323614B647B647FE39424240
I am creating an app with expo
where I require map. I explored and found the mapView
component in react-native-maps
npm package. I installed it and just added the below code in a new component from their documentation only see. But it is showing this error:
Error while updating property 'initialRegion' of a view managed by: AIRMap
code
import React, { useState } from "react";
import { StyleSheet, Text, View} from "react-native";
import MapView from "react-native-maps";
const Map = () => {
return (
<View style={styles.container}>
<Text style={styles.text}>
Maps
</Text>
<MapView
initialRegion={{
latitude: 37.78825,
longitude: -122.4324,
latitudeDelta: 0.0922,
longitudeDelta: 0.0421,
}}
/>
</View>
)
}
const styles = StyleSheet.create({
container: {
flex:1,
justifyContent:'center',
alignItems:'center'
},
text:{
fontSize:40,
margin:40,
}
})
export default Map;
And I still found this error
How to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果使用Expo,请记住使用此命令安装React-Native-Maps:
credits: https://github.com/reaect-native-maps/react-native-maps/issues/140#issuecomment-1127347250
If using Expo, remember to install react-native-maps with this command:
Credits: https://github.com/react-native-maps/react-native-maps/issues/140#issuecomment-1127347250
我也遇到了这个错误,但是在设置了我的Google地图并更新我的导入之后:
它似乎解决了问题。
这是我遵循的教程: https:// https://instamobile.io/反应本地教程/Uber反应 - 本地地点/
I also encountered this error but then after setting up my google maps and updating my import like so:
It seemed to solve the problem.
Here is the tutorial I followed: https://instamobile.io/react-native-tutorials/uber-react-native-geolocation/
NPM Unistall React-Native-Maps
NPM安装react-native maps@^0.30.2
较旧的版本似乎有效
npm unistall react-native-maps
npm install react-native-maps@^0.30.2
the older version seems to work
设置1:创建APK您的空白项目。使用此代码:
设置2:
设置3:
ref此代码: a>
ref链接: https://www.youtube.com/watch?v.v.youtube.com/watch? = myddg54ovke&amp; t = 150S
Setup 1: Create APK Your blank project. Use This Code:
Setup 2:
Setup 3:
Ref this code: code link
Ref link : https://www.youtube.com/watch?v=myDDG54OvkE&t=150s