From 05a7d9cd34ee8f513e870621f6b8f716a6dafdf7 Mon Sep 17 00:00:00 2001 From: Constantin Shalnev Date: Wed, 30 Sep 2015 17:05:13 +0300 Subject: [PATCH 1/3] Added dynamic selector 'name' --- data/mapcss-dynamic.txt | 1 + indexer/drules_selector.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/data/mapcss-dynamic.txt b/data/mapcss-dynamic.txt index 727e829eb0..e06685ad1e 100644 --- a/data/mapcss-dynamic.txt +++ b/data/mapcss-dynamic.txt @@ -1 +1,2 @@ population +name diff --git a/indexer/drules_selector.cpp b/indexer/drules_selector.cpp index 4d6de04006..3fb4d1ab09 100644 --- a/indexer/drules_selector.cpp +++ b/indexer/drules_selector.cpp @@ -102,6 +102,15 @@ bool GetPopulation(FeatureType const & ft, uint32_t & population) return true; } +// Feature tag value evaluator for tag 'name' +bool GetName(FeatureType const & ft, string & name) +{ + string intName; + ft.GetPreferredNames(name, intName); + return true; +} + + // Add new tag value evaluator here } // namespace @@ -128,6 +137,10 @@ unique_ptr ParseSelector(string const & str) } return make_unique>(&GetPopulation, e.m_operator, static_cast(value)); } + else if (e.m_tag == "name") + { + return make_unique>(&GetName, e.m_operator, e.m_value); + } // Add new tag here From fbb676217bd640465f2162cc270c5c2563f521d6 Mon Sep 17 00:00:00 2001 From: Constantin Shalnev Date: Wed, 30 Sep 2015 17:05:53 +0300 Subject: [PATCH 2/3] Mapcss fixup --- data/styles/clear/include/labels.mapcss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/data/styles/clear/include/labels.mapcss b/data/styles/clear/include/labels.mapcss index e245f83c6e..c14dab5850 100644 --- a/data/styles/clear/include/labels.mapcss +++ b/data/styles/clear/include/labels.mapcss @@ -979,7 +979,7 @@ area|z16[leisure=park], area|z17-[leisure=garden] { } -area|z17-[leisure=park] { +area|z17-[leisure=park][name] { icon-image: park-m.svg; text-offset: 10; text: name; @@ -990,6 +990,8 @@ area|z17-[leisure=park] { text-halo-radius: 0; } +area|z17-[leisure=park][!name] {} + area|z17[leisure=garden] { text: name; font-size: 12; From 4f35b1974e72737501688ac9e359688d04d4f059 Mon Sep 17 00:00:00 2001 From: kshalnev Date: Wed, 30 Sep 2015 21:22:45 +0300 Subject: [PATCH 3/3] Kothic submodule update --- tools/kothic | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/kothic b/tools/kothic index 2766c15966..60c342cea1 160000 --- a/tools/kothic +++ b/tools/kothic @@ -1 +1 @@ -Subproject commit 2766c15966a88ec1eccb70262af9cd3c03dba86d +Subproject commit 60c342cea1da0e934b549df0d380b070f5d9a34b