diff --git a/src/plugins/wfs/qgswfssourceselect.cpp b/src/plugins/wfs/qgswfssourceselect.cpp index 4901195c9cd..482cd48f048 100644 --- a/src/plugins/wfs/qgswfssourceselect.cpp +++ b/src/plugins/wfs/qgswfssourceselect.cpp @@ -24,6 +24,7 @@ #include "qgsproject.h" #include "qgscoordinatereferencesystem.h" #include "qgslogger.h" +#include "qgsmapcanvas.h" //for current view extent #include #include #include @@ -366,7 +367,15 @@ void QgsWFSSourceSelect::addLayer() //add a wfs layer to the map if ( mIface ) { - mIface->addVectorLayer( uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString, typeName, "WFS" ); + //get current extent + QgsMapCanvas* canvas = mIface->mapCanvas(); + QString bBoxString; + if ( canvas && mBboxCheckBox->isChecked() ) + { + QgsRectangle currentExtent = canvas->extent(); + bBoxString = QString( "&BBOX=%1,%2,%3,%4" ).arg( currentExtent.xMinimum() ).arg( currentExtent.yMinimum() ).arg( currentExtent.xMaximum() ).arg( currentExtent.yMaximum() ); + } + mIface->addVectorLayer( uri + "SERVICE=WFS&VERSION=1.0.0&REQUEST=GetFeature&TYPENAME=" + typeName + crsString + bBoxString, typeName, "WFS" ); } accept(); } diff --git a/src/plugins/wfs/qgswfssourceselectbase.ui b/src/plugins/wfs/qgswfssourceselectbase.ui index 2754d59c6a4..fc8160f9499 100644 --- a/src/plugins/wfs/qgswfssourceselectbase.ui +++ b/src/plugins/wfs/qgswfssourceselectbase.ui @@ -7,89 +7,13 @@ 0 0 577 - 444 + 503 Add WFS Layer from a Server - - - 9 - - - 6 - - - - - 3 - - - - Title - - - - - Name - - - - - Abstract - - - - - - - - Coordinate reference system - - - - 6 - - - 9 - - - - - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 441 - 23 - - - - - - - - false - - - Change ... - - - - - - + @@ -161,7 +85,84 @@ + + + + 3 + + + + Title + + + + + Name + + + + + Abstract + + + + + + + + Coordinate reference system + + + + 6 + + + 9 + + + + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Expanding + + + + 441 + 23 + + + + + + + + false + + + Change ... + + + + + + + + + Only request features overlapping the current view extent + + + + Qt::Horizontal