Skip to content

Commit c321f59

Browse files
committed
wmts: add a default style entry if the server doesn't provide any (fixes #8401)
1 parent 0ca0d50 commit c321f59

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/providers/wms/qgswmsprovider.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2985,6 +2985,15 @@ void QgsWmsProvider::parseWMTSContents( QDomElement const &e )
29852985
l.defaultStyle = s.identifier;
29862986
}
29872987

2988+
if ( l.styles.isEmpty() )
2989+
{
2990+
QgsWmtsStyle s;
2991+
s.identifier = "default";
2992+
s.title = tr( "Generated default style" );
2993+
s.abstract = tr( "Style was missing in capabilities" );
2994+
l.styles.insert( s.identifier, s );
2995+
}
2996+
29882997
for ( QDomElement e1 = e0.firstChildElement( "Format" ); !e1.isNull(); e1 = e1.nextSiblingElement( "Format" ) )
29892998
{
29902999
l.formats << e1.text();

0 commit comments

Comments
 (0)