ANALYSIS: All other markers in the app (DE, DX, Sun, Moon, POTA, etc.) use standard Leaflet [latitude, longitude] format: - L.marker([deLocation.lat, deLocation.lon]) - L.marker([sunPos.lat, sunPos.lon]) - etc. The earthquake layer MUST use the same format for consistency. Changes: - Reverted L.marker([lon, lat]) → L.marker([lat, lon]) - Reverted L.circle([lon, lat]) → L.circle([lat, lon]) - Added explicit logging showing exact coordinates passed to L.marker() - Created intermediate markerCoords variable for debugging Test verification: - Dominican Republic (18.0365°N, -68.625°W): - [lat, lon] = [18.0365, -68.625] → Dominican Republic ✓ - [lon, lat] = [-68.625, 18.0365] → Indian Ocean ✗pull/106/head
parent
f1016c67eb
commit
b506ea6139
@ -0,0 +1,28 @@
|
|||||||
|
// Test to understand the coordinate flow
|
||||||
|
|
||||||
|
// Sample Dominican Republic earthquake from USGS
|
||||||
|
const geojsonData = {
|
||||||
|
geometry: {
|
||||||
|
coordinates: [-68.625, 18.0365, 75.0] // [lon, lat, depth] - GeoJSON format
|
||||||
|
},
|
||||||
|
properties: {
|
||||||
|
place: "37 km S of Boca de Yuma, Dominican Republic"
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
// Current code extraction
|
||||||
|
const coords = geojsonData.geometry.coordinates;
|
||||||
|
const lat = coords[1]; // 18.0365
|
||||||
|
const lon = coords[0]; // -68.625
|
||||||
|
|
||||||
|
console.log("GeoJSON coordinates:", coords);
|
||||||
|
console.log("Extracted lat:", lat, "(should be 18.0365)");
|
||||||
|
console.log("Extracted lon:", lon, "(should be -68.625)");
|
||||||
|
console.log("");
|
||||||
|
console.log("If we call L.marker([lat, lon]):");
|
||||||
|
console.log(" L.marker([" + lat + ", " + lon + "])");
|
||||||
|
console.log(" This should plot at: 18.0365°N, 68.625°W (Dominican Republic)");
|
||||||
|
console.log("");
|
||||||
|
console.log("If we call L.marker([lon, lat]):");
|
||||||
|
console.log(" L.marker([" + lon + ", " + lat + "])");
|
||||||
|
console.log(" This would plot at: -68.625°S, 18.0365°E (Indian Ocean!)");
|
||||||
Loading…
Reference in new issue