react-native-naver-map
react-native-naver-map copied to clipboard
배열 marker 랜더링 issue
Version of react-native-naver-map libraries
v0.0.66
Version of react-native
Platforms you faced the error (IOS or Android or both?)
둘다
Expected behavior
맵뷰에 배열로 이루어진 마커를 출력해야함.
Actual behavior
맵 뷰에 마커를 하나씩 출력하는데 문제가 없지만 render 안에 map 함수를 사용할 때 출력이 되지 않습니다. 코드가 잘못된 건지 지원이 안되는 건지 여쭤봅니다.
code:
// 출력 가능한 마커
<NaverMapView>
<Marker
coordinate={this.state.storeCoordi[0].coordinate}
width={32}
height={32}
image={require('../../images/ic_store.png')}
/>;
</NaverMapView>
// 출력이 되지 않는 마커
<NaverMapView>
{
this.state.storeCoordi.map(item => {
<Marker
coordinate={item.coordinate}
width={32}
height={32}
image={require('../../images/ic_store.png')}
/>
})
}
</NaverMapView>
return으로 마커를 감싸주시면 정상작동할 것으로 보입니다
item => {}의 {}를 ()로 감싸면 됨