mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Enable specifiing of format parameters
This commit is contained in:
parent
bb6d6a4044
commit
c85f404d28
@ -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();
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user