Welcome to WebmasterWorld Guest from

Forum Moderators: open

Message Too Old, No Replies

Google Maps API help

how to use several different markers



12:07 pm on Oct 6, 2005 (gmt 0)

10+ Year Member

I can only find code that uses loops (as in the google tutorials) to create multiple original markers on a map. Can somebody please post the code I would use to add two different coloured small google pins to a map in slightly different locations.
I know you need:

var icon = new GIcon();
icon.image = "http://labs.google.com/ridefinder/images/mm_20_red.png";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(12, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

and you need to create and center the map using the usual code but what is the code to create and place the two different coloured small pegs with info windows on click.

for some reason I can't seem to find really simple examples of slightly more complicated options for google maps api.

Thank you.



2:01 pm on Oct 6, 2005 (gmt 0)

10+ Year Member

Should this be in the javascript forum?

If not then are there plans for a google maps api forum?

Just wondering as it seems to be very lonely in here.


6:04 pm on Oct 6, 2005 (gmt 0)

10+ Year Member

I found the answer myself. Finally got my hands on a map page that shows the points seperately:


went to there and viewed the source.


Featured Threads

Hot Threads This Week

Hot Threads This Month