Advertisement
Guest User

Untitled

a guest
Aug 19th, 2019
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.52 KB | None | 0 0
  1. csvLayer.renderer = {
  2. type: "class-breaks",
  3. field: "DeviceGroupId",
  4. classBreakInfos: [
  5. {
  6. minValue: 1,
  7. maxValue: 1,
  8. symbol: {
  9. type: "simple-marker",
  10. style: "circle",
  11. color: [0, 176, 80, 0],
  12. outline: { color: [0, 0, 0, 0.4] },
  13. size: 16,
  14. },
  15. label: "PurpleAir Sensors"
  16. },
  17. {
  18. minValue: 2,
  19. maxValue: 2,
  20. symbol: {
  21. type: "simple-marker",
  22. style: "square",
  23. color: [0, 176, 80, 0],
  24. outline: { color: [0, 0, 0, 0.4] },
  25. size: 14,
  26. },
  27. label: "Aeroqual Sensors"
  28. },
  29. ],
  30. visualVariables: [colorVisual]
  31. };
  32.  
  33. var colorVisual = {
  34. type: "color",
  35. field: "PM25",
  36. stops: [
  37. {
  38. value: -9999,
  39. color: [128, 128, 128, 0.80],
  40. },
  41. {
  42. value: 0,
  43. color: [0, 176, 80, 0.80],
  44. label: "Good",
  45. legendOptions: {
  46. title: "Good"
  47. }
  48. },
  49. {
  50. value: 15,
  51. color: [254, 255, 0, 0.80],
  52. label: "Moderate",
  53. legendOptions: {
  54. title: "Moderate"
  55. }
  56. },
  57. {
  58. value: 40,
  59. color: [254, 255, 0, 0.80],
  60. label: "Unhealthy for Sensitive Groups",
  61. legendOptions: {
  62. title: "Unhealthy for Sensitive Groups"
  63. }
  64. },
  65. {
  66. value: 64,
  67. color: [255, 0, 0, 0.80],
  68. label: "Unhealthy",
  69. legendOptions: {
  70. title: "Unhealthy"
  71. }
  72. },
  73. {
  74. value: 150.4,
  75. color: [111, 48, 160, 0.80],
  76. label: "Very Unhealthy",
  77. legendOptions: {
  78. title: "Very Unhealthy"
  79. }
  80. },
  81. {
  82. value: 250.4,
  83. color: [121, 32, 49, 0.80],
  84. label: "Hazardous",
  85. legendOptions: {
  86. title: "Hazardous"
  87. }
  88. },
  89. ],
  90. };
  91.  
  92. var legend = new Legend({
  93. view: view,
  94. layerInfos: [{
  95. layer: csvLayer,
  96. title: "AQMD Sensor's PM 2.5"
  97. }],
  98. container: "divLegendList"
  99. });
  100. view.ui.add(legend, {
  101. position: "bottom-left"
  102. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement