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
Real time bus and shuttle updates #19
Comments
After looking into this with a little more detail, there are actually a lot more that we have to configure. Shuttle tracker uses iTrak to provide the real time updates, it's not as simple as animating a marker along a polyline. Our best bet would probably be to just poll that api (either shuttle tracker or we can ask for iTrak directly) every 10ish seconds and redraw those markers. This way we can also easily adapt this for the cdta api. (http://api.cdta.org/) |
Hello! I am currently the sole developer for the Flutter implementation of ShuttleTracker. I noticed this project on the RCOS page and it seems pretty cool. I use the flutter_map dependency and the BLoC library to poll the ShuttleTracker API for live updates of stops, routes, and shuttles. If y'all wanna check it out, it might be of some use to you guys. |
Thanks @samuelobe! We were actually looking at your implementation when brainstorming ways to utilize the shuttle tracker data, which was super helpful since shuttle tracker didn't have much documentation on the /updates feed. One of our goals for next semester is to utilize BLoC for state management and parsing the shuttle tracker jsons and GTFS data from the CDTA buses. |
Yeah BLoC is super useful for state management! |
Pretty big task, not entirely necessary either, however it would help improve the readability of the map. The goal is essentially to have a real-time update of the buses and shuttles on the map like the cdta website or rpi shuttle tracker.
Unfortunately, the actual google map widget in flutter just uses the default map view for the operating system, so it's not actually written in dart/flutter which means we'll have to code up some platform specific stuff if we want to animate the markers, and use a platform channel in flutter to display that (most likely requires redoing all of the map ui we've written so far).
Other option, we can fork the plugin repository and try to create this system from the ground up and submit a pull request. Seems way harder, but will help the flutter community in the future. This way we'll also be able to just integrate our changes with what we've already coded in smartrider.
Either way, here is an example someone made that contains platform specific code for animating markers in flutter. Potentially super helpful.
Last option, we use the projection api to build the marker widgets on a layer over the map. Takes a lot of computing power since we have to listen for any changes in the positions on the map and update where the markers are drawn. Animations would most likely be pretty slow, but if we can't make the other two options work then it might be our only choice.
The text was updated successfully, but these errors were encountered: