diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index 594580f..ecb89f6 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,7 +1,6 @@
- - // Add any interactivity if needed. - - - - - diff --git a/src/routes/leaflet.svelte b/src/routes/leaflet.svelte index 014cb60..fe4e898 100644 --- a/src/routes/leaflet.svelte +++ b/src/routes/leaflet.svelte @@ -109,6 +109,59 @@ `; }); }); + + // Forecast request function + const getForecast = async () => { + // Create request object + const request = { + ascent_rate: parseFloat(ascentRate), + burst_altitude: parseFloat(burstAltitude), + dataset: new Date().toISOString(), // Current time as dataset timestamp + descent_rate: parseFloat(descentRate), + format: "json", + launch_altitude: parseFloat(startHeight), + launch_datetime: new Date( + `${startDate.getFullYear()}-${startDate.getMonth() + 1}-${startDate.getDate()}T${startTime}:00Z` + ).toISOString(), + launch_latitude: parseFloat(inputLat), + launch_longitude: parseFloat(inputLng), + profile: flightProfile === 'Normal' ? 'standard_profile' : 'custom_profile', + version: 2 + }; + + console.log("Sending request:", request); + + try { + // Example POST request - replace with your actual API endpoint + const response = await fetch('https://api.example.com/forecast', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify(request) + }); + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`); + } + + const data = await response.json(); + console.log("Forecast response:", data); + alert("Forecast request successful!"); + // Handle the response data as needed + } catch (error) { + console.error("Error sending forecast request:", error); + alert("Error getting forecast: " + error.message); + } + }; + + // Helper function to format date as YYYY-MM-DD + const formatDateForAPI = (date) => { + const year = date.getFullYear(); + const month = String(date.getMonth() + 1).padStart(2, '0'); + const day = String(date.getDate()).padStart(2, '0'); + return `${year}-${month}-${day}`; + };
diff --git a/src/routes/map.svelte b/src/routes/map.svelte index 270704f..4b90796 100644 --- a/src/routes/map.svelte +++ b/src/routes/map.svelte @@ -75,8 +75,8 @@
-
-

Lat: {mouseLat}, Lon: {mouseLng}

+
+ Lat: {mouseLat}, Long: {mouseLng}
@@ -92,24 +92,23 @@ #map { width: 100%; - height: calc(100% - 44px); /* Adjust height to account for navbar */ + height: 100%; position: absolute; - top: 40px; + top: 0; left: 0; } .coordinates-display { position: absolute; - top: 54px; + top: 10px; right: 10px; - background: #fff; /* Remove transparency */ - padding: 3px 8px; /* Reduce padding */ + background: rgba(255, 255, 255, 0.8); + padding: 5px 10px; + border-radius: 3px; font-family: Arial, sans-serif; font-size: 14px; z-index: 1000; /* Ensure it's above the map */ box-shadow: 0 0 5px rgba(0, 0, 0, 0.2); - border: 1px solid #ccc; /* Add card border */ - width: 150px; /* Fixed width */ } .panel-container { diff --git a/static/logo.svg b/static/logo.svg deleted file mode 100644 index 741bbe4..0000000 --- a/static/logo.svg +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - -