1

How do I show a local image for a GMarker? I am using v2. Code sample

var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = '/Images/marker/mr.png';
markerOptions = { icon: blueIcon };

map.setCenter(point, 3);
var marker = new GMarker(point, markerOptions);

Its not working...

Galen
  • 29,976
  • 9
  • 71
  • 89
coure2011
  • 40,286
  • 83
  • 216
  • 349
  • if you are ever interested here is how to do it in Google Maps V3 API http://stackoverflow.com/questions/5666173/google-maps-js-api-v3-simple-multiple-marker-example-with-custom-markers – KJYe.Name Apr 14 '11 at 16:27

2 Answers2

1

What's local to the map page is the Google Maps site itself, so if you want to use an image from your site, you have to provide the full URL for it.

Guffa
  • 687,336
  • 108
  • 737
  • 1,005
0

If you haven't seen the v2 docs, here is a link:

http://code.google.com/apis/maps/documentation/javascript/v2/overlays.html#Custom_Icons

Also, are you actually adding it to the map, or have you omitted that from your code?

Here is a full example:

http://code.google.com/apis/maps/documentation/javascript/v2/examples/icon-simple.html

ScottE
  • 21,530
  • 18
  • 94
  • 131