Re: please debug -- icon colors
iconStr is a string which is coming from the xml file in that example,
but you can pass it an argument from your array. If iconStr is one of
the strings the if then else is looking for it returns the GIcon that I
created with that colored icon.
The get_icon() function takes a string as an argument and returns an
object (a GIcon).
This function is equivalent to (modified from your page, but not
tested):
function get_icon(my_array_icon_value) {
switch (my_array_icon_value) {
default:
case "1":
var theIcon = baseIcon;
break
case "2":
var theIcon = yellowicon;
break
case "3":
var theIcon = blueicon;
break
case "4":
var theIcon = greenicon;
break
case "5":
var theIcon = orangeicon;
break
}
return theIcon;
}
-- Larry
0 Comments:
Yorum Gönder
<< Home