I am coloring country polygon with different colors in a layer depending on different condition. But after the five “where” conditions, it didnt detect the associated color. But uses the default color. Why is this happening?
Below is my code:
layer.setOptions({
query: {
select: 'masterNarrative, countryName',
from: tableId,
where: where
},
styles: [{
where: "masterNarrative= '72 virgins (houris)' ",
polygonOptions: {
fillColor: '#2daebf',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Badr' ",
polygonOptions: {
fillColor: '#e33100',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Crusaders/Colonization' ",
polygonOptions: {
fillColor: '#a9014b',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Nakba (Palestine)' ",
polygonOptions: {
fillColor: '#871F78',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Hypocrites (Munafiqun)' ",
polygonOptions: {
fillColor: '#ff5c00',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Mahdi' ",
polygonOptions: {
fillColor: '#ffb515',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Musaylimah' ",
polygonOptions: {
fillColor: '#34925E',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Pharaoh' ",
polygonOptions: {
fillColor: '#E066FF',
fillOpacity: 0.5
}
},
{
where: "masterNarrative= 'Puppet Master' ",
polygonOptions: {
fillColor: '#00FF00',
fillOpacity: 0.5
}
}]
});
I am finding that these fillColors are not coming through when calling the FusionTablesLayer. I am using the bucket technique in Fusion but when I call the map out I am just getting the default markers. I would love to be able to use the function inside Fusion since doing it in javascript seems to be redundant.
Fusion Map
Calling map using FusionTablesLayer