⚠️ 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.
Installation
Add this line to your Gemfile:
gem 'google-map-weather-intregration'
Then run:
bundle install
Usage
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 hash
Forecast
weather.forecast # => array of forecast days
weather.next_day # => forecast hash for the next day
Convenience 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"