Skip to content

Commit c436cb7

Browse files
author
mhugent
committed
Use SRS for WMS 1.1.1 and CRS for WMS 1.3 (like described in the OGC specification), fixes #1242
git-svn-id: http://svn.osgeo.org/qgis/trunk@9143 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent d6e4c29 commit c436cb7

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/providers/wms/qgswmsprovider.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,12 @@ QImage* QgsWmsProvider::draw( QgsRect const & viewExtent, int pixelWidth, int p
373373

374374
// compose the URL query string for the WMS server.
375375

376+
QString crsKey = "SRS"; //SRS in 1.1.1 and CRS in 1.3.0
377+
if ( mCapabilities.version == "1.3.0" || mCapabilities.version == "1.3")
378+
{
379+
crsKey = "CRS";
380+
}
381+
376382
QString url = baseUrl;
377383

378384
url += "SERVICE=WMS";
@@ -383,7 +389,7 @@ QImage* QgsWmsProvider::draw( QgsRect const & viewExtent, int pixelWidth, int p
383389
url += "&";
384390
url += "BBOX=" + bbox;
385391
url += "&";
386-
url += "CRS=" + imageCrs;
392+
url += crsKey + "=" + imageCrs;
387393
url += "&";
388394
url += "WIDTH=" + width;
389395
url += "&";
@@ -412,7 +418,7 @@ QImage* QgsWmsProvider::draw( QgsRect const & viewExtent, int pixelWidth, int p
412418
mGetFeatureInfoUrlBase += "&";
413419
mGetFeatureInfoUrlBase += "BBOX=" + bbox;
414420
mGetFeatureInfoUrlBase += "&";
415-
mGetFeatureInfoUrlBase += "CRS=" + imageCrs;
421+
mGetFeatureInfoUrlBase += crsKey + "=" + imageCrs;
416422
mGetFeatureInfoUrlBase += "&";
417423
mGetFeatureInfoUrlBase += "WIDTH=" + width;
418424
mGetFeatureInfoUrlBase += "&";

0 commit comments

Comments
 (0)