I have multiple coordinates like below
[
{lat: 35.0606118, lng: 128.0654182},
{lat: 35.8417043, lng: 127.1522446},
{lat: 35.0884086, lng: 128.0935447},
{lat: 35.1731054, lng: 128.0942915}
]
The above data is from props.locations. Therefore, I mapped this array into this. I am trying to show pins on Google Map using ‘@react-google-maps/api’. However, it does not show a single pin here.
<GoogleMap
id='map'
mapContainerStyle={mapContainerStyle}
zoom={8}
center={center}
options={options}
>
{props.locations.map((locations) => {
<Marker
position={{
lat: location.lat,
lng: location.lng,
}}
key={uuidv4()}
/>;
})}
</GoogleMap>