<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hello,</div><div><br></div><div>I have been trying to get the Mobile Jquery Demo to work with my own data. Currently, I am trying to configure the application so that when a user clicks, the application will identify using WMSGetFeatureInfo as opposed to getting information from the sprinters layer. Openlayers is crashing when I try to display the results of WMSGetFeatureInfo. Has anyone had any luck configuring WMSGetFeatureInfo with the Mobile JQuery? If someone could help me, I would appreciate it. Thank You!<br></div><div><br></div>With help I have thus far:<br>* The click event to call WMSGetFeatureInfo<br>* Openlayers calls GeoServer to get WMSGetFeatureInfo<br>* The click event is registered to call a function named ShowWMSInfo<br>Unfortunately Openlayers crashes in the ShowWMSInfo, which
is where I am trying to display the results from geoserver<br><br>Here is the code that I have thus far changed in mobile-base.js<div>#1 Changed the select control to use WMSGetFeatureInfo<br></div><div><br></div><div> //var selectControl = new OpenLayers.Control.SelectFeature(sprintersLayer, {<br> // autoActivate:true,<br> // onSelect: onSelectFeatureFunction});<br>// ** updated selectControl code**<br> var selectControl = new OpenLayers.Control.WMSGetFeatureInfo({<br> url: 'http://demo.opengeo.org/geoserver/wms', <br> title: 'Identify features by clicking',<br> layers: [water],<br> queryVisible: true,<br>
autoActivate:true<br> //onSelect: onSelectFeatureFunction<br> });</div><div><br></div><div>#2 Registered the recoded select control from #1 to call a function called ShowWMSInfo.<br></div><div><br></div><div>selectControl.events.register("getfeatureinfo", this, ShowWMSInfo);</div><div><br></div>#3 NOT WORKING - On each click the ShowWMSInfo function is called. According to firebug, GeoServer is returning a result for WMSGetFeatureInfo. However, I cannot figure out how to display the results in openlayers.<br><br><div>function ShowWMSInfo(e) {<br> var html = '<table class="getfeatureinfo">';<br> var html += '<tr><th colspan=2" class="layerTitle">' + "</th><th></th><tr>"<br> if (e.features && e.features.length)
{<br> var val = e.features[0].attributes.id;<br> document.getElementById('WATER_TYPE').value = val;<br> }<br> return html += '</td></tr>'';<br> return html;<br> }<br></div><br></div></body></html>