ROOT CAUSE IDENTIFIED:
The popup was appearing in the correct location (Japan) but the icon
was appearing elsewhere (Australia). This proved the marker position
was CORRECT but the icon visual was being offset.
PROBLEM:
CSS rule 'position: relative !important' on .earthquake-icon was
breaking Leaflet's marker positioning, causing icons to render far
from their actual marker positions.
SOLUTION:
- Removed 'position: relative' from .earthquake-icon CSS
- Removed 'position: relative' from .earthquake-icon div CSS
- Reverted to standard [lat, lon] format (popup confirmed this is correct)
The popups appearing in correct locations proved:
- Coordinate extraction is correct: lat=coords[1], lon=coords[0]
- Marker positioning is correct: L.marker([lat, lon])
- Only the icon visual rendering was broken by CSS
This explains why the issue persisted regardless of [lat,lon] vs [lon,lat]
testing - the CSS was always breaking the icon positioning.