Where you have to start, when you want to make weather forecast app, is to find out the coordinates.
Since map Api provides these coordinates, this question is solved, but you have to know exact time in the location, where you want to show weather.
Most obvious idea is to use toLocaleString("en-US", options), limit output in options to hours and use this for your app.
const hours = new Date();
const options = {
timeZone:"America/New_York",
//weekday: "long",
// year: "numeric",
hourCycle:"h24",
hour:"numeric"
};
hours.toLocaleString("en-US", options);
This obvious approach though will return something like '05' for New York, which will have to be proceeded somehow for futher use.
There are services that provide time for selected coordinates, but there is a much simpler solution. We know that each 15 grades latitude
adds 1 hour to location time zone.
If we just divide latitude by 15 ,
we are about to get time difference of the clicked location with standard time, that we can obtain with js function:getUTCHours()
Now we have coordinates and localtime. After that we can ask weather provider api for weather reading for this place and time.
Below I have a map, where you can find ou weather on click whatever location you select.
Canvas Mask
Appointmets calendar
Particles Repeller
Welcome Your Guests
Rounded Corners
Circle of Light
Colors Palette
Particles interaction
Animating Mask
Animating Mask 2
Particles to Mouse
Particles to Mouse 2
Center Attraction
Mutual Attraction
Image Map
Using Shape
Animate SVG
Conversion