R. Daneel Olivaw
unread,Oct 21, 2011, 1:49:45 AM10/21/11Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to PhiloGL
Hello,
I love the animated flight paths in World Flights 2 -- thank you for
the upgrade! :)
I am trying to modify the code so that the paths disappear as soon as
they are complete, but I'm not sure where I would place the call to
airlineMgr.remove to do this. I have tried the below (in index.js),
using setTimeout, but it causes the paths to be removed too quickly.
There must be a better way to do this, but I am not yet familiar
enough with the code, or how the behaviors are wired in JS. Any
suggestions?
Thanks --
//when an airline is selected show all paths for that airline
airlineList.addEventListener('change', function(e) {
var target = e.target,
airlineId = target.id.split('-')[1];
function callback() {
if (target.checked) {
airlineMgr.add(airlineId);
centerAirline(airlineId);
setTimeout(airlineMgr.remove(airlineId),50000);
} else {
airlineMgr.remove(airlineId);
}
}