AspireAB / TaxiDemo

Braindays demo
7 stars 3 forks source link

Zoom out aggregated view #3

Open rogeralsing opened 9 years ago

rogeralsing commented 9 years ago

Instead of showing individual vehicles on the map when zoomed out. we could pass the zoom level to the publisher actor and make it aggregate vehicle count in some sort of tiled view, take all vehicles in the user viewport group them by long and lat divided by some factor and display boxes/circles with vehicle count.

rogeralsing commented 9 years ago

Each known viewport can have a matrix och x*y cells. containing actor refs. when a position event is about to be sent to the clients, if the client have a zoom level of z, the sending actor (vehicle) is then added to the viewport matrix for the long / factor, lat/factor cell. and instead of sending a position event to the client, we can send a VehicleGroup event containing the long/lat for the center of that tile, and the number of vehicles in that tile.

this way, we are still completely reactive, even when aggregating data