Almost... On May 20, 6:11 am, Nick <[email protected]> wrote: > Ok - so I think I get it... First you build the custom icon, defning > the points. Then you reference that name in the associative array - - > "new gicon()" > > So when you build your markers you can reference the name in your > associative array. I wasn't getting that middle step.. I was thinking > you could reference the name of your icon variable directly - - > > Thanks again everyone! - Nick > > // Custom Icon 1 > var blueIcon = new GIcon(); > blueIcon.image = "http://cf.bigfatdesigns.com/clients/natss/ > media/images/icon_college.png"; > blueIcon.shadow = "http://cf.bigfatdesigns.com/clients/natss/ > media/images/icon_shadow.png"; > blueIcon.iconSize = new GSize(40, 38); > blueIcon.shadowSize = new GSize(40, 38); > blueIcon.iconAnchor = new GPoint(20, 17); > blueIcon.infoWindowAnchor = new GPoint(15, 15); > blueIcon.infoShadowAnchor = new GPoint(15, 15); > > // Custom Icon 2 > var homeIcon = new GIcon(); > homeIcon.image = "http://cf.bigfatdesigns.com/clients/natss/ > media/images/icon_home.png"; > homeIcon.shadow = "http://cf.bigfatdesigns.com/clients/natss/ > media/images/icon_shadow.png"; > homeIcon.iconSize = new GSize(40, 38); > homeIcon.shadowSize = new GSize(40, 38); > homeIcon.iconAnchor = new GPoint(20, 17); > homeIcon.infoWindowAnchor = new GPoint(15, 15); > homeIcon.infoShadowAnchor = new GPoint(15, 15);
Actually, at this point you have two good markers, blueIcon and homeIcon. You could store them for later use in an associative array: var gicons = []; // intialized globally // after above icon initializations: gicons['blue'] = blueIcon; gicons['home'] = homeIcon; You would do the following if you were making still MORE icons, perhaps with the same image in a different color. Then you'd specify one of the above icons, plus the alternative image. > // Create some custom icons > // === Create an associative array of GIcons() === > var gicons = []; > gicons["blueIcon"] = new GIcon(blueIcon, "http:// > cf.bigfatdesigns.com/clients/natss/media/images/icon_college.png"); > gicons["homeIcon"] = new GIcon(homeIcon, "http:// > cf.bigfatdesigns.com/clients/natss/media/images/icon_home.png"); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
