[OpenLayers-Users] getFeatureInfo projection

Alexandre.Laplante at statcan.gc.ca Alexandre.Laplante at statcan.gc.ca
Tue Jul 21 11:52:25 EDT 2009


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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090721/3b314428/attachment.html


More information about the Users mailing list