summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-05 15:07:28 (GMT)
committerFriedrich W. H. Kossebau <kossebau@kde.org>2016-11-05 16:49:35 (GMT)
commitc22ed98e26ef126f456672bad9706916e1a39f61 (patch)
tree169b23117c050a3d39bbee3c4708ac46696c85e4
parent2d0441f947d58223d023a46a0d32336fd179c349 (diff)
Parse marbleZoomLevel=<int> osm tags as placemark zoomLevel values
-rw-r--r--src/plugins/runner/osm/OsmNode.cpp69
1 files changed, 37 insertions, 32 deletions
diff --git a/src/plugins/runner/osm/OsmNode.cpp b/src/plugins/runner/osm/OsmNode.cpp
index 02822e9..5dd1980 100644
--- a/src/plugins/runner/osm/OsmNode.cpp
+++ b/src/plugins/runner/osm/OsmNode.cpp
@@ -61,38 +61,43 @@ void OsmNode::create(GeoDataDocument *document) const
placemark->setVisualCategory(category);
placemark->setStyle( GeoDataStyle::Ptr() );
- switch (category) {
- case GeoDataPlacemark::PlaceCity:
- case GeoDataPlacemark::PlaceCityCapital:
- placemark->setZoomLevel(9);
- break;
- case GeoDataPlacemark::PlaceSuburb:
- placemark->setZoomLevel(13);
- break;
- case GeoDataPlacemark::PlaceHamlet:
- placemark->setZoomLevel(15);
- break;
- case GeoDataPlacemark::PlaceLocality:
- placemark->setZoomLevel(15);
- break;
- case GeoDataPlacemark::PlaceTown:
- case GeoDataPlacemark::PlaceTownCapital:
- placemark->setZoomLevel(11);
- break;
- case GeoDataPlacemark::PlaceVillage:
- case GeoDataPlacemark::PlaceVillageCapital:
- placemark->setZoomLevel(13);
- break;
- case GeoDataPlacemark::NaturalPeak:
- placemark->setZoomLevel(11);
- break;
- case GeoDataPlacemark::AmenityBench:
- case GeoDataPlacemark::AmenityWasteBasket:
- placemark->setZoomLevel(19);
- break;
- default:
- placemark->setZoomLevel(18);
- break;
+ if (m_osmData.containsTagKey(QLatin1String("marbleZoomLevel"))) {
+ int const zoomLevel = m_osmData.tagValue(QLatin1String("marbleZoomLevel")).toInt();
+ placemark->setZoomLevel(zoomLevel);
+ } else {
+ switch (category) {
+ case GeoDataPlacemark::PlaceCity:
+ case GeoDataPlacemark::PlaceCityCapital:
+ placemark->setZoomLevel(9);
+ break;
+ case GeoDataPlacemark::PlaceSuburb:
+ placemark->setZoomLevel(13);
+ break;
+ case GeoDataPlacemark::PlaceHamlet:
+ placemark->setZoomLevel(15);
+ break;
+ case GeoDataPlacemark::PlaceLocality:
+ placemark->setZoomLevel(15);
+ break;
+ case GeoDataPlacemark::PlaceTown:
+ case GeoDataPlacemark::PlaceTownCapital:
+ placemark->setZoomLevel(11);
+ break;
+ case GeoDataPlacemark::PlaceVillage:
+ case GeoDataPlacemark::PlaceVillageCapital:
+ placemark->setZoomLevel(13);
+ break;
+ case GeoDataPlacemark::NaturalPeak:
+ placemark->setZoomLevel(11);
+ break;
+ case GeoDataPlacemark::AmenityBench:
+ case GeoDataPlacemark::AmenityWasteBasket:
+ placemark->setZoomLevel(19);
+ break;
+ default:
+ placemark->setZoomLevel(18);
+ break;
+ }
}
if (category >= GeoDataPlacemark::PlaceCity && category <= GeoDataPlacemark::PlaceVillageCapital) {