Tilemill/CartoCSS布尔条件

din*_*uti 1 regex mapbox tilemill cartocss

在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; }
}
Run Code Online (Sandbox Code Playgroud)

小智 5

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

    [ne_10m_adm = "BOL"], [ne_10m_adm = "BRA"], [ne_10m_adm = "BWA"] { polygon-fill: #333; polygon-opacity: .6; }
Run Code Online (Sandbox Code Playgroud)