How To Change Ur Google Icon

how to change ur google icon

google map API v3 change marker icon on click? Stack

Following google documentation up to changing the marker icon was easy. But I'm stuck, I don't know how to change image when marker is clicked? My code so far: