Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- csvLayer.renderer = {
- type: "class-breaks",
- field: "DeviceGroupId",
- classBreakInfos: [
- {
- minValue: 1,
- maxValue: 1,
- symbol: {
- type: "simple-marker",
- style: "circle",
- color: [0, 176, 80, 0],
- outline: { color: [0, 0, 0, 0.4] },
- size: 16,
- },
- label: "PurpleAir Sensors"
- },
- {
- minValue: 2,
- maxValue: 2,
- symbol: {
- type: "simple-marker",
- style: "square",
- color: [0, 176, 80, 0],
- outline: { color: [0, 0, 0, 0.4] },
- size: 14,
- },
- label: "Aeroqual Sensors"
- },
- ],
- visualVariables: [colorVisual]
- };
- var colorVisual = {
- type: "color",
- field: "PM25",
- stops: [
- {
- value: -9999,
- color: [128, 128, 128, 0.80],
- },
- {
- value: 0,
- color: [0, 176, 80, 0.80],
- label: "Good",
- legendOptions: {
- title: "Good"
- }
- },
- {
- value: 15,
- color: [254, 255, 0, 0.80],
- label: "Moderate",
- legendOptions: {
- title: "Moderate"
- }
- },
- {
- value: 40,
- color: [254, 255, 0, 0.80],
- label: "Unhealthy for Sensitive Groups",
- legendOptions: {
- title: "Unhealthy for Sensitive Groups"
- }
- },
- {
- value: 64,
- color: [255, 0, 0, 0.80],
- label: "Unhealthy",
- legendOptions: {
- title: "Unhealthy"
- }
- },
- {
- value: 150.4,
- color: [111, 48, 160, 0.80],
- label: "Very Unhealthy",
- legendOptions: {
- title: "Very Unhealthy"
- }
- },
- {
- value: 250.4,
- color: [121, 32, 49, 0.80],
- label: "Hazardous",
- legendOptions: {
- title: "Hazardous"
- }
- },
- ],
- };
- var legend = new Legend({
- view: view,
- layerInfos: [{
- layer: csvLayer,
- title: "AQMD Sensor's PM 2.5"
- }],
- container: "divLegendList"
- });
- view.ui.add(legend, {
- position: "bottom-left"
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement