Skip to content

Commit 73f9b8c

Browse files
committed
Old text also added
1 parent 630d879 commit 73f9b8c

1 file changed

Lines changed: 5 additions & 12 deletions

File tree

frontend/src/components/MapComponent.jsx

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -264,24 +264,17 @@ export default function MapComponent() {
264264

265265
// Add click handler FIRST (this is the main functionality)
266266
marker.on('click', async () => {
267-
console.log('Marker clicked:', name); // Debug log
268-
269-
// Announce to screen readers
270-
try {
271-
announceToScreenReader(`Viewing details for ${name} with water temperature ${formattedTemp}`);
272-
} catch (e) {
273-
console.log('Screen reader announcement failed:', e);
274-
}
267+
// add prefix for grey (stale) points
268+
const labelPrefix = isStale ? '<strong>OLD:</strong> ' : '';
275269

276270
const historicalData = await fetchHistoricalData(name);
271+
const popupOffset = [17, -32];
277272

278-
// add once at top of click‐handler so you can reuse
279-
const popupOffset = [17, -32]; // x=0 (center), y=−45px (above marker)
280-
273+
// no historical data
281274
if (historicalData.length === 0) {
282275
marker.bindPopup(`
283276
<div role="dialog" aria-labelledby="popup-title-${i}">
284-
<h3 id="popup-title-${i}">${name}</h3>
277+
<h3 id="popup-title-${i}">${labelPrefix}${name}</h3>
285278
<p>No historical data available</p>
286279
<p>Current temperature: ${formattedTemp} (${tempCategory})</p>
287280
</div>

0 commit comments

Comments
 (0)