Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Spelling, doc and indentation
- Loading branch information
|
@@ -1149,7 +1149,7 @@ namespace QgsWms |
|
|
*/ |
|
|
QString layoutParameter( const QString &id, bool &ok ) const; |
|
|
|
|
|
//! Return ATLAS_ID parameter |
|
|
//! Returns the ATLAS_PK parameter |
|
|
QStringList atlasPk() const; |
|
|
|
|
|
private: |
|
|
|
@@ -400,7 +400,7 @@ namespace QgsWms |
|
|
if ( pkIndexes.size() < 1 ) |
|
|
{ |
|
|
throw QgsBadRequestException( QStringLiteral( "AtlasPrintError" ), |
|
|
QStringLiteral( "An error occured during the Atlas print" ) ); |
|
|
QStringLiteral( "An error occurred during the Atlas print" ) ); |
|
|
} |
|
|
QStringList pkAttributeNames; |
|
|
for ( int i = 0; i < pkIndexes.size(); ++i ) |
|
@@ -445,7 +445,7 @@ namespace QgsWms |
|
|
if ( !errorString.isEmpty() ) |
|
|
{ |
|
|
throw QgsBadRequestException( QStringLiteral( "AtlasPrintError" ), |
|
|
QStringLiteral( "An error occured during the Atlas print" ) ); |
|
|
QStringLiteral( "An error occurred during the Atlas print" ) ); |
|
|
} |
|
|
} |
|
|
|
|
|
|
@@ -282,7 +282,13 @@ namespace QgsWms |
|
|
//! Gets layer search rectangle (depending on request parameter, layer type, map and layer crs) |
|
|
QgsRectangle featureInfoSearchRect( QgsVectorLayer *ml, const QgsMapSettings &ms, const QgsRenderContext &rct, const QgsPointXY &infoPoint ) const; |
|
|
|
|
|
//! configure the print layout for the GetPrint request |
|
|
/* |
|
|
* Configure the print layout for the GetPrint request |
|
|
* @param c the print layout |
|
|
* @param mapSettings the map settings |
|
|
* @param atlasPrint true if atlas is used for printing |
|
|
* @return true in case of success |
|
|
* */ |
|
|
bool configurePrintLayout( QgsPrintLayout *c, const QgsMapSettings &mapSettings, bool atlasPrint = false ); |
|
|
|
|
|
//! Creates external WMS layer. Caller takes ownership |
|
|
|
@@ -412,31 +412,32 @@ def test_wms_getprint_two_maps(self): |
|
|
r, h = self._result(self._execute_request(qs)) |
|
|
self._img_diff_error(r, h, "WMS_GetPrint_TwoMaps") |
|
|
|
|
|
def test_wms_getprint_atlas( self ): |
|
|
qs = "?" + "&".join(["%s=%s" % i for i in list({ |
|
|
"MAP": urllib.parse.quote(self.projectPath), |
|
|
"SERVICE": "WMS", |
|
|
"VERSION": "1.3.0", |
|
|
"REQUEST": "GetPrint", |
|
|
"TEMPLATE": "layoutA4", |
|
|
"FORMAT": "png", |
|
|
"CRS": "EPSG:3857", |
|
|
"ATLAS_PK": "3", |
|
|
"map0:LAYERS": "Country,Hello", |
|
|
def test_wms_getprint_atlas(self): |
|
|
qs = "?" + "&".join(["%s=%s" % i for i in list({ |
|
|
"MAP": urllib.parse.quote(self.projectPath), |
|
|
"SERVICE": "WMS", |
|
|
"VERSION": "1.3.0", |
|
|
"REQUEST": "GetPrint", |
|
|
"TEMPLATE": "layoutA4", |
|
|
"FORMAT": "png", |
|
|
"CRS": "EPSG:3857", |
|
|
"ATLAS_PK": "3", |
|
|
"map0:LAYERS": "Country,Hello", |
|
|
}.items())]) |
|
|
r, h = self._result(self._execute_request(qs)) |
|
|
self._img_diff_error(r, h, "WMS_GetPrint_Atlas") |
|
|
r, h = self._result(self._execute_request(qs)) |
|
|
self._img_diff_error(r, h, "WMS_GetPrint_Atlas") |
|
|
|
|
|
def test_wms_getprint_atlas_getProjectSettings( self ): |
|
|
qs = "?" + "&".join(["%s=%s" % i for i in list({ |
|
|
"MAP": urllib.parse.quote(self.projectPath), |
|
|
"SERVICE": "WMS", |
|
|
"VERSION": "1.3.0", |
|
|
"REQUEST": "GetProjectSettings", |
|
|
def test_wms_getprint_atlas_getProjectSettings(self): |
|
|
qs = "?" + "&".join(["%s=%s" % i for i in list({ |
|
|
"MAP": urllib.parse.quote(self.projectPath), |
|
|
"SERVICE": "WMS", |
|
|
"VERSION": "1.3.0", |
|
|
"REQUEST": "GetProjectSettings", |
|
|
}.items())]) |
|
|
r, h = self._result(self._execute_request(qs)) |
|
|
self.assertTrue( 'atlasEnabled="1"' in str( r ) ) |
|
|
self.assertTrue( '<PrimaryKeyAttribute>' in str( r ) ) |
|
|
r, h = self._result(self._execute_request(qs)) |
|
|
self.assertTrue('atlasEnabled="1"' in str(r)) |
|
|
self.assertTrue('<PrimaryKeyAttribute>' in str(r)) |
|
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
unittest.main() |