Create and remove items from list (marker)

Hi, what is the best way to remove only inactive markers on a map?

The markers are created from online database but if a user close the app the marker remain in database.

What I think about is a timer in database so I have something like:

- user1
    - lat: "0.1"
    - long: "0.2"
    - timer:"17588451155"
- user2
    - lat: "0.3"
    - long: "0.4"
    - timer:"17588451255"

but how can I check if user timer is not changed for 10 min then don't put it on "create marker list"
Does is make any sense?
Thank you!

Compare the timer set in the database with the Clock.SystemTime block output, then do something if difference is greater than 1000x60x10 (ten minutes in milliseconds)

Thank you TIMAI2, so this is the "cleanest" solution?

can you help me with some blocks. I dont really know where to start.

I have this:

and I need to use for each item in list from 1 to :lenght of list: by1 to make a list of lat a list of long and a list of clocks ? and then when I compare clock how to know witch lat long to extract from coresponding index?
Very confused...

I would first sort out how you are storing your data to make life a bit easier. Can you store each record in a flat json like so:

{"ABC":{"lat":51.3,"lon":0.65,"clock":17144},"DEF":{"lat":51.4,"lon":0.69,"clock":17145}}

Then decode and test using dictionaries. Something like this:

firebase is in the sama format like yours but I cannot get it working. Is this correct?

test.aia (2.3 KB)

thank you very much for your help

It works OK, you need your test lat and lon to show on the displayed map!

i got it thank you

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.