Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Hints for changes #9

@andersborgabiro

Description

@andersborgabiro

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") + " &deg;C"
                + "<br />" + "Temperature feels like: " + event.feature.getProperty("feelsLike") + " &deg;C" // requires changing the extraction of data as well
                + "<br />" + "Temperature max: " + event.feature.getProperty("max") + " &deg;C"
                + "<br />" + "Temperature min: " + event.feature.getProperty("min") + " &deg;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") + " &deg;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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions