regexmapboxtilemillcartocss

Tilemill / CartoCSS boolean condition


In TileMill / CartoCSS is there a option to have an boolean "OR"? I did try regex, but was without success. I would like to simplify this 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; }
}

Solution

  • You can concatenate the expressions by separating with a comma:

        [ne_10m_adm = "BOL"], [ne_10m_adm = "BRA"], [ne_10m_adm = "BWA"] { polygon-fill: #333; polygon-opacity: .6; }