New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using symbol with Marker #382
Comments
See the Google Maps JS API docs example for adding a custom SVG icon: // This example uses SVG path notation to add a vector-based symbol
// as the icon for a marker. The resulting icon is a star-shaped symbol
// with a pale yellow fill and a thick yellow border.
function initMap() {
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: {lat: -25.363882, lng: 131.044922}
});
var goldStar = {
path: 'M 125,5 155,90 245,90 175,145 200,230 125,180 50,230 75,145 5,90 95,90 z',
fillColor: 'yellow',
fillOpacity: 0.8,
scale: 1,
strokeColor: 'gold',
strokeWeight: 14
};
var marker = new google.maps.Marker({
position: map.getCenter(),
icon: goldStar,
map: map
});
} So something like: const icon =
path: 'M 100 100 L 300 100 L 200 300 z',
fillColor: 'red',
strokeColor: 'blue',
strokeWidth: 3,
};
...
<Marker icon={icon} /> ...May be what you are looking for... |
Hey @mndewitt Thanks a lot. It resolved my issue. |
Please refer to Getting Help section in the README (or #469). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello there,
I want to use the
symbol
within marker, and I am using following code snippet:Am I missing anything?
The text was updated successfully, but these errors were encountered: