meshtastic-map icon indicating copy to clipboard operation
meshtastic-map copied to clipboard

Feature: show routers only

Open fifieldt opened this issue 1 year ago • 1 comments

Requested in liamcottle/meshtastic-map#25 , this patch adds a new Node layer selection to show only routers.

fixes liamcottle/meshtastic-map#25

fifieldt avatar May 20 '24 02:05 fifieldt

There are many different ways to implement this kind of thing, happy to engage in discussion :)

fifieldt avatar May 20 '24 02:05 fifieldt

I assume this is to find 'infrastructure' nodes. Ones there mainly just to extend the mesh, rather than clients. And typically in a fixed location.

Could this perhaps included REPEATER nodes too? In practice, the roles of routers and repeaters seem very similar, and it clients in theory will connect better in areas of such nodes. So as a 'user' it doesn't really matter if they router or repeaters. (althouugh suspect repeaters are more rare than routers)

Just thinking they might as well be included in the same layer.

barryhunter avatar May 31 '24 17:05 barryhunter

Great point, yes, let's update to add that category too.

fifieldt avatar May 31 '24 17:05 fifieldt

Thanks for this!

Ideally, I would like to be able to select a combination of different node roles to show at the same time. For example a list of checkboxes for each of the available roles.

However, I wasn't happy with how much space it required in the UI to show such options.

I've decided to merge in your method of just adding a layer with routers + repeaters as it's doesn't clutter the UI as much as showing all roles would.

I did adjust this layer so it uses clustering, otherwise it will end up lagging like the "All Nodes" layer.

liamcottle avatar Jun 06 '24 09:06 liamcottle

Thanks a lot @liamcottle ! Very much agree with your comments on UI design and having the other options :)

fifieldt avatar Jun 06 '24 09:06 fifieldt

Also, just a note, it seems there's a fun bug if you switch between the layers when zoomed right in.

It will fail to show nodes that are in another layer, unless you switch to "None" and back again. Seems to be related to the clustering plugin removing elements from the UI but not restoring again if it's in the next selected layer...

Something to investigate later. If you're zoomed all the way out, you can switch between all layers and they'll show up fine in clustering, but going from Clustered to Routers, for example, will fail to exactly show all the expected nodes... Kind of annoying. But unsure how to resolve this right now.

It still happened even when the routers layer was a normal layer group, as the default Clustered group will be causing it too.

liamcottle avatar Jun 06 '24 09:06 liamcottle

D'oh!

fifieldt avatar Jun 06 '24 10:06 fifieldt

Thanks for adding. The new layer looks good

I feel maybe maxClusterRadius could be tweaked a bit (maybe to 120). The routers layer is much less dense, and so could afford to show actual dots sooner.

Have seen something similar before when using multiple clusterlayeres on one map. I think it was related to adding the same actual marker to multiple layers. ... dont remember the exact resolution I think just created multiple markers (dont have the code to hand to check) - that would probably be a pain here, as your markers are quite involved with all the events. Just after posting found: https://github.com/Leaflet/Leaflet.markercluster/issues/381

  • In your example you are adding the same marker to two different marker cluster groups. This will cause bad times and is not supported. When the marker becomes unclustered all sorts of weirdness will happen.

barryhunter avatar Jun 06 '24 10:06 barryhunter

In your example you are adding the same marker to two different marker cluster groups. This will cause bad times and is not supported. When the marker becomes unclustered all sorts of weirdness will happen.

Lovely :) Good to know it's a known issue, unfortunate that it's unsupported but makes sense... I will likely have to rework how those markers are created so it's not janky. Will keep this in mind.

Thanks for adding. The new layer looks good

No worries! Apologies for taking so long to get around to reviewing and merging. I've been spending the last few weeks working on tools for the Reticulum Network Stack, and didn't have so much time to put into the Meshtastic Map...

Seems theres a big chunk of issues I need to go through 😅

liamcottle avatar Jun 06 '24 10:06 liamcottle