In map.js file there's a function processAllResult process each records and calls buildMarkPopRecord where each marker is processed. So, in the buildMarkPopRecord, you should be able to figure out the color of the marker.
Now, if we see
We can get the AQI values like below (hopefully), haven't tested it
const eu_aqi = JSON.parse($("#eu_aqi").text());
Now, It seems that there are two ways to find the color based on the value of the either PM2.5, PM10, or NO2.
check what pollutant value is available (PM2.5, PM10, NO2, NO, NOx etc) in that priority. If PM2.5 is available good, if not check PM10, If not NO2, if not NO)
Based on what is available , call the get AQIValue function and display the color of it.
We give preference to PM2.5.
Feel free to get on call with me.. I will probably explain it better on call.
Debug the code a bit and it would help you to understand.
In
map.js
file there's a functionprocessAllResult
process each records and callsbuildMarkPopRecord
where each marker is processed. So, in thebuildMarkPopRecord
, you should be able to figure out the color of the marker.Now, if we see
We can get the AQI values like below (hopefully), haven't tested it
Now, It seems that there are two ways to find the color based on the value of the either PM2.5, PM10, or NO2.
There are two functions
findColorFeature
which takes input as
and outputs the color as mentioned in line 792
If you notice, it always sends back the color for the PM2.5 value, which should be displayed
getAQIValue
which takes three values as input
which outputs an array
So, what I would suggest is
in the
buildMarkPopRecord
,check what pollutant value is available (PM2.5, PM10, NO2, NO, NOx etc) in that priority. If PM2.5 is available good, if not check PM10, If not NO2, if not NO)
Based on what is available , call the get AQIValue function and display the color of it.
We give preference to PM2.5.
Feel free to get on call with me.. I will probably explain it better on call.
Debug the code a bit and it would help you to understand.