MAD icon indicating copy to clipboard operation
MAD copied to clipboard

MADmin: Refactor data retrievel for the map

Open sn0opy opened this issue 4 years ago • 3 comments

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.

sn0opy avatar Jan 14 '20 12:01 sn0opy

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.

wraythex avatar Feb 06 '20 03:02 wraythex

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

sn0opy avatar Feb 06 '20 09:02 sn0opy

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)

ColdShadow80 avatar Feb 06 '20 10:02 ColdShadow80