简体   繁体   English

react-native-maps 未完全加载

[英]react-native-maps not loaded fully

I have used react-native-maps in my project.我在我的项目中使用了react-native-maps But, after I zoom out or navigate inside the map, the map turns blank as shown in the figure as it is not loading.但是,在我缩小或在 map 内导航后,map 变为空白,如图所示,因为它没有加载。 What would be the solution?解决方案是什么?

Here is the code snippet:这是代码片段:

<MapView
        ref={mapRef}
        provider={PROVIDER_GOOGLE}
        showsUserLocation={true}
        showsMyLocationButton={true}
        zoomEnabled={true}
        style={styles.map}
        initialRegion={initialOrigin}
        onRegionChangeComplete={initialOriginChangeHandler}>
        <Marker
          coordinate={{
            latitude: initialOrigin.latitude,
            longitude: initialOrigin.longitude,
          }}
        />
      </MapView>

在此处输入图像描述

Firstly, avoid restricting your google API on https://console.cloud.google.com/ for now.首先,暂时避免在https://console.cloud.google.com/上限制您的 google API。 Secondly, add flex:1; height:400; width:400其次,添加flex:1; height:400; width:400 flex:1; height:400; width:400 flex:1; height:400; width:400 to your MapView from react-native-maps . flex:1; height:400; width:400react-native-maps到您的 MapView。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM