Commit 989f2cc1 authored by Torsten Rahn's avatar Torsten Rahn Committed by Torsten Rahn
Browse files

Add debug option to toggle the visibility of the

OSM/Mapnik bitmap tiles below the vector map
via the legend in Marble. This allows for better discovery
of rendering differences between the bitmap and vector version.
parent cdc39371
......@@ -15,13 +15,13 @@
<discrete> false </discrete>
</zoom>
</head>
<map bgcolor="#000000">
<canvas/>
<target/>
<map bgcolor="#dadada">
<canvas/>
<target/>
<layer name="openstreetmap" backend="texture">
<!-- OpenStreetMap mapnik rendered tiles expire after seven days
or 604800 seconds -->
<texture name="mapnik_data" expire="604800">
<texture name="dennis" expire="604800">
<sourcedir format="PNG"> earth/openstreetmap </sourcedir>
<tileSize width="256" height="256"/>
<storageLayout levelZeroColumns="1" levelZeroRows="1" maximumTileLevel="19" mode="OpenStreetMap"/>
......@@ -108,6 +108,11 @@
</property>
</group>
<group name="Texture Layers">
<property name="dennis">
<value>true</value>
<available>true</available>
</property>
<property name="hillshading">
<value>false</value>
<available>true</available>
......@@ -116,6 +121,10 @@
</settings>
<legend>
<section name="hilly" checkable="true" connect="dennis" spacing="12">
<heading>OSM Bitmap Tiles</heading>
</section>
<section name="Tours">
<heading>Explore the Earth</heading>
<item name="earthlandingsites">
......
......@@ -799,8 +799,9 @@ void MarbleMapPrivate::updateMapTheme()
q->setPropertyValue( "clouds_data", m_viewParams.showClouds() );
m_groundLayer.setColor( m_model->mapTheme()->map()->backgroundColor() );
if ( !m_model->mapTheme()->map()->hasTextureLayers() ) {
m_groundLayer.setColor( m_model->mapTheme()->map()->backgroundColor() );
m_layerManager.addLayer( &m_groundLayer );
}
......@@ -989,6 +990,12 @@ void MarbleMap::setPropertyValue( const QString& name, bool value )
else {
mDebug() << "WARNING: Failed to access a map theme! Property: " << name;
}
if (d->m_textureLayer.textureLayerCount() == 0) {
d->m_layerManager.addLayer( &d->m_groundLayer );
}
else {
d->m_layerManager.removeLayer( &d->m_groundLayer );
}
}
void MarbleMap::setShowOverviewMap( bool visible )
......
......@@ -280,6 +280,11 @@ void TextureLayer::addLandDocument( const GeoDataDocument *landDocument )
}
}
int TextureLayer::textureLayerCount() const
{
return d->m_layerDecorator.textureLayersSize();
}
bool TextureLayer::showSunShading() const
{
return d->m_layerDecorator.showSunShading();
......
......@@ -52,6 +52,8 @@ class MARBLE_EXPORT TextureLayer : public QObject, public LayerInterface
void addLandDocument( const GeoDataDocument *landDocument );
int textureLayerCount() const;
/**
* @brief Adds texture sublayer, taking ownership of the object's memory
* Does nothing if a texture with the same source directory was already
......
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