React-google-maps: marker css style

Created on 20 Jul 2017  路  1Comment  路  Source: tomchentw/react-google-maps

Can I add styles to the marker, and how do I do it

Most helpful comment

You can add your own marker altogether or use Googles:

http://maps.google.com/mapfiles/ms/icons/blue-dot.png
http://maps.google.com/mapfiles/ms/icons/red-dot.png

or you can add stroke color:

icon: {
        path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
        strokeColor: "red",
        scale: 3
    },

Using the library you can do something like

<Marker
    onClick={() => this.mapClickHandler}
    icon={{
        url: myMarkerSVG,
        anchor: anchorPoint
    }}
    key={index}
    position={marker.location}
/>

Read through this for more information:
https://developers.google.com/maps/documentation/javascript/markers

>All comments

You can add your own marker altogether or use Googles:

http://maps.google.com/mapfiles/ms/icons/blue-dot.png
http://maps.google.com/mapfiles/ms/icons/red-dot.png

or you can add stroke color:

icon: {
        path: google.maps.SymbolPath.FORWARD_CLOSED_ARROW,
        strokeColor: "red",
        scale: 3
    },

Using the library you can do something like

<Marker
    onClick={() => this.mapClickHandler}
    icon={{
        url: myMarkerSVG,
        anchor: anchorPoint
    }}
    key={index}
    position={marker.location}
/>

Read through this for more information:
https://developers.google.com/maps/documentation/javascript/markers

Was this page helpful?
0 / 5 - 0 ratings

Related issues

corbpaul picture corbpaul  路  18Comments

fredcarle picture fredcarle  路  24Comments

idolize picture idolize  路  31Comments

SVITY picture SVITY  路  19Comments

jgoux picture jgoux  路  19Comments