summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Nienhüser <nienhueser@kde.org>2016-11-06 14:57:37 (GMT)
committerDennis Nienhüser <nienhueser@kde.org>2016-11-06 14:57:37 (GMT)
commite94d8fa7d327e1d48d9a1d409247845787f673a4 (patch)
tree9133741b2aca73a9e5770d90bd5410b530e47243
parentacf8a3e8f43708b748622c9ed40b9cf296f90058 (diff)
Do not create lots of placemarks that will never be rendered
Features like buildings were extracted, but most often have no icon and no text.
-rw-r--r--src/lib/marble/PlacemarkLayout.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/lib/marble/PlacemarkLayout.cpp b/src/lib/marble/PlacemarkLayout.cpp
index 0132021..292543f 100644
--- a/src/lib/marble/PlacemarkLayout.cpp
+++ b/src/lib/marble/PlacemarkLayout.cpp
@@ -524,7 +524,11 @@ bool PlacemarkLayout::layoutPlacemark( const GeoDataPlacemark *placemark, const
// @todo: Set / adjust to tile level
parameters.placemark = placemark;
- mark = new VisiblePlacemark(placemark, coordinates, m_styleBuilder->createStyle(parameters));
+ auto style = m_styleBuilder->createStyle(parameters);
+ if (style->iconStyle().icon().isNull()) {
+ return false;
+ }
+ mark = new VisiblePlacemark(placemark, coordinates, style);
m_visiblePlacemarks.insert( placemark, mark );
connect( mark, SIGNAL(updateNeeded()), this, SIGNAL(repaintNeeded()) );
}
@@ -571,10 +575,10 @@ bool PlacemarkLayout::layoutPlacemark( const GeoDataPlacemark *placemark, const
GeoDataCoordinates PlacemarkLayout::placemarkIconCoordinates( const GeoDataPlacemark *placemark ) const
{
- bool ok;
- GeoDataCoordinates coordinates = placemark->coordinate( m_clock->dateTime(), &ok );
+ bool hasIcon;
+ GeoDataCoordinates coordinates = placemark->coordinate( m_clock->dateTime(), &hasIcon);
- if (ok || m_acceptedVisualCategories.contains(placemark->visualCategory())) {
+ if (hasIcon || m_acceptedVisualCategories.contains(placemark->visualCategory())) {
return coordinates;
}