<div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">Hi,</span></div><div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br>
</span></div><div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I want to use this control but i don't know how... I've found the same information in all forums and tutorials but it doesn't work. What's wrong? </span></div>
<div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">I've tried with diferents options and there's no way. </span></div><div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br>
</span></div><div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br></span></div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><div>
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">With pop-up:</span></div><div><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><br>
</span></div>info = new OpenLayers.Control.WMSGetFeatureInfo({ </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> url: '</span><a href="http://localhost:8080/geoserver/Proj_CAT/wms'" target="_top" rel="nofollow" link="external" style="font-size:13px;color:rgb(85,26,139);font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;background-color:rgb(255,255,255)">http://localhost:8080/geoserver/Proj_CAT/wms'</a><span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">, </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> title: 'Identify features by clicking', </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> queryVisible: true, </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> eventListeners: { </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> getfeatureinfo: function(event) { </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> map.addPopup(new OpenLayers.Popup.FramedCloud( </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> "chicken", </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> map.getLonLatFromPixel(event.xy), </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> null, </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> event.text, </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> null, </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> true </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> )); </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> } </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> } </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> }); </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> map.addControl(info); </span><br style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)">
<span style="font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;font-size:13px;background-color:rgb(255,255,255)"> info.activate(); </span> <br clear="all"><div><br></div><div><br></div><div>With text:</div><div>
<br></div><div><div>infoControls = {</div><div> click: new OpenLayers.Control.WMSGetFeatureInfo({</div><div> url: '<a href="http://demo.opengeo.org/geoserver/wms">http://demo.opengeo.org/geoserver/wms</a>', </div>
<div> title: 'Identify features by clicking',</div><div> layers: [water],</div><div> queryVisible: true</div><div> }),</div><div> hover: new OpenLayers.Control.WMSGetFeatureInfo({</div>
<div> url: '<a href="http://demo.opengeo.org/geoserver/wms">http://demo.opengeo.org/geoserver/wms</a>', </div><div> title: 'Identify features by clicking',</div><div> layers: [water],</div>
<div> hover: true,</div><div> // defining a custom format options here</div><div> formatOptions: {</div><div> typeName: 'water_bodies', </div><div> featureNS: '<a href="http://www.openplans.org/topp">http://www.openplans.org/topp</a>'</div>
<div> },</div><div> queryVisible: true</div><div> })</div><div> }</div></div><div><br></div><div>infoControls.click.activate();</div><div>function showInfo(evt) { $('responseText').innerHTML = evt.text;}</div>
<div><br></div><div>And in the body: <div id="responseText"></div></div><div><br></div><div><br></div><div><div>There's still more options and I've tried some of them with the same result: The map is displayed but I can't display the layer info when I click.</div>
<div><br></div><div>Thanks!</div></div><div><br></div>-- <br><a href="http://kikocanas.blogspot.com" target="_blank">http://kikocanas.blogspot.com</a><br>