google-maps-react
google-maps-react copied to clipboard
customzied marker
can i customized the marker? i want to change the icon to a div that i created
@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 may i know how to do it? https://levelup.gitconnected.com/reactjs-google-maps-with-custom-marker-ece0c7d184c4
@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