'Polygon', 'coordinates' => [ [ [-125.0, 24.0], [-66.0, 24.0], [-66.0, 49.0], [-125.0, 49.0], [-125.0, 24.0] ] ] ]; $locationJson = json_encode($location); $apiKey = defined('OWM_API_KEY') ? OWM_API_KEY : ''; if (empty($apiKey)) { echo json_encode(['error' => 'OpenWeatherMap API key not configured.']); exit; } $url = 'https://api.openweathermap.org/data/3.0/alerts?location=' . urlencode($locationJson) . '&appid=' . $apiKey; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, 'FlatlogicCesiumApp'); $response = curl_exec($ch); $httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpcode !== 200) { echo json_encode(['error' => 'Failed to fetch weather alerts.', 'http_code' => $httpcode, 'response' => $response]); exit; } echo $response; ?>