google-maps-react icon indicating copy to clipboard operation
google-maps-react copied to clipboard

customzied marker

Open alon-querySol opened this issue 6 years ago • 12 comments

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

alon-querySol avatar Jun 30 '19 09:06 alon-querySol

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

michaeltomasik avatar Jul 09 '19 13:07 michaeltomasik

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

deehyde avatar Oct 18 '19 14:10 deehyde

@deehyde 😱 I just noticed along with 5 downvotes 👎

michaeltomasik avatar Oct 18 '19 15:10 michaeltomasik

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.

tortcherx avatar Nov 22 '19 06:11 tortcherx

can we customised the marker using self build components?

jacky-ew avatar Sep 10 '20 09:09 jacky-ew

can we customised the marker using self build components?

Yes we can

boyang1020 avatar Sep 10 '20 18:09 boyang1020

@boyang1020 may i know how to do it?

jacky-ew avatar Sep 11 '20 00:09 jacky-ew

@boyang1020 may i know how to do it? https://levelup.gitconnected.com/reactjs-google-maps-with-custom-marker-ece0c7d184c4

boyang1020 avatar Sep 14 '20 21:09 boyang1020

@boyang1020 its a different library

jacky-ew avatar Sep 15 '20 01:09 jacky-ew

@boyang1020 its a different library

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

boyang1020 avatar Sep 15 '20 01:09 boyang1020

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

jacky-ew avatar Sep 15 '20 05:09 jacky-ew

except to import certain image or icon

jacky-ew avatar Sep 15 '20 05:09 jacky-ew