better zIndexOffset

This commit is contained in:
Anton Roslund 2025-09-28 15:57:18 +02:00
parent 2d20bf293e
commit 0ffbf5e895

View file

@ -3543,6 +3543,14 @@
} }
} }
// determine zIndexOffset: MediumFast (1000), LongFast (-1000), Offline (-2000)
var zIndexOffset = 1000;
if(icon == iconOffline){
zIndexOffset = -2000;
} else if(node.channel_id == 'LongFast'){
zIndexOffset = -1000;
}
// determine if node was recently heard uplinking packets to mqtt // determine if node was recently heard uplinking packets to mqtt
//const nodeHasUplinkedToMqttRecently = hasNodeUplinkedToMqttRecently(node); //const nodeHasUplinkedToMqttRecently = hasNodeUplinkedToMqttRecently(node);
//if(nodeHasUplinkedToMqttRecently){ //if(nodeHasUplinkedToMqttRecently){
@ -3560,10 +3568,8 @@
const marker = L.marker([node.latitude + jitter, longitude + jitter], { const marker = L.marker([node.latitude + jitter, longitude + jitter], {
icon: icon, icon: icon,
tagName: node.node_id, tagName: node.node_id,
// we want to show online nodes above offline, but without needing to use separate layer groups // zIndex: offline (-2000) < has channel_id (-1000) < others (1000)
//zIndexOffset: nodeHasUplinkedToMqttRecently ? 1000 : -1000, zIndexOffset: zIndexOffset,
// show mediumfast nodes above longfast nodes
zIndexOffset: node.channel_id == "MediumFast" ? 1000 : -1000,
}).on('click', function(event) { }).on('click', function(event) {
// close tooltip on click to prevent tooltip and popup showing at same time // close tooltip on click to prevent tooltip and popup showing at same time
event.target.closeTooltip(); event.target.closeTooltip();