How to change color of marker in Google Map?

google-maps

Solution

Nope, if you wan't to customize your marker, you will need to use GIcon.

You can find a whole lot of free markers at the Google Maps Icons Project. The code to use a custom marker is pretty straightforward:

// Create our "tiny" marker icon
var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "http://gmaps-samples.googlecode.com/svn/trunk/markers/blue/blank.png";

// Set up our GMarkerOptions object
markerOptions = { icon:blueIcon };

// add the markerOptions as the second param to GMarker constructor
map.addOverlay(new GMarker(latlng, markerOptions));

Problem

I won't use GIcon to change for the marker.Any other ways to change color of marker???

Original source

Related problems