Query current weather conditions across the U.S.A

Query Weather Data from the Weather Stations feature layer provided in order to display weather conditions on the map.

Image of Weather Sample

How to Setup (Weather Sample Level)

  1. Open the RealTimeWeather level.
  2. Click on the ArcGISMap in the Hierarchy panel.
  3. Set your API key under the Authentication section in the Inspector Window.
  4. Click Play and select a city from the list.

How to Setup (Sample Viewer)

  1. Click Play in Unity Editor.
  2. Input your API key under the API Key Drop-down.
  3. Click the Sample Drop-Down and select Weather Query.

How it works

  1. Create a new C# script and make an HTTP request to query a feature layer.
  2. Create a new C# script
    • Create the function to place the data returned from the Weather Query.
    • Create a function to spawn the weather data class according to the data received in the query.
    • Attach the ArcGIS Location Component to the weather weather data Game Object.
    • Add additional functionality to spawn/show different Unity VFX based on the current weather data returned from the Weather Query.
  3. Create a UI for the viewport so users can select a city from the list fed from the feature service.

Note: You can use Unity Console to print log messages in the Console window and see if you are gathering the data properly from the feature service.

About the data

Data for Current Weather in the United States is fetched from a Feature Layer hosted by Esri. Elevation data is loaded from the Terrain 3D elevation layer hosted by Esri. Rain Sound effect Snow Sound Effect Thunder 1 Sound Effect Thunder 2 Sound Effect Thunder 3 Sound Effect


Feature Layer, Data Collection

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.