On Apr 21, 8:01 am, Man_Hunt <[email protected]> wrote: > Hello. > I am very new to javascript coding and I've been trying to solve this > problem for days but have no luck so far. > I have google map api 2 on my website which has 5 markers that are > located in different places. Their icons are set to default. I want to > have different icons (pictures) for each marker. I have already > uploaded each picture to use for my marker but have no idea how to > apply it. > > I used this example to help me create 5 markers in different > placeshttp://econym.org.uk/gmap/basic1.htm > > Now I want to have differnt icons for each of these markers. > Here is a live link to my google map > website:http://0901820.studentweb.abertay.ac.uk/map.html > > As you can see in my source code I've been trying to add a custom icon > for each marker this way: > var greenIcon = new GIcon (G_DEFAULT_ICON); > greenIcon.image = "http://i53.tinypic.com/nczjf5.png"; > greenIcon.shadow = "http://i52.tinypic.com/1zd3zmb.png"; > greenIcon.iconSize = new GSize(30, 34); > greenIcon.shadowSize = new GSize(64, 34); > markerOptions = { icon:greenIcon }; > > But it doesnt seem to work, because I don't know how to actually > connect it to each marker separately.
Look at the GMarker icon option: http://code.google.com/apis/maps/documentation/javascript/v2/reference.html#GMarkerOptions.icon -- Larry > > I also want to move all the javascript code from my html page to a > separate .js file. I've been trying to do it different ways but it > never worked for me. Any ideas? > > I would really appreciate your help. Thank you very much! -- You received this message because you are subscribed to the Google Groups "Google Maps API V2" 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.
