I am using google-maps-react package to create the Google map and using Marker to create the markers.
My Question: How can I add the marker label underneath the marker? Right now I have it displaying a title but its on-top of the marker.
I have screen shots of what I have now vs what I'm trying to accomplish besides the custom marker icon.
This is my function of creating the marker.
displayMarkers = () => {
const data = locationsData;
return data.map((location, index) => {
return (
<Marker
key={index}
id={index}
position={{
lat: location.latitude,
lng: location.longitude,
}}
label={location.state}
/>
);
});
};
Then this is my render to display the map then calling the display marker function.
render() {
const { google } = this.props;
return (
<Map google={google} zoom={4}>
{this.displayMarkers()}
</Map>
);
}
This is my marker now
This is what I'm trying to get too. Don't need all the styling just the text underneath