Map-A-Droid / MAD

Map PoGo stuff with Android devices
210 stars 135 forks source link

MADmin: Refactor data retrievel for the map #682

Open sn0opy opened 4 years ago

sn0opy commented 4 years ago

Right now, the map will request routes, prio routes, geofences and positions every few seconds.

Most things do not even require any calculations, but there's no need to retrieve those all the time if they're not actually activated on the map. In theory, we only need the names of routes and geofences to display them on in the sidebar.

Routes and Geofences could be loaded once on inital load. There's basically no need to change them live while being on the map. A reload will then just load the updated routes.

We might keep polling prio routes and worker locations though.

wraythex commented 4 years ago

I just did a git pull and see some odd behavior on the madmin map. I see it calling get_{workers, route, geofence, stops, and prioroute} every 5 seconds. However, it only calls get_gymcoords once during page load. If I'm zoomed in, reload, I'll see the gyms and stops in that view. But, if I then pan/zoom around it will only load additional stops on the map. It never loads any additional gyms.

Also, can we move get_route and get_geofence to be on page load only, or only on map change? That would help reduce cpu and network traffic.

sn0opy commented 4 years ago

I just did a git pull and see some odd behavior on the madmin map. I see it calling get_{workers, route, geofence, stops, and prioroute} every 5 seconds. However, it only calls get_gymcoords once during page load. If I'm zoomed in, reload, I'll see the gyms and stops in that view. But, if I then pan/zoom around it will only load additional stops on the map. It never loads any additional gyms.

fixed in 68f6b32

ColdShadow80 commented 4 years ago

Gyms and spawns are not currently clickable on mobile (tested with 2 phones, maps centers on gym/spawn position but does not present gym/spawn details data window)