1

在 TileMill / CartoCSS 中是否有一个布尔值“OR”的选项?我确实尝试过正则表达式,但没有成功。我想简化这个 CSS:

@ciPolyBackground: #F79320;
@ciPolyOpacity: 0.5;

#countries {
    [ne_10m_adm = "BOL"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "BRA"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "BWA"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "CHN"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "COD"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "COL"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "ECU"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "FJI"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "GUY"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "IDN"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "KHM"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "LBR"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "MDG"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "MEX"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "NCL"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "PER"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "PHL"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "PNG"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "SUR"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "TLS"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "WSM"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
    [ne_10m_adm = "ZAF"] { polygon-fill: @ciPolyBackground; polygon-opacity: @ciPolyOpacity; }
}
4

1 回答 1

5

您可以通过用逗号分隔来连接表达式:

    [ne_10m_adm = "BOL"], [ne_10m_adm = "BRA"], [ne_10m_adm = "BWA"] { polygon-fill: #333; polygon-opacity: .6; }
于 2014-05-15T21:05:26.737 回答