fix: display scanner name instead of "Your Position"
Show the scanner's configured name (or hostname if not set) in map markers and popups instead of the generic "Your Position" label. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -939,6 +939,7 @@ function updateMapMarkers() {
|
||||
const lon = parseFloat(document.getElementById('lon-input').value);
|
||||
|
||||
// Add center marker (this scanner) - distinct star shape
|
||||
const localScannerName = APP_CONFIG.scanner?.name || APP_CONFIG.scanner?.id || 'Scanner';
|
||||
const scannerIcon = `
|
||||
<div style="position:relative;width:24px;height:24px;">
|
||||
<svg viewBox="0 0 24 24" style="width:24px;height:24px;filter:drop-shadow(0 0 4px rgba(255,0,128,0.8));">
|
||||
@@ -952,7 +953,7 @@ function updateMapMarkers() {
|
||||
iconSize: [24, 24],
|
||||
iconAnchor: [12, 12]
|
||||
})
|
||||
}).addTo(map).bindPopup('📍 This Scanner');
|
||||
}).addTo(map).bindPopup(`📍 ${localScannerName}`);
|
||||
markers.push(centerMarker);
|
||||
|
||||
// Add peer scanner markers (async, won't block)
|
||||
@@ -1843,10 +1844,11 @@ function update3DMarkers() {
|
||||
const groundFloor = buildingConfig.groundFloorNumber || 0;
|
||||
|
||||
// Add scanner position marker at center (draggable for fine-grained positioning)
|
||||
const scannerName = APP_CONFIG.scanner?.name || APP_CONFIG.scanner?.id || 'Scanner';
|
||||
const scannerEl = document.createElement('div');
|
||||
scannerEl.className = 'marker-3d center draggable';
|
||||
scannerEl.innerHTML = `<div class="marker-icon">📍</div><div class="marker-floor">F${scannerFloor}</div>`;
|
||||
scannerEl.title = `Your Position - Floor ${scannerFloor} (drag to reposition)`;
|
||||
scannerEl.title = `${scannerName} - Floor ${scannerFloor} (drag to reposition)`;
|
||||
|
||||
const scannerOffset = (scannerFloor - groundFloor) * pixelsPerFloor;
|
||||
const scannerMarker = new maplibregl.Marker({
|
||||
@@ -1856,7 +1858,7 @@ function update3DMarkers() {
|
||||
})
|
||||
.setLngLat([lon, lat])
|
||||
.setPopup(new maplibregl.Popup().setHTML(`
|
||||
<strong>📍 Your Position</strong><br>
|
||||
<strong>📍 ${escapeHtml(scannerName)}</strong><br>
|
||||
Floor: ${scannerFloor}<br>
|
||||
Lat: ${lat.toFixed(6)}<br>
|
||||
Lon: ${lon.toFixed(6)}<br>
|
||||
|
||||
Reference in New Issue
Block a user