how to make multiple markers using react native with firebase?

Viewed 9

I just learned about RN. I'm confused to make many markers in 1 map but the data must be from firebase

<View style={{ alignItems: "center" }}>
          <View style={{ justifyContent: "center", alignItems: "center", marginTop: 10 }}>
            <MapView
              showsUserLocation={true}
              style={{ width: 350, height: 200, marginRight: 20, marginLeft: 20 }}
              initialRegion={{
                latitude: -2.92532,
                longitude: 132.29339,
                latitudeDelta: 0.00431,
                longitudeDelta: 0.0431,
              }}>
              <FlatList numColumns={4} data={Object.keys(this.state.data)} renderItem={({ item }) => {
                return (
                  <MapView.Marker coordinate={{ latitude: parseFloat(this.state.data[item].latitude), longitude: parseFloat(this.state.data[item].longitude) }}
                    pinColor={"red"}
                    title={this.state.data[item].nama}
                  />
                )
              }} />
         
            </MapView>
          </View>
        </View>
0 Answers
Related