From 68eac5b8cc17ad27f31829f09ec7eab7b05efafc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Tue, 3 Apr 2018 01:14:58 +0200 Subject: [PATCH] Yet another WMS corner case handling fix --- src/map/wms.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/map/wms.cpp b/src/map/wms.cpp index 81ac5e7d..15cca735 100644 --- a/src/map/wms.cpp +++ b/src/map/wms.cpp @@ -17,11 +17,8 @@ WMS::CTX::CTX(const Setup &setup) : setup(setup), formatSupported(false) if (ll.size() != sl.size()) return; - for (int i = 0; i < ll.size(); i++) { + for (int i = 0; i < ll.size(); i++) layers.append(Layer(ll.at(i), sl.at(i))); - if (sl.at(i) == "default") - layers[i].hasStyle = true; - } } void WMS::getMap(QXmlStreamReader &reader, CTX &ctx) @@ -99,11 +96,11 @@ void WMS::layer(QXmlStreamReader &reader, CTX &ctx, styles.append(style(reader)); else if (reader.name() == "MinScaleDenominator") { double sd = reader.readElementText().toDouble(); - if (!std::isnan(sd)) + if (sd > 0) scaleDenominator.setMin(sd); } else if (reader.name() == "MaxScaleDenominator") { double sd = reader.readElementText().toDouble(); - if (!std::isnan(sd)) + if (sd > 0) scaleDenominator.setMax(sd); } else if (reader.name() == "LatLonBoundingBox") { QXmlStreamAttributes attr = reader.attributes(); @@ -138,6 +135,8 @@ void WMS::capability(QXmlStreamReader &reader, CTX &ctx) RangeF scaleDenominator(2132.729583849784, 559082264.0287178); RectC boundingBox; + styles.append("default"); + while (reader.readNextStartElement()) { if (reader.name() == "Layer") layer(reader, ctx, CRSs, styles, scaleDenominator, boundingBox);