Google-maps-react: customzied marker

Created on 30 Jun 2019  路  12Comments  路  Source: fullstackreact/google-maps-react

can i customized the marker?
i want to change the icon to a div that i created

Most helpful comment

import SchoolPin from "./pins/school.svg"

icon={{
url: SchoolPin,
anchor: new google.maps.Point(32,32),
scaledSize: new google.maps.Size(64,64)
}}

This worked for me.

All 12 comments

@alon-querySol This article explains how to do it https://medium.com/@morgannegagne/google-maps-with-react-951c12b723ad

@michaeltomasik this is for react-google-maps
@alon-querySol you should just be able to use icon={"custom-icon"} in the Marker props.

@deehyde 馃槺 I just noticed along with 5 downvotes 馃憥

import SchoolPin from "./pins/school.svg"

icon={{
url: SchoolPin,
anchor: new google.maps.Point(32,32),
scaledSize: new google.maps.Size(64,64)
}}

This worked for me.

can we customised the marker using self build components?

can we customised the marker using self build components?

Yes we can

@boyang1020 may i know how to do it?

@boyang1020 its a different library

@boyang1020 its a different library

My bad, just realized that. But I assume you can try similar ways.

i switched to that library, i looked through the codes of this google-maps-react, doesnt seem like customisable

except to import certain image or icon

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ktosiek picture ktosiek  路  3Comments

antonk52 picture antonk52  路  5Comments

S-Nakib picture S-Nakib  路  3Comments

colshacol picture colshacol  路  4Comments

kevinSuttle picture kevinSuttle  路  4Comments