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

timkraut picture timkraut  路  3Comments

wayofthefuture picture wayofthefuture  路  3Comments

julienvincent picture julienvincent  路  3Comments

craigcartmell picture craigcartmell  路  4Comments

shrimpy picture shrimpy  路  3Comments