[OpenLayers-Users] Nodelist Info / GetFeatureInfo not working

Roald de Wit list at rdewit.net
Sun May 9 18:06:52 EDT 2010


Hi Pascal,

You should pretty much always get at least *something* back: either an 
error or an empty reponse (FireBug would tell you). Have you really got 
":80" in your settings like below?

     OpenLayers.loadURL("http://myownhomepage.xyz:80/geoserver/wms", 
params, this, setHTML, setHTML);

If your Tomcat runs on port 80 then you can leave out the port number. 
That might do the trick (and yes, it would then have been a proxy 
issue). Like this:

     OpenLayers.loadURL("http://myownhomepage.xyz/geoserver/wms 
<http://myownhomepage.xyz:80/geoserver/wms>", params, this, setHTML, 
setHTML);

And since your OL is on the same server as your GS, you could even do this:

     OpenLayers.loadURL("/geoserver/wms 
<http://myownhomepage.xyz:80/geoserver/wms>", params, this, setHTML, 
setHTML);

And to deal with errors in your AJAX request, why not use a separate 
function like this:

     OpenLayers.loadURL("/geoserver/wms 
<http://myownhomepage.xyz:80/geoserver/wms>", params, this, setHTML, 
*onAjaxError*);

Regards, Roald

On 10/05/10 05:45, boxplot wrote:
> Hi,
>
> maybe a made a small progress. As I have written in my last mail I get 
> no response when using GetFeatureInfo (I do get a response when using 
> the GeoServer OpenLayers example which I can access through "Layer 
> Preview" => see code below). So I copied both requests directly into 
> my browser and both got a response:
>
>> http://myownhomepage.xyz/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=12.327023%2C47.673%2C12.362977%2C47.777&X=79&Y=375&INFO_FORMAT=text%2Fhtml&QUERY_LAYERS=Workspace%3ALayer&FEATURE_COUNT=50&Srs=EPSG%3A4326&Layers=Workspace%3ALayer&Styles=&WIDTH=177&HEIGHT=512&format=image%2Fpng 
>> <http://myownhomepage.xyz/geoserver/wms?REQUEST=GetFeatureInfo&EXCEPTIONS=application%2Fvnd.ogc.se_xml&BBOX=12.327023%2C47.673%2C12.362977%2C47.777&X=79&Y=375&INFO_FORMAT=text%2Fhtml&QUERY_LAYERS=Workspace%3ALayer&FEATURE_COUNT=50&Srs=EPSG%3A4326&Layers=Workspace%3ALayer&Styles=&WIDTH=177&HEIGHT=512&format=image%2Fpng>
>
> GeoServer runs as a .war within Tomcat and OpenLayers is on the same 
> server. I really can't believe why the same code with the same request 
> on the same server is once getting a response and the other time it is 
> not. Is there a possibility that it is a proxy-issue or maybe a 
> problem with the encoding?
>
> Thanks, Pascal
>
> Am 09.05.2010 um 01:05 schrieb Roald de Wit:
>
>> Hi,
>>
>> Have you looked at the request that OL is sending to GS? The FireBug 
>> addin for Firefox has a 'Net' tab that shows you every request that 
>> your application sends, including what response it gets back.
>> That might help you find out what's wrong.
>>
>> Regards, Roald
>>




More information about the Users mailing list