I am using @react-google-maps/api library. I’ve integrated google map but I am facing marker label color, I tried very hard but didn’t find any solution. Could someone please help me with how to resolve this issue.
JavaScript
x
19
19
1
import {
2
Marker,
3
} from "@react-google-maps/api";
4
5
{markers.map(({ id, name, position }) => (
6
<Marker
7
key={id}
8
position={position}
9
onClick={() => handleActiveMarker(id)}
10
label={`${id}`}
11
>
12
{activeMarker === id ? (
13
<InfoWindow onCloseClick={() => setActiveMarker(null)}>
14
<div>{name}</div>
15
</InfoWindow>
16
) : null}
17
</Marker>
18
))}
19
Advertisement
Answer
Try this:
label: {text: `${id}`, color: "blue"}