Dear list,

I have got a question to the handling of "empty" getfeatureinfo-results.


The "core" of getfeatureinfo.html (in the examples) is:

            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,
                            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;
    }


It works nice if I click on an existing wms-point.

I wonder how to handle a empty "non-existing-response" (that comes if I click 
beside a wms-point).

I try to write a function (new_window(url)) that opens a new window with an 
entry "You clicked besides the point" (or, if not, the result of the wms-point).

like :

           function setHTML(response,url) {
        //"non existing response" -> click besides a point
        if (response.responseText.length==1) {
 
          url='http://noresult_url';
         new_window(url);
         } 
//response -> click on a point
else 
{
    new_window(url);
}
}  


But the problem is: I don`t get it to transport the url to the function 
"setHTML", so that setHTML works with that ajax-response AND(!) the url.

Has anybody an idea how to solve/handle that?

Thank you very much, Kai
-- 
Psssst! Schon vom neuen GMX MultiMessenger gehört? Der kann`s mit allen: 
http://www.gmx.net/de/go/multimessenger01
_______________________________________________
Users mailing list
[email protected]
http://openlayers.org/mailman/listinfo/users

Reply via email to