FlowRenderer with visual variables

This sample shows how to apply the FlowRenderer to an ImageryTileLayer to create an animated streamline visualization of wind speed and direction during Hurricane Ida in August 2021.

The FlowRenderer can only be used with raster datasets that have a Vector-UV or Vector-MagDir source type. The direction of the raster defines the direction of movement, and the magnitude defines the length of the streamline.

The FlowRenderer can only be used with ImageryLayer and ImageryTileLayer in a 2D MapView. The following code snippet shows how to apply this renderer to an ImageryTileLayer. You can use the sliders and components in the Controls panel to adjust the property values of FlowRenderer.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
const layer = new ImageryTileLayer({
  url: "https://tiledimageservices.arcgis.com/V6ZHFr6zdgNZuVG0/arcgis/rest/services/NLDAS_Hourly_8_30_2021/ImageServer",
  title: "Winds",
  renderer: {
    type: "flow", // autocasts to new FlowRenderer
    trailWidth: "2px",
    density: 1,
    visualVariables: [{
      type: "color",
      field: "Magnitude",
      stops: [
        { color: [40, 146, 199, 1], value: 0 },
        { color: [160, 194, 155, 1], value: 5 },
        { color: [218, 230, 119, 1], value: 10 }
      ]
    }]
  },
  effect: "bloom(1.5, 0.5px, 0)"
});

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