Do you have some sort of test condition to determine when to use which
icon?

var customIcon = (some test if DUI) ? 'arrestlist/markers/dui.png' :
'arrestlist/markers/bluesq3.png';

var marker = new google.maps.Marker({
            map: map,
            position: point,
            icon: customIcon
});

On Dec 7, 11:26 am, Ryan Wood <[email protected]> wrote:
> Hi,
>
> I am trying to use custom icons and at the same time change the
> default custom icon. Basically, I want to have my own default icon,
> and at the same time use a different default icon.
>
> My current code is:
>
>         var customIcons = {
>       all other than DUI: {
>         icon: 'arrestlist/markers/bluesq3.png',
>
>       },
>       DUI: {
>         icon: 'arrestlist/markers/dui.png',
>
>       }
>     };
>
> var marker = new google.maps.Marker({
>             map: map,
>             position: point,
>             icon: icon.icon
>           });
>
> I am trying to use a custom marker for charge=DUI. It works when I use
> icon: icon.icon, but all of my other icons are the default red google
> icon.
>
> How can I replace the google default icon, and still use the icon:
> icon.icon code?
>
> I have tried searching everywhere but cannot nail it down.
>
> Thanks in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to