首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >渲染时不显示列表的MapView.Markers

渲染时不显示列表的MapView.Markers
EN

Stack Overflow用户
提问于 2019-05-02 11:44:16
回答 1查看 78关注 0票数 0

我尝试在react原生应用程序上使用mapView.markers,它们工作得很好,但不知何故,当我试图从firebase数据库调用位置和信息列表时,它们没有显示在地图上。

配置文件

.........|_id: 1234

.........|_kind:"kind“

.........|_name:“名称”

.........|_location

.................|_0: 38.4015

.................|_1:-122.104641

和我的编程

代码语言:javascript
复制
<MapView
        onPress={this.props.onPress}
        rotateEnabled={false}
        style={styles.map}
        initialRegion={{
          latitude: 37.78825,
          longitude: -122.4324,
          latitudeDelta: 0.0922,
          longitudeDelta: 0.0421,
        }}
      >
        {this.state.profiles.slice(profileIndex).reverse().map(profile => (
          <MapView.Marker
            key={profile.id}
            coordinate={{ longitude: profile.location[0], latitude: profile.location[1] }}
            Title={profile.name}
            Description={profile.kind}
          >
            <View style={styles.radius2}>
              <Image style={styles.marker} source={require('../images/marcador.png')} />
            </View>
          </MapView.Marker>
        ))}
      </MapView>

我希望能看到所有的标记。

EN

回答 1

Stack Overflow用户

发布于 2019-05-02 20:56:16

根据您的代码,您将使用数组名称profiles。但是在您的问题中,您提到了数组名称是profile

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55945387

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档