[OpenLayers-Users] FW: getFeatureInfo projection
Alexandre.Laplante at statcan.gc.ca
Alexandre.Laplante at statcan.gc.ca
Thu Jul 23 14:25:23 EDT 2009
Yeah, I added getName because I have multiple layers, and I needed to
know which one is being queried. Should have mentioned that.
-----Original Message-----
From: Dave Winfield [mailto:winfield.dave at gmail.com]
Sent: July 21, 2009 12:10 PM
To: Alexandre.Laplante at statcan.gc.ca
Subject: Re: [OpenLayers-Users] getFeatureInfo projection
I'm not totally sure, but what is map.getName() returning? You
want it to be the layer that's on your wms layer.
On Tue, Jul 21, 2009 at 11:52 AM,
<Alexandre.Laplante at statcan.gc.ca> wrote:
Hello,
I have a map in EPSG:42304 projection. I'm trying to
have a getFeatureInfo return information about clicked features, but
there are always 0 results. I'm using mapserver, and when I use a
template header with:
<tr>
<th>Bounding box</th>
<td>[minx],[miny],[maxx],[maxy]</td>
</tr>
<tr>
<th>Image
Coordinates</th>
<td>[img.x],
[img.y]</td>
</tr>
<tr>
<th>Map
Coordinates</th>
<td>[mapx], [mapy]</td>
</tr>
<tr>
<th>Number of
results</th>
<td>[nr]</td>
</tr>
<tr>
<th>Scale</th>
<td>[scale]</td>
</tr>
<tr>
<th>Cellsize</th>
<td>[cellsize]</td>
</tr>
I get back something like:
Bounding box
1593723.472943,6433235.946381,1740788.283491,6511201.698335
Image Coordinates 227, 115
Map Coordinates 1663128.279584, 6476040.672944
Number of results 0
Scale -1.000000
Cellsize 0.000000
Is this an issue of projection? What does a scale of -1
mean?
This is the relevent openlayers javascript:
map.events.register('click', map, function (e) {
OpenLayers.Util.getElement('nodeList').innerHTML = "Loading... please
wait...";
var url = wms.getFullRequestString({
REQUEST: "GetFeatureInfo",
EXCEPTIONS:
"application/vnd.ogc.se_xml",
BBOX:
wms.map.getExtent().toBBOX(),
X: e.xy.x,
Y: e.xy.y,
INFO_FORMAT: 'text/html',
//QUERY_LAYERS:
wms.params.LAYERS,
QUERY_LAYERS: map.getName(),
WIDTH: wms.map.size.w,
HEIGHT: wms.map.size.h});
OpenLayers.loadURL(url, '', this, setHTML);
OpenLayers.Event.stop(e);
});
function setHTML(response) {
OpenLayers.Util.getElement('nodeList').innerHTML
= response.responseText;
}
Thank you,
Alexandre Laplante
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090723/13d74810/attachment.html
More information about the Users
mailing list