mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-18 19:52:09 +01:00
Fixed WMS/WMTS URLs composing
This commit is contained in:
parent
7432459c93
commit
7855c69729
@ -274,8 +274,8 @@ bool WMS::getCapabilities(const QString &url, const QString &file,
|
|||||||
|
|
||||||
WMS::WMS(const QString &file, const WMS::Setup &setup) : _valid(false)
|
WMS::WMS(const QString &file, const WMS::Setup &setup) : _valid(false)
|
||||||
{
|
{
|
||||||
QString capaUrl = QString("%1?service=WMS&request=GetCapabilities")
|
QString capaUrl = QString("%1%2service=WMS&request=GetCapabilities")
|
||||||
.arg(setup.url());
|
.arg(setup.url(), setup.url().contains('?') ? "&" : "?");
|
||||||
|
|
||||||
if (!QFileInfo(file).exists())
|
if (!QFileInfo(file).exists())
|
||||||
if (!getCapabilities(capaUrl, file, setup.authorization()))
|
if (!getCapabilities(capaUrl, file, setup.authorization()))
|
||||||
|
@ -20,11 +20,11 @@ QString WMSMap::tileUrl(const QString &version) const
|
|||||||
{
|
{
|
||||||
QString url;
|
QString url;
|
||||||
|
|
||||||
url = QString("%1?version=%2&request=GetMap&bbox=$bbox"
|
url = QString("%1%2version=%3&request=GetMap&bbox=$bbox"
|
||||||
"&width=%3&height=%4&layers=%5&styles=%6&format=%7&transparent=true")
|
"&width=%4&height=%5&layers=%6&styles=%7&format=%8&transparent=true")
|
||||||
.arg(_setup.url(), version, QString::number(TILE_SIZE),
|
.arg(_setup.url(), _setup.url().contains('?') ? "&" : "?", version,
|
||||||
QString::number(TILE_SIZE), _setup.layer(), _setup.style(),
|
QString::number(TILE_SIZE), QString::number(TILE_SIZE), _setup.layer(),
|
||||||
_setup.format());
|
_setup.style(), _setup.format());
|
||||||
|
|
||||||
if (version >= "1.3.0")
|
if (version >= "1.3.0")
|
||||||
url.append(QString("&CRS=%1").arg(_setup.crs()));
|
url.append(QString("&CRS=%1").arg(_setup.crs()));
|
||||||
|
@ -301,8 +301,8 @@ bool WMTS::getCapabilities(const QString &url, const QString &file,
|
|||||||
WMTS::WMTS(const QString &file, const WMTS::Setup &setup) : _valid(false)
|
WMTS::WMTS(const QString &file, const WMTS::Setup &setup) : _valid(false)
|
||||||
{
|
{
|
||||||
QString capaUrl = setup.rest() ? setup.url() :
|
QString capaUrl = setup.rest() ? setup.url() :
|
||||||
QString("%1?service=WMTS&Version=1.0.0&request=GetCapabilities")
|
QString("%1%2service=WMTS&Version=1.0.0&request=GetCapabilities")
|
||||||
.arg(setup.url());
|
.arg(setup.url(), setup.url().contains('?') ? "&" : "?");
|
||||||
|
|
||||||
if (!QFileInfo(file).exists())
|
if (!QFileInfo(file).exists())
|
||||||
if (!getCapabilities(capaUrl, file, setup.authorization()))
|
if (!getCapabilities(capaUrl, file, setup.authorization()))
|
||||||
@ -312,9 +312,10 @@ WMTS::WMTS(const QString &file, const WMTS::Setup &setup) : _valid(false)
|
|||||||
|
|
||||||
QString style = setup.style().isEmpty() ? "default" : setup.style();
|
QString style = setup.style().isEmpty() ? "default" : setup.style();
|
||||||
if (!setup.rest()) {
|
if (!setup.rest()) {
|
||||||
_tileUrl = QString("%1?service=WMTS&Version=1.0.0&request=GetTile"
|
_tileUrl = QString("%1%2service=WMTS&Version=1.0.0&request=GetTile"
|
||||||
"&Format=%2&Layer=%3&Style=%4&TileMatrixSet=%5&TileMatrix=$z"
|
"&Format=%3&Layer=%4&Style=%5&TileMatrixSet=%6&TileMatrix=$z"
|
||||||
"&TileRow=$y&TileCol=$x").arg(setup.url(), setup.format(),
|
"&TileRow=$y&TileCol=$x").arg(setup.url(),
|
||||||
|
setup.url().contains('?') ? "&" : "?" , setup.format(),
|
||||||
setup.layer(), style, setup.set());
|
setup.layer(), style, setup.set());
|
||||||
for (int i = 0; i < setup.dimensions().size(); i++) {
|
for (int i = 0; i < setup.dimensions().size(); i++) {
|
||||||
const QPair<QString, QString> &dim = setup.dimensions().at(i);
|
const QPair<QString, QString> &dim = setup.dimensions().at(i);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user