This simple code will work if your marker icons is a 20x34 pixel
image. This is the size of the default icon.
-----------------------------------------------
var gicon = new GIcon( G_DEFAULT_ICON );
gicon.image = 'path/to/images/my-custom-marker.png';
gicon.shadow = '';
var gmarker = new GMarker(
marker.latlng,
{
icon: gicon
}
);
-----------------------------------------------
I've turned off the icon shadows but if you have a 37x35 pixel image
for shadow you can populate the GIcon.shadow property. To customize
icon size, shadow, shadow size and more, documentation is available
at:
http://code.google.com/apis/maps/documentation/reference.html#GIcon
----
Salman - http://911-need-code-help.blogspot.com/
----
On Sep 30, 9:12 pm, Grok Lobster <[email protected]> wrote:
> You have enough markers that you should consider using a separate XML
> file like this,http://econym.org.uk/gmap/categories.htm
> In any case, you will have to define your different markers and then
> pass a reference of a particular marker to your createMarker function
> for each point.
>
> On Sep 30, 7:04 am, bvdhaegen <[email protected]> wrote:
>
> > Dear Sir,
>
> > I'm new here and I hope I post this question in the right forum.
> > I have a google map API on my webpage
> > athttp://www.happycamel.com/gmap-alltourslast.htm
> > The markers show up nicely and I could add infowindows with the info I
> > need to add.
> > All the data is in the html code itself. I don't use xml or php-mysql.
>
> > I would like to use different icons. I have the icons I want to use in
> > my computer, but I don't know how to write the code so that the right
> > icon appears at the right place. I will not use just one icon, I want
> > to use different types of icons. I would like to add a code for every
> > marker so that the right icon is displayed.
>
> > It would be very nice if somebody could send me this code. I'm sure
> > it's not too complicated, but when you don't know how to do, you spend
> > hours looking around on the interenet.
>
> > Thanks a lot for your help.
>
> > Best Regards, Bernard
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/google-maps-api?hl=en
-~----------~----~----~----~------~----~------~--~---