Commit 144ce021 authored by Bernhard Beschow's avatar Bernhard Beschow

merge visualCategories() into createStyle()

parent 4a38ea15
......@@ -904,10 +904,10 @@ GeoDataStyle::ConstPtr StyleBuilder::createStyle(const StyleParameters &paramete
style = newStyle;
}
if (style->iconStyle().iconPath().isEmpty()) {
QList<GeoDataFeature::GeoDataVisualCategory> categories = visualCategories(osmData);
foreach(GeoDataFeature::GeoDataVisualCategory category, categories) {
for (auto iter = osmData.tagsBegin(), end = osmData.tagsEnd(); iter != end; ++iter) {
const QString keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value());
const GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(keyValue);
const GeoDataStyle::ConstPtr categoryStyle = presetStyle(category);
if (!categoryStyle->iconStyle().icon().isNull()) {
GeoDataStyle::Ptr newStyle(new GeoDataStyle(*style));
......@@ -1447,17 +1447,4 @@ StyleParameters::StyleParameters(const GeoDataFeature *feature_, int tileLevel_)
// nothing to do
}
QList<GeoDataFeature::GeoDataVisualCategory> StyleBuilder::visualCategories(const OsmPlacemarkData &osmData)
{
QList<GeoDataFeature::GeoDataVisualCategory> categories;
for (auto iter = osmData.tagsBegin(), end=osmData.tagsEnd(); iter != end; ++iter) {
const QString keyValue = QString("%1=%2").arg(iter.key()).arg(iter.value());
GeoDataFeature::GeoDataVisualCategory category = OsmPresetLibrary::osmVisualCategory(keyValue);
if (category != GeoDataFeature::None) {
categories << category;
}
}
return categories;
}
}
......@@ -74,8 +74,6 @@ public:
private:
Q_DISABLE_COPY(StyleBuilder)
static QList<GeoDataFeature::GeoDataVisualCategory> visualCategories(const OsmPlacemarkData &osmData);
class Private;
Private * const d;
};
......
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