How to change Gmap markers color?

19,886

Use the setImage method on the marker.

Marker[1].setImage('blue-icon.png');

http://gmaps-samples.googlecode.com/svn/trunk/whackamarker/whackamarker.htm

Share:
19,886
user191687
Author by

user191687

Updated on June 04, 2022

Comments

  • user191687
    user191687 almost 2 years

    I've a custom google map with different points:

    Markers[0] = new Array(new GMarker(new GLatLng(45.0, 9.0)), "Location1", "<strong>Address Line</strong><br/>Some information");
    Markers[1] = new Array(new GMarker(new GLatLng(45.0, 12.0)), "Location2", "<strong>Address Line</strong><br/>Some information");
    

    etc.

    Simply I want to change the color of the markers from the default red. I.E. the 2nd blue.

    How to do this?