Commit d0977fe0 authored by Dennis Nienhüser's avatar Dennis Nienhüser

Ensure there is a ground layer

Fixes glitches when switching from a map theme with texture layers
to one with mixed texture and vector layers where no texture layer
is active by default.
parent 8b08edc8
......@@ -824,13 +824,8 @@ void MarbleMapPrivate::updateMapTheme()
m_model, SLOT(updateProperty(QString,bool)) );
q->setPropertyValue( "clouds_data", m_viewParams.showClouds() );
m_groundLayer.setColor( m_model->mapTheme()->map()->backgroundColor() );
if ( !m_model->mapTheme()->map()->hasTextureLayers() ) {
m_layerManager.addLayer( &m_groundLayer );
}
// Check whether there is a texture layer and vectortile layer available:
if ( m_model->mapTheme()->map()->hasTextureLayers() ) {
const GeoSceneSettings *const settings = m_model->mapTheme()->settings();
......@@ -969,12 +964,17 @@ void MarbleMapPrivate::updateMapTheme()
m_vectorTileLayer.setMapTheme( vectorTiles, vectorTileLayerSettings );
if (m_textureLayer.textureLayerCount() == 0) {
m_layerManager.addLayer( &m_groundLayer );
}
if ( textureLayersOk )
m_layerManager.addLayer( &m_textureLayer );
if ( vectorTileLayersOk )
m_layerManager.addLayer( &m_vectorTileLayer );
}
else {
m_layerManager.addLayer( &m_groundLayer );
m_textureLayer.setMapTheme( QVector<const GeoSceneTextureTileDataset *>(), 0, "", "" );
m_vectorTileLayer.setMapTheme( QVector<const GeoSceneVectorTileDataset *>(), 0 );
}
......
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