[mapserver-users] Re: WMSGetFeatureInfo problem (No results, using OL)

Rahkonen Jukka Jukka.Rahkonen at mmmtike.fi
Wed Jan 27 00:09:01 PST 2010


Hi,
 
Did you try to find the problem first?  You seem to run your own Mapserver.  Then you can see from the Apache access log the requests that your client is actually sending. MS4W installation the log file is by default at ms4w\apache\logs\access.log
Add DEBUG 5 into LAYER definitions in your mapfile. Copy and paste some failing GetFeatureInfo request from access log and resent it with web browser.  See what comes back, and have a look at the Mapserver errorfile which collects the DEBUG data.  It might be better to send GetFeatureInfo requests first against polygon layer because then it is easier to hit a feature by mouse click.  By hand editing the request you will have a full control in what happens.  When you know that the system works with browser you can trust that Mapserver side is OK and you can continue to OpenLayers or other clients.
 
-Jukka Rahkonen-


________________________________

	Lähettäjä: mapserver-users-bounces at lists.osgeo.org [mailto:mapserver-users-bounces at lists.osgeo.org] Puolesta stela anders
	Lähetetty: 26. tammikuuta 2010 21:33
	Vastaanottaja: MapserverList OSGEO
	Aihe: [mapserver-users] Re: WMSGetFeatureInfo problem (No results,using OL)
	
	
	Any idea whats happening?
	I lost all day trying to fix that, but got nothing :(
	
	Stella
	
	
	
	2010/1/25 stela anders <stelaanders at gmail.com>
	

		Hello guys...
		
		My mapfile:
		
		...
		  PROJECTION
		        "+init=epsg:4326"
		    END
		
		    WEB
		        IMAGEPATH 'C:\temp\'
		        IMAGEURL '/tmp/'
		        QUERYFORMAT text/html      
		        
		        METADATA
		            "wms_title"     "WMS Server" 
		            "wms_onlineresource" "http://localhost/cgi-bin/mapserv.exe?"  
		            "wms_srs"       "EPSG:4326 EPSG:42304 EPSG:42101 EPSG:4269" 
		            'wms_feature_info_mime_type' "text/html" 
		        END
		    END
		
		   QUERYMAP
		        COLOR 255 0 0
		        SIZE -1 -1
		        STATUS OFF
		        STYLE hilite
		    END
		...
		
		LAYER
		...
		       METADATA
		            "wms_title"    "Test"   ##required
		             "wms_include_items" "all"
		             "wms_feature_info_mime_type" "text/html"              
		        END       
		        TYPE POINT
		        STATUS ON
		        INCLUDE "Connection.map" 
		        DATA "the_geom from viwtest USING UNIQUE oid USING SRID=0"
		        PROJECTION
		            "+init=epsg:4326"
		        END
		        
		        TOLERANCE 5
		         HEADER   "header.html" 
		        TEMPLATE "template.html"     
		         FOOTER   "footer.html" 
		...
		
		Templates:
		Header.html
		<!-- MapServer Template -->
		<html> 
		  <head> 
		    <title>MapServer Template Sample</title> 
		  </head> 
		
		Template.html
		<!-- MapServer Template -->
		<body> 
		    <b>OID:</b> [oid]
		  </body> 
		
		Footer.html
		</html>
		
		WMSGetFeatureInfo  Javascript (OpenLayer)
		
		var infoCtl = new OpenLayers.Control.WMSGetFeatureInfo({ 
		                    layers: [_test], 
		                    title: 'Click on the map to get information on layers', 
		                    queryVisible: true, 
		                    infoFormat: 'text/html' 
		                }); 
		              
		                infoCtl.events.register("getfeatureinfo",map,showInfo); 
		
		 function showInfo(evt) {    
		            alert(evt.text);
		} 
		
		
		I´m getting that :
		
		<html> 
		  <head> 
		    <title>MapServer Template Sample</title> 
		  </head> Content-type: application/vnd.ogc.se_xml
		
		<?xml version='1.0' encoding="ISO-8859-1" standalone="no" ?>
		<!DOCTYPE ServiceExceptionReport SYSTEM "http://schemas.opengis.net/wms/1.1.1/exception_1_1_1.dtd">
		<ServiceExceptionReport version="1.1.1">
		<ServiceException>
		</ServiceException>
		</ServiceExceptionReport>
		
		
		Any idea whats happening?
		
		Stella
		
		
		


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100127/747bb241/attachment.htm>


More information about the MapServer-users mailing list