1
/***************************************************************************
2
* Copyright (C) 2007 by Kai Winter *
5
* This program is free software; you can redistribute it and/or modify *
6
* it under the terms of the GNU General Public License as published by *
7
* the Free Software Foundation; either version 2 of the License, or *
8
* (at your option) any later version. *
10
* This program is distributed in the hope that it will be useful, *
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13
* GNU General Public License for more details. *
15
* You should have received a copy of the GNU General Public License *
16
* along with this program; if not, write to the *
17
* Free Software Foundation, Inc., *
18
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19
***************************************************************************/
20
#include "wmsmapadapter.h"
22
WMSMapAdapter::WMSMapAdapter(WmsServer aServer)
25
loc = QLocale(QLocale::English);
26
loc.setNumberOptions(QLocale::OmitGroupSeparator);
29
QString WMSMapAdapter::getName() const
31
return theServer.WmsName;
34
QString WMSMapAdapter::getHost() const
36
return theServer.WmsAdress;
39
IImageManager* WMSMapAdapter::getImageManager()
41
return theImageManager;
44
void WMSMapAdapter::setImageManager(IImageManager* anImageManager)
46
theImageManager = anImageManager;
49
QString WMSMapAdapter::projection() const
51
return theServer.WmsProjections;
54
WMSMapAdapter::~WMSMapAdapter()
58
QUuid WMSMapAdapter::getId() const
60
return QUuid("{E238750A-AC27-429e-995C-A60C17B9A1E0}");
63
IMapAdapter::Type WMSMapAdapter::getType() const
65
return IMapAdapter::DirectBackground;
68
QString WMSMapAdapter::getQuery(const QRectF& /*wgs84Bbox*/, const QRectF& projBbox, const QRect& size) const
71
.append(theServer.WmsPath)
72
.append("SERVICE=WMS")
73
.append("&VERSION=1.1.1")
74
.append("&REQUEST=GetMap")
75
.append("&TRANSPARENT=TRUE")
76
.append("&LAYERS=").append(theServer.WmsLayers)
77
.append("&SRS=").append(theServer.WmsProjections)
78
.append("&STYLES=").append(theServer.WmsStyles)
79
.append("&FORMAT=").append(theServer.WmsImgFormat)
80
.append("&WIDTH=").append(QString::number(size.width()))
81
.append("&HEIGHT=").append(QString::number(size.height()))
83
.append(loc.toString(projBbox.bottomLeft().x(),'f',6)).append(",")
84
.append(loc.toString(projBbox.bottomLeft().y(),'f',6)).append(",")
85
.append(loc.toString(projBbox.topRight().x(),'f',6)).append(",")
86
.append(loc.toString(projBbox.topRight().y(),'f',6))