kizniche / ttn-tracker

Download GPS data transmitted to The Things Network for live display on a map
https://kylegabriel.com/projects/2019/04/lorawan-tracker-and-mapper.html
62 stars 17 forks source link

Add filters to application #6

Closed tedenda closed 3 years ago

tedenda commented 3 years ago

I have used this app lately while mapping, but I would like to have some sort of filter in it. It would be nice if you can show only markers that is added last hour, today or for only one unit. Tried to figure it out my self but don't really get it to work and the web stuff I am not familiar with.

Can you give some tips and point in the right direction?

kizniche commented 3 years ago

To set the initial marker retrieval time frame, you can change '0': https://github.com/kizniche/ttn-tracker/blob/0e61599269709622e1944133a149f0a8ce4d0e2c/flask_app/templates/map.html#L138

To a different value, which determines how far in the past (in seconds) to pull the initial data. For instance, if you only want to see the past hour, set to 3600.

kizniche commented 3 years ago

Also, you can just comment out the devices you don't want to see on the map, in devices in flask_app/config.py

kizniche commented 3 years ago

I could probably figure out a way to do this on the map, with some sort of toggle on a legend. I will play around with it.

tedenda commented 3 years ago

I could probably figure out a way to do this on the map, with some sort of toggle on a legend. I will play around with it.

Thanks! If you feel for it, make a branch so I can see the development, I can probably learn something.

tedenda commented 3 years ago

Also, you can just comment out the devices you don't want to see on the map, in devices in flask_app/config.py

Yes, but not practical.

kizniche commented 3 years ago

If you feel for it, make a branch so I can see the development, I can probably learn something.

Sure. I have the dropdown selection working to change the time frame. Now working on clearing markers and populating from the selected timeframe.

kizniche commented 3 years ago

I just committed my changes. I managed to get both age selection and device visibility toggling working. Feel free to expand on anything if you would like.

tedenda commented 3 years ago

I have tried it out now and it's very nice! Thanks!

tedenda commented 3 years ago

I close this issue, it's fixed and working fine. Only thing left to do is maybe to update screenshot in readme to reflect this change.