The simple idea here is to render group names/icons when zoomed out, but as you zoom in to switch to drawing individual units and names.
An easy method to check when this is appropriate is to - Calculate the average position on a group, and if all the units are less than a threshold distance (calculate in terms of screen-width of a proportion in the browser) you use a group icon.
A similar sort of distance check between units could be used check if its appropriate to draw text labels. As if there is a lot of clutter drawing the labels only adds 'noise' but if there is else around having the information is a bonus. This would mean in the case that there is only one player and nothing else their name would always be shown on the map.
The simple idea here is to render group names/icons when zoomed out, but as you zoom in to switch to drawing individual units and names.
An easy method to check when this is appropriate is to - Calculate the average position on a group, and if all the units are less than a threshold distance (calculate in terms of screen-width of a proportion in the browser) you use a group icon.
A similar sort of distance check between units could be used check if its appropriate to draw text labels. As if there is a lot of clutter drawing the labels only adds 'noise' but if there is else around having the information is a bonus. This would mean in the case that there is only one player and nothing else their name would always be shown on the map.
A while back I implemented similiar ideas into my communities group map tracker. - https://www.youtube.com/watch?v=yZZwG3hdWmo