summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-09-02 06:51:10 (GMT)
committerBernhard Beschow <bbeschow@cs.tu-berlin.de>2016-09-02 06:53:39 (GMT)
commit88dc5fb3608961b6cd17876ea92f3915c36f2df3 (patch)
tree63d852fa077701378bb15eb73a873c34b3b287e4
parente6e148ac2ab7094b42a01f9a18537446bc1f3014 (diff)
use the full power of StyleBuilder::determineVisualCategory() to determine visual category
-rw-r--r--src/lib/marble/StyleBuilder.cpp17
-rw-r--r--src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp3
2 files changed, 8 insertions, 12 deletions
diff --git a/src/lib/marble/StyleBuilder.cpp b/src/lib/marble/StyleBuilder.cpp
index 6b24083..e89746e 100644
--- a/src/lib/marble/StyleBuilder.cpp
+++ b/src/lib/marble/StyleBuilder.cpp
@@ -1277,6 +1277,7 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
polyStyle.setOutline(false);
adjustStyle = true;
}
+
if (adjustStyle) {
GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
newStyle->setPolyStyle(polyStyle);
@@ -1285,16 +1286,12 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
}
if (style->iconStyle().iconPath().isEmpty()) {
- for (auto iter = osmData.tagsBegin(), end = osmData.tagsEnd(); iter != end; ++iter) {
- const auto tag = OsmTag(iter.key(), iter.value());
- const GeoDataFeature::GeoDataVisualCategory category = osmVisualCategory(tag);
- const GeoDataStyle::ConstPtr categoryStyle = presetStyle(category);
- if (category != GeoDataFeature::None && !categoryStyle->iconStyle().icon().isNull()) {
- GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
- newStyle->setIconStyle(categoryStyle->iconStyle());
- style = newStyle;
- break;
- }
+ const GeoDataFeature::GeoDataVisualCategory category = determineVisualCategory(osmData);
+ const GeoDataStyle::ConstPtr categoryStyle = presetStyle(category);
+ if (category != GeoDataFeature::None && !categoryStyle->iconStyle().icon().isNull()) {
+ GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
+ newStyle->setIconStyle(categoryStyle->iconStyle());
+ style = newStyle;
}
}
} else if (placemark->geometry()->nodeType() == GeoDataTypes::GeoDataLineStringType) {
diff --git a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
index 3f4f31b..3f89c7f 100644
--- a/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
+++ b/src/plugins/runner/nominatim-search/OsmNominatimSearchRunner.cpp
@@ -203,8 +203,7 @@ void OsmNominatimRunner::handleResult( QNetworkReply* reply )
placemark->setDescription(description);
placemark->setAddress(desc);
placemark->setCoordinate( lon.toDouble(), lat.toDouble(), 0, GeoDataCoordinates::Degree );
- const auto tag = StyleBuilder::OsmTag(key, value);
- const GeoDataFeature::GeoDataVisualCategory category = StyleBuilder::osmVisualCategory(tag);
+ const auto category = StyleBuilder::determineVisualCategory(data);
placemark->setVisualCategory( category );
placemark->setExtendedData(placemarkData);
placemark->setOsmData(data);