⚠️ DEPRECATED — The MyWeather2 API this gem depends on has been shut down since ~2020. All API calls will fail. Please migrate to open-meteo (free, no API key) or OpenWeatherMap.
google-map-weather-intregration
A Ruby gem to fetch weather data by geographic coordinates and surface it alongside Google Maps in Rails applications. Powered by the MyWeather2 API.
Tags: weather-api, google-maps, myweather2, geolocation, weather-forecast, rails, deprecated
Installation
Add this line to your Gemfile:
gem 'google-map-weather-intregration'Then run:
bundle installUsage
Initialize with your MyWeather2 API key and a lat/lng coordinate:
weather = WeatherApi.new("YOUR_API_KEY", 48.8584, 2.2945)Current conditions
weather.current # => raw current weather hashForecast
weather.forecast # => array of forecast days
weather.next_day # => forecast hash for the next dayConvenience methods
weather.day_max_temprature # => "22 C"
weather.day_type # => "Partly Cloudy"
weather.wind_speed # => "15 km/h"
weather.wind_direction # => "NW"
weather.wind_degree # => "315"Dependencies
Contributing
Since this gem is deprecated, open issues are mostly focused on smoothing the migration
path (adapters for open-meteo/OpenWeatherMap, README examples) rather than new features —
see the open issues list.
Some are tagged good first issue
if you'd like to help.