Weather Widget

Content Type: Widget
Categories: Utility,User Interface,Visualization

Overview

The Weather Widget is a Mendix widget developed by Intelizign that allows users to display current weather data on their Mendix app by fetching real-time weather information from the OpenWeather API. This widget provides essential weather data such as temperature, weather conditions, humidity, wind speed, and more. Additionally, it automatically fetches the user's geolocation (city) from the browser, requiring location access.

Documentation

Overview

The Weather Widget is a Mendix widget developed by Intelizign designed to display current weather data within your Mendix application. It retrieves real-time weather information from the OpenWeather API, presenting crucial details such as temperature, weather conditions, humidity, wind speed, and more. Notably, the widget automatically detects the user's location (city) using the browser's geolocation feature, thus requiring location access.

 

Key Features

  • Geo-location Access: Automatically fetches the user's city via the browser's geolocation API, eliminating the need for manual city input.
  • Real-Time Weather Data: Obtains up-to-the-minute weather information from the OpenWeather API.
  • Comprehensive Weather Information Display:
    • Current Temperature (in °C or °F)
    • Weather Condition (e.g., Sunny, Rainy)
    • Humidity Percentage (%)
    • Wind Speed (m/s)
    • Pressure (hPa)
    • Cloudiness (%)
    • Visibility (meters)
    • and more
  • Temperature Unit Selection: Allows users to choose between Celsius (°C) and Fahrenheit (°F) for temperature display.

Requirements

  • Mendix Version: 9.24.0 and above
  • API Key: A valid OpenWeather API key is necessary to access weather data.
  • Browser Geolocation: The widget relies on the browser's geolocation API to determine the user's current location. Users must grant location access for this functionality.
  • Internet Connection: An active internet connection is required as the widget fetches data from an online API.
  • Temperature Unit Selection: Option to display temperature in either Celsius (°C) or Fahrenheit (°F).

 

Installation

Prerequisites:

  1. OpenWeather API Key: You need to create an account with OpenWeather to obtain a valid API key.

  2. Install the Widget:

    • Download the Weather Widget package from the Mendix Marketplace.
    • Import the widget into your Mendix project using the App Store functionality within the Mendix Studio Pro or manually by importing the .mpk file via the "Import Module Package" option.

Configuration

Set API Key:

After successfully importing the widget into your project, you must configure it with your OpenWeather API key.

  1. Open the Widget Settings for the Weather Widget instance on your Mendix page.
  2. Locate the field for the OpenWeather API Key and enter the API key you obtained from OpenWeather.
  3. Select Temperature Unit: Choose your preferred temperature unit from the available options (Celsius (°C) or Fahrenheit (°F)).
  4. Ensure that location access is enabled in the browser for the geolocation functionality to work correctly.

Usage

How to Use in Your Mendix Application:

  1. Drag the Weather Widget from the Mendix Toolbox onto the desired page in your Mendix application.
  2. Configure the Widget:
    • In the widget's properties, set the OpenWeather API Key to authenticate data requests.
    • Select the desired Temperature Unit (Celsius or Fahrenheit).
  3. Preview: Once configured, when you run or preview your application, the widget will automatically attempt to retrieve the user's location and display the current weather information.

Troubleshooting

  • API Key Error: If the widget fails to display weather data and you suspect an issue with the API key, double-check that the key entered in the widget settings is correct and valid.
  • No Data Displayed: If the widget doesn't show any weather information, it might be due to the browser denying location access. Ensure that your browser (and the user's browser) has granted location permissions to your Mendix application.
  • Network Issues: If there are problems with the internet connection on the user's side or an issue with the OpenWeather API service, the widget may not be able to fetch or display updated weather data. Check your network connectivity and consider checking the status of the OpenWeather API.

License

This widget is released under the Intelizign EULA. See license details - Intelizign EULA.

 

Releases

Version: 1.0.0
Framework Version: 9.24.0
Release Notes: • Initial release of the Weather Widget for Mendix. • Added geolocation-based location fetching. • Provided both Celsius and Fahrenheit temperature display. • Added customizable temperature unit selection.