This repository was archived by the owner on Jan 10, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 147
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
Hints for changes #9
Copy link
Copy link
Open
Description
Change "http:" to "https:" for all Google and OpenWeather URLs, as the access to the page (and when embedded in code) will most likely be via https:.
Optionally extend to (for the heck of it):
infowindow.setContent(
"<img src=\"" + event.feature.getProperty("icon") + "\"/>" // note added quotation marks
+ "<br />" + "<strong>" + "City: " + event.feature.getProperty("city") + "</strong>"
+ "<br />" + "Weather: " + event.feature.getProperty("weather")
+ "<br />" + "Temperature: " + event.feature.getProperty("temperature") + " °C"
+ "<br />" + "Temperature feels like: " + event.feature.getProperty("feelsLike") + " °C" // requires changing the extraction of data as well
+ "<br />" + "Temperature max: " + event.feature.getProperty("max") + " °C"
+ "<br />" + "Temperature min: " + event.feature.getProperty("min") + " °C"
+ "<br />" + "Humidity: " + event.feature.getProperty("humidity") + " %"
+ "<br />" + "Pressure: " + event.feature.getProperty("pressure") + " hPa"
+ "<br />" + "Wind speed: " + event.feature.getProperty("windSpeed") + " m/s"
+ "<br />" + "Wind direction: " + event.feature.getProperty("windDegrees") + " °C"
);
windGust is not in the response data. Maybe only available in certain areas.
A key is needed for "https://maps.googleapis.com/maps/api/js", a la "https://maps.googleapis.com/maps/api/js?key=[some key]&libraries=geometry".
I don't know if geometry is required, but I tend to set it anyway.
I noted that you use different icons (img/w instead of img/wn) than OpenWeatherMap recommends. I didn't find any documentation for img/w, but on a map they provide better contrast than img/wn. In listings I use img/wn, mostly with @2x.png.
Cheers
Metadata
Metadata
Assignees
Labels
No labels