Commit f073f240 authored by Volker Krause's avatar Volker Krause
Browse files

Handle default layer selector

parent 8303479c
Pipeline #65283 passed with stage
in 23 seconds
...@@ -134,3 +134,7 @@ way[railway=tram]::tram { ...@@ -134,3 +134,7 @@ way[railway=tram]::tram {
color: #303030; color: #303030;
z-index: 1; z-index: 1;
} }
// default layer selector
node::default {
icon-image: "bla";
}
...@@ -157,3 +157,8 @@ way[railway=tram]::tram ...@@ -157,3 +157,8 @@ way[railway=tram]::tram
z-index: 1; z-index: 1;
} }
node
{
icon-image: "bla";
}
...@@ -154,5 +154,8 @@ ClassSelectorKey MapCSSParser::makeClassSelector(const char *str, std::size_t le ...@@ -154,5 +154,8 @@ ClassSelectorKey MapCSSParser::makeClassSelector(const char *str, std::size_t le
LayerSelectorKey MapCSSParser::makeLayerSelector(const char *str, std::size_t len) LayerSelectorKey MapCSSParser::makeLayerSelector(const char *str, std::size_t len)
{ {
if (!str || std::strcmp(str, "default") == 0) {
return {};
}
return MapCSSStylePrivate::get(m_currentStyle)->m_layerSelectorRegistry.makeKey(str, len, OSM::StringMemory::Transient); return MapCSSStylePrivate::get(m_currentStyle)->m_layerSelectorRegistry.makeKey(str, len, OSM::StringMemory::Transient);
} }
...@@ -198,10 +198,8 @@ BasicSelector: ...@@ -198,10 +198,8 @@ BasicSelector:
$$->setObjectType($I.str, $I.len); $$->setObjectType($I.str, $I.len);
$$->setZoomRange($Z.low, $Z.high); $$->setZoomRange($Z.low, $Z.high);
$$->setConditions($T); $$->setConditions($T);
if ($L.str) {
$$->setLayer(parser->makeLayerSelector($L.str, $L.len)); $$->setLayer(parser->makeLayerSelector($L.str, $L.len));
} }
}
| T_STAR ClassSelector[C] ZoomRange[Z] Tests[T] LayerSelector[L] { | T_STAR ClassSelector[C] ZoomRange[Z] Tests[T] LayerSelector[L] {
$$ = new MapCSSBasicSelector; $$ = new MapCSSBasicSelector;
$$->objectType = MapCSSBasicSelector::Any; $$->objectType = MapCSSBasicSelector::Any;
...@@ -210,10 +208,8 @@ BasicSelector: ...@@ -210,10 +208,8 @@ BasicSelector:
} }
$$->setZoomRange($Z.low, $Z.high); $$->setZoomRange($Z.low, $Z.high);
$$->setConditions($T); $$->setConditions($T);
if ($L.str) {
$$->setLayer(parser->makeLayerSelector($L.str, $L.len)); $$->setLayer(parser->makeLayerSelector($L.str, $L.len));
} }
}
; ;
ClassSelector: ClassSelector:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment