Visualize data with rotation

This sample shows how to use the rotation visual variable to visualize wind direction measured at various weather stations around the world.

The rotation visual variable can be set directly in the renderer's constructor.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const rotationRenderer = {
  type: "simple", // autocasts as new SimpleRenderer()
  symbol: {
    type: "simple-marker", // autocasts as new SimpleMarkerSymbol()
    // use an SVG path to create an arrow shape
    path: "M14.5,29 23.5,0 14.5,9 5.5,0z",
    color: "#ffff00",
    outline: {
      color: [0, 0, 0, 0.7],
      width: 0.5
    },
    // since the arrow points down, you can set the angle to 180
    // to force it to point up (0 degrees North) by default
    angle: 180,
    size: 15
  },
  visualVariables: [
    {
      type: "rotation", // indicates that symbols should be rotated based on value in field
      field: "grid_code", // field containing aspect values
      rotationType: "geographic"
    }
  ]
};

Additional visualization samples and resources

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

The developer dashboard has moved

You can no longer sign into this site. Go to your ArcGIS portal or the ArcGIS Location Platform dashboard to perform management tasks.

Your ArcGIS portal

Create, manage, and access API keys and OAuth 2.0 developer credentials, hosted layers, and data services.

Your ArcGIS Location Platform dashboard

Manage billing, monitor service usage, and access additional resources.

Learn more about these changes in the What's new in Esri Developers June 2024 blog post.

Close