diff --git a/map4.js b/map4.js index d2a7968..f1fef7b 100644 --- a/map4.js +++ b/map4.js @@ -136,6 +136,19 @@ }); } + +// ピンクの待ち合わせピン +const meetIcon = L.icon({ + iconUrl: + "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-pink.png", + shadowUrl: + "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png", + iconSize: [25, 41], + iconAnchor: [12, 41], +}); + + + // =================================== // ピン生成 // =================================== @@ -167,17 +180,6 @@ selfMarker.addTo(map); } -// ピンクの待ち合わせピン -const meetIcon = L.icon({ - iconUrl: - "https://raw.githubusercontent.com/pointhi/leaflet-color-markers/master/img/marker-icon-pink.png", - shadowUrl: - "https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-shadow.png", - iconSize: [25, 41], - iconAnchor: [12, 41], -}); - - // =================================== // メンバー一覧 // =================================== @@ -209,13 +211,12 @@ const row = latestByDevice[member.device_id]; const nameElem = li.querySelector(".member-name"); - if (nameElem) nameElem.textContent = member.user_name; + if (member.user_name === currentHostName) { + nameElem.innerHTML = `👑 ${member.user_name}`; +} else { + nameElem.innerHTML = member.user_name; +} - let online = false; - if (row && row.updated_at) { - const diff = (Date.now() - new Date(row.updated_at)) / 1000; - online = diff < 6; - } li.classList.toggle("online", online); li.classList.toggle("offline", !online);