I’ve just started programming with bubble and I’m really liking it.
I’m building an app that will keep track of a fleet of buses and show them all on a map.
Right now I was able to create an input area and display the various markers with the information I wanted.
But I’m having a really hard time keeping the positions updated in real time.
I want to show my users where the buses are so they can keep track if they’re arriving. I’ve tried run an script every 5 seconds but I got two problems.
First: it didn’t work. I tried updating the “thing” position and updating the markers on the map but neither worked.
Second: having an script every 5 seconds is just impractical. Since the bubble’s plans are limited by runs calls I would easily blow my limit if I were to do that.
My question is: is there a way of keeping my map’s information in real time?
If you have any suggestion or idea please let me know and I’ll try it as soon as possible.
That’s really the key to make this project happen.
I’ve searched on this forum for an answer my couldn’t find one that worked.
Anyway, thank you all very much for the help.
There’s an input area where the user can choose the line and the time of departure. There’s a “thing” called bus that has 3 fields: line, time and position. I assign the current geographic position to this bus.
I also created a field for “user” called “current bus”.
So my map has a list of markers and does a search for “Bus” with no restriction. That’s where I’m pulling the information from.
I hope my explanation was clear, if anything’s yet to be better explained just ask
So set a timer so that the page “times out” after say … 10 seconds. Then the user presses a button and it refreshes ?
Although maps do update “on their own” when adding new markers. Wonder why they don’t when the address is updated ?. Maybe you could exploit this by deleting and recreating each time ? You could run some sort of CRON job to pull the markers and call a Bubble API ?
That’s an interesting approach, refreshing the page I don’t think would be ideal. But remaking the map it might be possible.
What about this CRON job you mention? I’m not familiar with it, could you give a brief explanation so I can search how to work with it?
I’ll sure post here on the forum when I make some progress, I haven’t worked much on the app these last days due to work and college. But after I figure it out I’m going to write how I did it so people can get to the solution easier in case they need it too.
Consider that updating a field with auto-binding doesn’t add to the workflow count, and neither does loading / auto-updating markers on a map.
You’d want to check that the position has changed before updating it, and have a generous interval so as not to spam the servers.
Also, it might be more efficient to update via lat/long, rather than address, if you can figure out how to get that into an auto-bound field.