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.d...@gmail.com] 
        Sent: July 21, 2009 12:10 PM
        To: alexandre.lapla...@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.lapla...@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@openlayers.org
                http://openlayers.org/mailman/listinfo/users
                
                


_______________________________________________
Users mailing list
Users@openlayers.org
http://openlayers.org/mailman/listinfo/users

Reply via email to