From 1444a88ad09e3b03a75c1a08fe55cbbecc4ac465 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 15 Feb 2019 20:32:53 +0100 Subject: [PATCH] Enable empty WMTS styles --- src/map/wmts.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/map/wmts.cpp b/src/map/wmts.cpp index feb9b1bc..90d3cb6c 100644 --- a/src/map/wmts.cpp +++ b/src/map/wmts.cpp @@ -179,7 +179,7 @@ void WMTS::layer(QXmlStreamReader &reader, CTX &ctx) QString s = style(reader); if (isDefault) ctx.defaultStyle = s; - if (!s.isEmpty() && s == ctx.setup.style()) + if (s == ctx.setup.style()) ctx.hasStyle = true; } else if (reader.name() == "Format") { if (reader.readElementText() == ctx.setup.format()) @@ -257,7 +257,8 @@ bool WMTS::parseCapabilities(const QString &path, CTX &ctx) _errorString = ctx.setup.style() + ": style not provided"; return false; } - if (ctx.setup.style().isEmpty() && ctx.defaultStyle.isEmpty()) { + if (!ctx.hasStyle && ctx.setup.style().isEmpty() + && ctx.defaultStyle.isEmpty()) { _errorString = "Default style not provided"; return false; }