Skip to content
Permalink
Browse files
Fix for ticket #562 small bug in WMS getFeatureInfo handling
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@6986 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Jun 8, 2007
1 parent 5e1ec04 commit 2e6c8ddce3abbf49f8def7038cc7fee2e163dbac
Showing with 38 additions and 1 deletion.
  1. +38 −1 src/app/qgsmaptoolidentify.cpp
@@ -165,8 +165,45 @@ 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())
{
showError(layer);

0 comments on commit 2e6c8dd

Please sign in to comment.