5 ms·
This is an interesting challenge, I'm building something similar for public transport, and the latency in updates tends to make things bad. On browsers I'm usi
by nevi-me 10y ago
This is an interesting challenge, I'm building something similar for public transport, and the latency in updates tends to make things bad.
On browsers I'm using turf.js to calculate movements and then animate them. I calculate where the bus/train is likely to be in the next 30 seconds, and then send that data through to the user. Then I keep updating the vehicle marker frequently until that 30 seconds time out, or until another update comes in.
I'm struggling to do the same on Android because I haven't found a good turf.js equivalent there.
- jumasheff 10y agoPerhaps React-Native with turf.js will solve this? Update: Here are React-Native Map components for Android and iOS https://github.com/airbnb/react-native-maps https://github.com/airbnb/react-native-maps
- nevi-me 10y agoI'm writing the parts of turf that I use in Kotlin for the JVM. Still early work, but I try put in 30 minutes if my tired hours into the project, before I sleep. I'll hopefully have something decent soon enough to make more progress with the vehicles thing.
- haar 10y agoAs you're using public transport might it be worth storing and using basic historical trends to bridge the gaps in data?
- hurricaneSlider 10y agoHi Neville :P
- nevi-me 10y agoHey Nick ;-)
- ReidZB 10y agoWhen I was in college, I built a tracking system for our campus's bus system. What frequency are your vehicles reporting their location back to your central service? We decided to use the cell network and had no real issues there (the buses would transmit their location every 1 sec).