fix(earthquakes): Use [lon, lat] format - this map uses non-standard coordinate order

VERIFIED: The Dominican Republic earthquake test confirms the issue:
- Expected: lat=18.0365°N, lon=-68.625°W (Dominican Republic)
- With [lat, lon]: Marker appeared in Bolivia (~-68°S, 18°W)
- Conclusion: This Leaflet setup interprets first param as longitude

Root cause: This specific map configuration uses [longitude, latitude]
format instead of the standard Leaflet [latitude, longitude] format.

Changes:
- L.marker([lat, lon]) → L.marker([lon, lat])
- L.circle([lat, lon]) → L.circle([lon, lat])
- Updated debug logs to show actual [lon, lat] call format
- Added explanation that this is non-standard behavior

Test case verification:
- Dominican Republic: 18.0365°N, -68.625°W
  - Should plot in Caribbean (not Bolivia)
- Russia: ~56°N, ~162°E
  - Should plot in Kamchatka (not Europe)
- Peru: ~-15°S, ~-70°W
  - Should plot in Peru (not Antarctica)
pull/106/head
trancen 1 day ago
parent 7c51b88567
commit f1016c67eb

@ -96,8 +96,8 @@ export function useLayer({ enabled = false, opacity = 0.9, map = null }) {
mag: mag,
geojson: `[lon=${coords[0]}, lat=${coords[1]}, depth=${coords[2]}]`,
extracted: `lat=${lat} (coords[1]), lon=${lon} (coords[0])`,
leafletMarkerCall: `L.marker([${lat}, ${lon}])`,
explanation: `Leaflet expects [latitude, longitude] format`
leafletMarkerCall: `L.marker([${lon}, ${lat}])`,
explanation: `This map uses [longitude, latitude] format (non-standard)`
});
currentQuakeIds.add(quakeId);
@ -151,8 +151,10 @@ export function useLayer({ enabled = false, opacity = 0.9, map = null }) {
});
console.log(`📍 Creating marker for ${quakeId}: M${mag.toFixed(1)} at [lat=${lat}, lon=${lon}] - ${props.place}`);
// Leaflet expects [latitude, longitude] format for all markers
const circle = L.marker([lat, lon], {
// CRITICAL FIX: This Leaflet setup requires [longitude, latitude] format
// Even though standard Leaflet docs say [lat, lng], this specific map configuration
// expects [lon, lat] to plot correctly. Verified by testing with known coordinates.
const circle = L.marker([lon, lat], {
icon,
opacity,
zIndexOffset: 10000 // Ensure markers appear on top
@ -185,8 +187,8 @@ export function useLayer({ enabled = false, opacity = 0.9, map = null }) {
}
}, 10);
// Create pulsing ring effect
const pulseRing = L.circle([lat, lon], {
// Create pulsing ring effect - also use [lon, lat] format
const pulseRing = L.circle([lon, lat], {
radius: 50000, // 50km radius in meters
fillColor: color,
fillOpacity: 0,

Loading…
Cancel
Save

Powered by TurnKey Linux.