Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/csharp-4.0/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
React native 更新属性时出错';初始区域';从一个页面导航到另一个页面时,会出现由Airmap管理的视图的错误_React Native_React Native Maps - Fatal编程技术网

React native 更新属性时出错';初始区域';从一个页面导航到另一个页面时,会出现由Airmap管理的视图的错误

React native 更新属性时出错';初始区域';从一个页面导航到另一个页面时,会出现由Airmap管理的视图的错误,react-native,react-native-maps,React Native,React Native Maps,项目说明 "react-native": "0.63.3", "react-native-maps": "0.27.1" 我创建了两个页面,一个是Splash页面,另一个是Property details页面。我正在属性详细信息页面中使用Mapview。如果我直接加载属性详细信息页面,Mapview工作正常,但从启动页面导航时会出现此错误。 PropertyDetails.jsx import React, {

项目说明

"react-native": "0.63.3",
"react-native-maps": "0.27.1"
我创建了两个页面,一个是Splash页面,另一个是Property details页面。我正在属性详细信息页面中使用Mapview。如果我直接加载属性详细信息页面,Mapview工作正常,但从启动页面导航时会出现此错误。

PropertyDetails.jsx

import React, { useState } from 'react';

import {
    StyleSheet,
    Text,
    SafeAreaView,
    View,
    Dimensions,
} from 'react-native';
import MapView, { Marker, PROVIDER_GOOGLE } from "react-native-maps";
class PropertyDetails extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            show: false,
            region: {
                latitude: 51.5078788,
                longitude: -0.0877321,
                latitudeDelta: 0.009,
                longitudeDelta: 0.009
            }
        }
    }

    componentDidMount() {
        
    }

    render() {
        return (
            <View style={styles.container}>
                <MapView
                    provider={PROVIDER_GOOGLE}
                    style={styles.map}
                    region={{
                        latitude: 37.78825,
                        longitude: -122.4324,
                        latitudeDelta: 0.015,
                        longitudeDelta: 0.0121,
                    }}
                >
                </MapView>
            </View>
        );
    }
}

export default PropertyDetails;

const styles = StyleSheet.create({
    container: {
        ...StyleSheet.absoluteFillObject,
        height: 400,
        width: 400,
        justifyContent: 'flex-end',
        alignItems: 'center',
    },
    map: {
        ...StyleSheet.absoluteFillObject,
    },
})
请告诉我我做错了什么。 谢谢

dependencies {
    implementation fileTree(dir: "libs", include: ["*.jar"])
    //noinspection GradleDynamicVersion
    implementation "com.facebook.react:react-native:+"  // From node_modules

    implementation platform('com.google.firebase:firebase-bom:25.12.0')

    implementation(project(':react-native-maps')){
        exclude group: 'com.google.android.gms', module: 'play-services-base'
        exclude group: 'com.google.android.gms', module: 'play-services-maps'
    }
    implementation 'com.google.android.gms:play-services-base:17.2.1'
    implementation 'com.google.android.gms:play-services-maps:17.0.0'

    implementation 'com.google.firebase:firebase-analytics'

    implementation 'com.google.firebase:firebase-messaging'

    implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0"

    implementation 'androidx.multidex:multidex:2.0.1'

    debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") {
      exclude group:'com.facebook.fbjni'
    }

    debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
        exclude group:'com.squareup.okhttp3', module:'okhttp'
    }

    debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") {
        exclude group:'com.facebook.flipper'
    }

    if (enableHermes) {
        def hermesPath = "../../node_modules/hermes-engine/android/";
        debugImplementation files(hermesPath + "hermes-debug.aar")
        releaseImplementation files(hermesPath + "hermes-release.aar")
    } else {
        implementation jscFlavor
    }
}