0
iOS用のReactネイティブアプリケーションを作成する方法を学習しようとしています。 react-native-maps
パッケージを使用し、MapView.Marker
を静的にレンダリングすると、マップに正しくレンダリングされます。しかし、マーカーの配列をレンダリングしたいときは、何も起こりません。ループ内の反応ネイティブマップマーカーがレンダリングされない
export default (props) => {
return (
<MapView
initialRegion={{
latitude: 48.99568000,
longitude: 21.24220000,
latitudeDelta: 0.001,
longitudeDelta: 0.01
}}>
{/* this works */}
<MapView.Marker
coordinate={{
latitude: 48.98975,
longitude: 21.24697
}}
/>
{/* this doesn't */}
{
props.points.nearby.map(point => {
<MapView.Marker
coordinate={{
latitude: point.lat,
longitude: point.lng
}}
/>
})
}
</MapView>
);
}
props.points.nearby
配列がOKで、3項目