diff --git a/src/map/wms.cpp b/src/map/wms.cpp index aa051afc..e3329a86 100644 --- a/src/map/wms.cpp +++ b/src/map/wms.cpp @@ -8,6 +8,11 @@ #include "wms.h" +static QString bareFormat(const QString &format) +{ + return format.left(format.indexOf(';')).trimmed(); +} + static inline double hint2denominator(double h) { /* Some WMS 1.1.1 servers use a 72dpi resolution by default. Using the usual @@ -38,7 +43,7 @@ void WMS::getMap(QXmlStreamReader &reader, CTX &ctx) while (reader.readNextStartElement()) { if (reader.name() == "Format") { QString format(reader.readElementText()); - if (format.left(format.indexOf(';')) == ctx.setup.format()) + if (bareFormat(format) == bareFormat(ctx.setup.format())) ctx.formatSupported = true; } else reader.skipCurrentElement(); diff --git a/src/map/wmts.cpp b/src/map/wmts.cpp index d67034b8..ebbca7d1 100644 --- a/src/map/wmts.cpp +++ b/src/map/wmts.cpp @@ -12,6 +12,11 @@ #include "wmts.h" +static QString bareFormat(const QString &format) +{ + return format.left(format.indexOf(';')).trimmed(); +} + static void skipParentElement(QXmlStreamReader &reader) { while (reader.readNextStartElement()) @@ -183,7 +188,7 @@ void WMTS::layer(QXmlStreamReader &reader, CTX &ctx) ctx.hasStyle = true; } else if (reader.name() == "Format") { QString format(reader.readElementText()); - if (format.left(format.indexOf(';')) == ctx.setup.format()) + if (bareFormat(format) == bareFormat(ctx.setup.format())) ctx.hasFormat = true; } else reader.skipCurrentElement();