Override the Timeline.DefaultEventSource.Event.prototype.getIcon
function, set some attribute on the event and call paint() on the
timeline object.
For example, if my event has a "status" attribute, I can update that
attribute when I need to. Then, the new getIcon function will look at
that value and decide what icon to use.
Timeline.DefaultEventSource.Event.prototype.getIcon = function() {
var status = this.getProperty('status');
switch (status) {
case "normal" : return "normal_icon.png";
case "problem" : return "problem_icon.png";
case "error" : return "error_icon.png";
default: return "generic_icon.png";
}
}
There's plenty of ways of deciding how you wish to map your icons to
your events. But I would recommend that you do so by modifying some
known attribute of the event itself, and letting the getIcon function
figure out which icon to display, rather than relying on setting the
icon url directly for the event. Keep the presentation (icon) separate
from the object (your event).
--Mike Nosal
On Sep 24, 2008, at 1:00 PM, MPS wrote:
>
> I need to change my event marker images on demand.
>
> What's the best way to do that?
>
> Thanks!
>
> - Michael
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"SIMILE Widgets" 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/simile-widgets?hl=en
-~----------~----~----~----~------~----~------~--~---