A long-lived project that still receives updates
DEPRECATED: The MyWeather2 API that this gem depends on has been shut down since approximately 2020. All API calls will fail. This gem is no longer functional. Please migrate to one of these actively maintained alternatives: - open-meteo (https://open-meteo.com/) — free, no API key required - openweathermap (https://openweathermap.org/) — free tier available The gem will emit a deprecation warning on each use. Original purpose: fetched current weather conditions and multi-day forecasts by geographic coordinates (latitude/longitude) using the MyWeather2 API, for overlay alongside Google Maps in Rails applications.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 3.12
~> 3.0
 Project Readme

⚠️ 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"

Dependencies