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

Real time bus and shuttle updates #19

Closed
sirmammingtonham opened this issue Apr 16, 2020 · 5 comments
Closed

Real time bus and shuttle updates #19

sirmammingtonham opened this issue Apr 16, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects

Comments

@sirmammingtonham
Copy link
Owner

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.

https://github.com/Dammyololade/flutter_marker_animation

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.

@sirmammingtonham sirmammingtonham added enhancement New feature or request help wanted Extra attention is needed iOS issue affects iOS builds specifically android issue affects Android builds specifically low-priority Should be worked on in the near future labels Apr 16, 2020
@sirmammingtonham sirmammingtonham added this to the Clean up map clutter milestone Apr 16, 2020
@sirmammingtonham sirmammingtonham self-assigned this Apr 16, 2020
@sirmammingtonham
Copy link
Owner Author

sirmammingtonham commented Apr 16, 2020

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/)
The downside with this approach is that we won't have smooth animations, but i don't think that's really necessary at this point.

@sirmammingtonham sirmammingtonham added backend and removed android issue affects Android builds specifically iOS issue affects iOS builds specifically labels Apr 16, 2020
@sirmammingtonham sirmammingtonham changed the title Animated shuttle/bus markers along polylines Real time bus and shuttle updates Apr 16, 2020
@sirmammingtonham sirmammingtonham removed the low-priority Should be worked on in the near future label Apr 17, 2020
@samuelobe
Copy link

samuelobe commented May 12, 2020

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.

https://github.com/wtg/Flutter_ShuttleTracker

@sirmammingtonham
Copy link
Owner Author

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.

@samuelobe
Copy link

Yeah BLoC is super useful for state management!

@sirmammingtonham sirmammingtonham added this to In progress in dev Sep 4, 2020
@sirmammingtonham
Copy link
Owner Author

added in
7ff1900
813ed23
b5d6238
502d18e
1e77803

dev automation moved this from In progress to Done Nov 4, 2020
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
No open projects
dev
  
Done
Development

No branches or pull requests

4 participants