We are trying to use a custom icon for our marker using react-google-maps.
It is working, however the "anchor" of the icon appears to default to the top left of the pin (0,0) which does not work with our icon.
I can see that using the google-maps-api directly there is a .Point:
anchor: new google.maps.Point(17, 34)
But we can't see how to set this within the react-google-maps components.
Here is our code:
const icon = {
path: 'M32,0C20.8,0...',
fillColor: '#444',
fillOpacity: 1,
strokeWeight: 0,
scale: 0.75
};
....
<Marker position={marker.position} key={index} icon={icon} />
Ideally there would be some sort of anchor key we can set directly in our Icon object.
Any help would be greatly appreciated.
this usage example should work for you.