A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developers.arcgis.com/javascript/latest/sample-code/scene-weather/ below:

Weather visualization | Sample Code | ArcGIS Maps SDK for JavaScript 4.33


Attention

The Weather widget is deprecated, and this sample uses legacy programming patterns. The recommended approach is to use components. Learn more about Esri's transition to web components.

This functionality is also available as a web component. See the Weather component sample for more details.

This sample exemplifies how to apply 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 blocks Copy

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 initialization 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 blocks Copy

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,
};

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4