Skip to content

Commit

Permalink
Spelling, doc and indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Jan 5, 2019
1 parent a145847 commit 1493574
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 26 deletions.
2 changes: 1 addition & 1 deletion src/server/services/wms/qgswmsparameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/server/services/wms/qgswmsrenderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down Expand Up @@ -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" ) );
}
}

Expand Down
8 changes: 7 additions & 1 deletion src/server/services/wms/qgswmsrenderer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
45 changes: 23 additions & 22 deletions tests/src/python/test_qgsserver_wms_getprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 1493574

Please sign in to comment.