Skip to content
Permalink
Browse files
Fix for ticket #652 also for 0.8.1
git-svn-id: http://svn.osgeo.org/qgis/branches/Release-0_8_0@6987 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 8, 2007
1 parent 8c0d00c commit c3604cf16b863babbc9d84ae8fe11ae33d11a382
Showing with 37 additions and 1 deletion.
  1. +37 −1 src/gui/qgsmaptoolidentify.cpp
@@ -159,7 +159,43 @@ void QgsMapToolIdentify::identifyRasterWmsLayer(QgsRasterLayer* layer, const Qgs
return;
}

QString text = layer->identifyAsText(point);
//if WMS layer does not cover the view origin,
//we need to map the view pixel coordinates
//to WMS layer pixel coordinates
QgsRect viewExtent = mCanvas->extent();
double mupp = mCanvas->mupp();
if(mupp == 0)
{
return;
}
double xMinView = viewExtent.xMin();
double yMaxView = viewExtent.yMax();

QgsRect layerExtent = layer->extent();
double xMinLayer = layerExtent.xMin();
double yMaxLayer = layerExtent.yMax();

double i, j;

if(xMinView < xMinLayer)
{
i = (int)(point.x() - (xMinLayer - xMinView) / mupp);
}
else
{
i = point.x();
}

if(yMaxView > yMaxLayer)
{
j = (int)(point.y() - (yMaxView - yMaxLayer) / mupp);
}
else
{
j = point.y();
}

QString text = layer->identifyAsText(QgsPoint(i, j));

if (text.isEmpty())
{

0 comments on commit c3604cf

Please sign in to comment.