Find the real time weather forecast from this page
IMD Warnings
-----
No Warning - Green
Watch - Yellow
Alert - Orange
Warning - Red
`https://reactjs.imd.gov.in/geoserver/imd/wms?service=WMS&request=GetMap&layers=imd%3AWarnings_StateDistrict_Merged&env=day%3ADay3_Color&format=image%2Fsvg&transparent=true&version=1.1.1&width=256&height=256&srs=EPSG%3A4326&bbox=${bbox}`,
dist_warnings_today_plus_3: `https://reactjs.imd.gov.in/geoserver/imd/wms?service=WMS&request=GetMap&layers=imd%3AWarnings_StateDistrict_Merged&env=day%3ADay4_Color&format=image%2Fsvg&transparent=true&version=1.1.1&width=256&height=256&srs=EPSG%3A4326&bbox=${bbox}`,
dist_warnings_today_plus_4: `https://reactjs.imd.gov.in/geoserver/imd/wms?service=WMS&request=GetMap&layers=imd%3AWarnings_StateDistrict_Merged&env=day%3ADay5_Color&format=image%2Fsvg&transparent=true&version=1.1.1&width=256&height=256&srs=EPSG%3A4326&bbox=${bbox}`
};
}
// Function to display locations and warnings
function displayWarnings() {
const locationsDiv = document.getElementById("locations");
const today = new Date().toLocaleString('en-IN', { timeZone: 'Asia/Kolkata' });
document.getElementById("date").textContent = `Date: ${today}`;
coordinates.forEach(({ name, lat, lon }) => {
const warningsData = getWarningsData(lat, lon);
const locationDiv = document.createElement("div");
locationDiv.className = "location";
locationDiv.innerHTML = `
`; locationsDiv.appendChild(locationDiv); }); } // Call function to display warnings displayWarnings(); ]]>
Location: ${name} (${lat}, ${lon})
BBox: ${warningsData.bbox}
OSMAnd Web, GMaps, OSM Web, Geo URL
Nowcast Warnings | Today | Day +1 | Day +2 | Day +3 | Day +4 |
---|---|---|---|---|---|
`; locationsDiv.appendChild(locationDiv); }); } // Call function to display warnings displayWarnings(); ]]>
0 Response to "Real time Weather Forecast"
Post a Comment