Weather visualization

Explore in the sandboxView live

This sample exemplifies how to apply the weather visualization to a SceneView. The clouds and weather effects like rain can also help to tell a story in a more realistic and immersive way. Click the "flooding" button to see the effects of an extreme rainfall event in the city of Utrecht, NL.

You can either specify the weather type in the environment property of the SceneView or add the Weather widget to your application and let the viewers explore different weather types. The five different weather types are sunny, cloudy, rainy, snowy, and foggy, and one can set them directly in the SceneView constructor:

Use dark colors for code blocksCopy
             
1
2
3
4
5
6
7
8
9
10
11
12
13
let view = new SceneView({
  container: "viewDiv",
  map: new Map({
    basemap: "satellite",
    ground: "world-elevation"
    }),
  environment: {
    weather: {
      type: "cloudy",     // autocasts as new CloudyWeather({ cloudCover: 0.3 })
      cloudCover: 0.3
    }
  }
});

The weather can also be set after the intialization of the view. Make sure to check the documentation of the different weather types for weather specific properties, like for example precipitation for rainy weather:

Use dark colors for code blocksCopy
     
1
2
3
4
5
view.environment.weather = {
  type: "rainy",     // autocasts as new RainyWeather({ cloudCover: 0.7, precipitation: 0.3 })
  cloudCover: 0.7,
  precipitation: 0.3
};

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