Skip to content

SST hover tooltip not showing temperature on mouseover #37

@SL-Mar

Description

@SL-Mar

Problem

When hovering over the ocean with the SST layer active, no tooltip appears showing the sea surface temperature. All other weather layers (wind, waves, swell, currents, visibility) display hover tooltips correctly.

Investigation done

  • SST API data is valid: GET /api/weather/sst returns 120x221 grid with correct lat/lon, valid temperatures at known ocean points (e.g. Brest 11.28°C, North Sea 5.04°C)
  • Forecast frames endpoint also returns valid data (220x461 grid, 41 frames)
  • GridFieldData type matches the response shape (data: number[][], lats, lons)
  • getGridIndices and bilinearInterpolate work correctly with SST lat/lon ranges (ascending, 30-60°N, -15 to 40°E)
  • Ocean mask has some gaps (Tyrrhenian Sea returns False despite being ocean) but most ocean points pass the mask check
  • extendedWeatherData is set correctly in page.tsx for both single-frame and forecast paths
  • WaveInfoPopup receives sstData prop when weatherLayer === 'sst'
  • Code is structurally identical to the working visibility handler
  • No TypeScript compilation errors
  • No visible errors in frontend container logs
  • Added try-catch: no error thrown

Attempted fix (reverted)

Commit b7728a7 (reverted in b544014) added:

  • sst to ActiveLayer type union in WaveInfoPopup
  • sstData: GridFieldData | null prop + ref
  • SST handler with bilinear interpolation, °C/°F display, color coding
  • MapComponent wiring: sstData={weatherLayer === 'sst' ? extendedWeatherData as any : null}

Despite the code being correct on paper, the tooltip never appeared. Needs browser-side debugging (console, breakpoints) to identify root cause.

Possible causes to investigate

  • HMR/cache issue: browser serving stale bundle without SST handler
  • Silent JS error in mousemove handler (no try-catch in production path)
  • Data ref timing: sstRef.current may be null when handler fires
  • Leaflet event propagation issue specific to SST tile layer

Labels

Enhancement — SST layer UX

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendFrontend related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions