if (uni_data[Id].Category = 10) {
    myIcon = '
http://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=books|7E2217'
    }
    else if (uni_data[Id].Category = 25) {
    myIcon = '
http://chart.apis.google.com/chart?chst=d_map_pin_icon&chld=books|E56717'
    }
    else if (uni_data[Id].Category = 50) {

You need to use double or triple equals. By using single equals, you're
actually assigning the value on the right hand side to the left hand side of
the expression.

On Fri, May 13, 2011 at 4:32 AM, [email protected]
<[email protected]>wrote:

> Hi
>
> I'm trying to change the colour of a marker using an if else statement and
> comapring it to a value in my data. I'm very stuck as I have practically no
> experience in this area. I've attached my code - which at the moment only
> sets the marker to the final colour - for anyone to have a look at and tell
> me where I'm going wrong.
>
> I'd be very thankful if somone could tell me how to chnage this so that I
> can a) compare to the data value and b) pass the value to my mapmarker
> function to change accordingly.
>
>
> Thanks
>
>
>
>
> --
> 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.
>



-- 
http://twitter.com/broady

-- 
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