Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show bus animations based on real bus arrival times #1

Open
luttje opened this issue Sep 27, 2024 · 0 comments
Open

Show bus animations based on real bus arrival times #1

luttje opened this issue Sep 27, 2024 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@luttje
Copy link
Member

luttje commented Sep 27, 2024

Currently the bus animations are set at an interval:

// TODO: Actually draw busses based on the API data, for now we just show busses arriving and going
function showTestBusses() {
// A bus that goes to the stop and when it arrives, after 2 seconds, it goes to the central destination
addBusToAnimationData(
busToCentral,
pointsOfInterest.toCentral.spawn,
pointsOfInterest.toCentral.stop,
fadeMode(FADE_IN),
(bus, index) => {
setTimeout(() => {
addBusToAnimationData(
busToCentral,
pointsOfInterest.toCentral.stop,
pointsOfInterest.toCentral.destination,
fadeMode(FADE_OUT),
);
removeBusFromAnimationData(index);
}, 500);
}
);
// Bus the other way around
addBusToAnimationData(
busToRoute,
pointsOfInterest.toRoute.spawn,
pointsOfInterest.toRoute.stop,
fadeMode(FADE_IN),
(bus, index) => {
setTimeout(() => {
addBusToAnimationData(
busToRoute,
pointsOfInterest.toRoute.stop,
pointsOfInterest.toRoute.destination,
fadeMode(FADE_OUT),
);
removeBusFromAnimationData(index);
}, 500);
}
);
}
showTestBusses();
setInterval(showTestBusses, 10000);

However addBusToAnimationData function could be called based on the current time and on the API data to sync the animation with bus arrival times.

I'm making a note of this in this issue, so someone can pick this up.

@luttje luttje added enhancement New feature or request help wanted Extra attention is needed labels Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant