我根据不同的条件在图层中用不同颜色为国家多边形着色。但是在五个“where”条件之后,它没有检测到相关的颜色。但使用默认颜色。为什么会这样?下面是我的代码:
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
}
}]
});