更新属性时出错' Initial Reiongion'视图管理的视图:airmap

发布于 2025-02-05 18:46:57 字数 1304 浏览 3 评论 0原文

我正在使用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

Screenshot_2022-06-09-17-43-44-46_f73b71075b1de7323614b647fe394240

How to solve this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

↙厌世 2025-02-12 18:46:57

如果使用Expo,请记住使用此命令安装React-Native-Maps:

expo install 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:

expo install react-native-maps

Credits: https://github.com/react-native-maps/react-native-maps/issues/140#issuecomment-1127347250

桜花祭 2025-02-12 18:46:57

我也遇到了这个错误,但是在设置了我的Google地图并更新我的导入之后:

import MapView, { PROVIDER_GOOGLE, Marker } from 'react-native-maps';

它似乎解决了问题。

这是我遵循的教程: https:// https://instamobile.io/反应本地教程/Uber反应 - 本地地点/

I also encountered this error but then after setting up my google maps and updating my import like so:

import MapView, { PROVIDER_GOOGLE, Marker } from 'react-native-maps';

It seemed to solve the problem.

Here is the tutorial I followed: https://instamobile.io/react-native-tutorials/uber-react-native-geolocation/

败给现实 2025-02-12 18:46:57

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

所谓喜欢 2025-02-12 18:46:57

设置1:创建APK您的空白项目。使用此代码:

eas build --profile development --platform android

设置2:

expo install expo-ads-admob

设置3:

expo start --dev-client

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:

eas build --profile development --platform android

Setup 2:

expo install expo-ads-admob

Setup 3:

expo start --dev-client

Ref this code: code link

Ref link : https://www.youtube.com/watch?v=myDDG54OvkE&t=150s

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文