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.
const symbol = { type: "simple-marker", // autocasts as new SimpleMarkerSymbol() 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, }, angle: 180, size: 15, };
const rotationRenderer = { type: "simple", // autocasts as new SimpleRenderer() symbol: symbol, visualVariables: [ { type: "rotation", field: "WIND_DIRECT", rotationType: "geographic", }, { type: "size", field: "WIND_SPEED", minDataValue: 0, maxDataValue: 60, minSize: 8, maxSize: 40, }, ], };