Skip to content

Commit

Permalink
Fix erroneous extent for contextual legend
Browse files Browse the repository at this point in the history
  • Loading branch information
giohappy committed Jan 13, 2015
1 parent b49da36 commit 224b2c8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/providers/wms/qgswmsprovider.cpp
Expand Up @@ -3064,7 +3064,7 @@ QgsImageFetcher* QgsWmsProvider::getLegendGraphicFetcher( const QgsMapSettings*
if ( mapSettings && mSettings.mEnableContextualLegend )
{
scale = mapSettings->scale();
mapExtent = mapSettings->extent();
mapExtent = mapSettings->visibleExtent();
}
else
{
Expand Down

3 comments on commit 224b2c8

@ruhri
Copy link

@ruhri ruhri commented on 224b2c8 Jan 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using QGIS 2.12.3 (Win64bit) with contextual WMS-legends doesn't work!
The WMS-Counterpart is a patched UMNMapserver 7.0 - Examples:

Standard-Legend:
http://geodaten.metropoleruhr.de/spw/spw_web?language=ger&SERVICE=WMS&VERSION=1.3.0&SLD_VERSION=1.1.0&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=oepnv_linien&STYLE=

Contextual-Legend (working):
http://geodaten.metropoleruhr.de/spw/spw_web?language=ger&SERVICE=WMS&VERSION=1.3.0&SLD_VERSION=1.1.0&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=oepnv_linien&STYLE=&BBOX=361299.31917663925560191,5701245.71691642235964537,362276.95459430309711024,5701856.90441704634577036&CRS=EPSG:25832&WIDTH=148&HEIGHT=925

QGIS sends following Request with Contextual-Legends checked (grabbed from Apache-log) - non-working:
http://geodaten.metropoleruhr.de/spw/spw_web?language=ger&&SERVICE=WMS&VERSION=1.3.0&SLD_VERSION=1.1.0&REQUEST=GetLegendGraphic&FORMAT=image/png&LAYER=oepnv_linien&STYLE=&BBOX=300000,5620000,440000,5770000&CRS=EPSG:25832

In order to work well in UMN-mapserver-logic, QGIS needs to send one more parameter-set (WIDTH and HEIGHT of the mapcanvas in px).

http://www.mapserver.org/de/development/rfc/ms-rfc-101.html

Moreover the BBOX seems to be wrong, IMHO this should be an dynamic parameter in getlegend-requests, whether the one QGIS seems to be static! In my last example the requests BBOX is the mapextent from the service. For each zooming- and panning-action, there is send a requests to the service, but BBOX doesn't change.

Please Review the function. THX

@wonder-sk
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ruhri please better file a bug report on hub.qgis.org rather than commenting to a commit (that is most likely unrelated)

@ruhri
Copy link

@ruhri ruhri commented on 224b2c8 Jan 28, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, thanks for the advice.
See:
https://hub.qgis.org/issues/14187

Please sign in to comment.