From c85f404d28fa42de19830412fce7f68b9504b2e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 3 Mar 2020 09:29:16 +0100 Subject: [PATCH] Enable specifiing of format parameters --- src/map/wms.cpp | 7 ++++++- src/map/wmts.cpp | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) 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();