mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 13:41:16 +01:00
Yet another WMS corner case handling fix
This commit is contained in:
parent
88d6904ded
commit
68eac5b8cc
@ -17,11 +17,8 @@ WMS::CTX::CTX(const Setup &setup) : setup(setup), formatSupported(false)
|
|||||||
if (ll.size() != sl.size())
|
if (ll.size() != sl.size())
|
||||||
return;
|
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)));
|
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)
|
void WMS::getMap(QXmlStreamReader &reader, CTX &ctx)
|
||||||
@ -99,11 +96,11 @@ void WMS::layer(QXmlStreamReader &reader, CTX &ctx,
|
|||||||
styles.append(style(reader));
|
styles.append(style(reader));
|
||||||
else if (reader.name() == "MinScaleDenominator") {
|
else if (reader.name() == "MinScaleDenominator") {
|
||||||
double sd = reader.readElementText().toDouble();
|
double sd = reader.readElementText().toDouble();
|
||||||
if (!std::isnan(sd))
|
if (sd > 0)
|
||||||
scaleDenominator.setMin(sd);
|
scaleDenominator.setMin(sd);
|
||||||
} else if (reader.name() == "MaxScaleDenominator") {
|
} else if (reader.name() == "MaxScaleDenominator") {
|
||||||
double sd = reader.readElementText().toDouble();
|
double sd = reader.readElementText().toDouble();
|
||||||
if (!std::isnan(sd))
|
if (sd > 0)
|
||||||
scaleDenominator.setMax(sd);
|
scaleDenominator.setMax(sd);
|
||||||
} else if (reader.name() == "LatLonBoundingBox") {
|
} else if (reader.name() == "LatLonBoundingBox") {
|
||||||
QXmlStreamAttributes attr = reader.attributes();
|
QXmlStreamAttributes attr = reader.attributes();
|
||||||
@ -138,6 +135,8 @@ void WMS::capability(QXmlStreamReader &reader, CTX &ctx)
|
|||||||
RangeF scaleDenominator(2132.729583849784, 559082264.0287178);
|
RangeF scaleDenominator(2132.729583849784, 559082264.0287178);
|
||||||
RectC boundingBox;
|
RectC boundingBox;
|
||||||
|
|
||||||
|
styles.append("default");
|
||||||
|
|
||||||
while (reader.readNextStartElement()) {
|
while (reader.readNextStartElement()) {
|
||||||
if (reader.name() == "Layer")
|
if (reader.name() == "Layer")
|
||||||
layer(reader, ctx, CRSs, styles, scaleDenominator, boundingBox);
|
layer(reader, ctx, CRSs, styles, scaleDenominator, boundingBox);
|
||||||
|
Loading…
Reference in New Issue
Block a user