oh of course change the url as needed...<br><br><div class="gmail_quote">On Fri, Jan 14, 2011 at 12:01 PM, IT Intern <span dir="ltr"><<a href="mailto:itintern12@gmail.com">itintern12@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Try adding this instead:<br><br><p class="MsoNormal"><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 192); background: none repeat scroll 0% 0% white;">var</span></b><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: black;">featureInfo</span> <span style="color: rgb(92, 92, 92);">=</span>
<b><span style="color: rgb(0, 0, 192);">new</span></b> <span style="color: black;">OpenLayers</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">Control</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">WMSGetFeatureInfo</span><span style="color: rgb(92, 92, 92);">({<br>
url: '<a href="http://10.0.102.11:8080/geoserver/wms" target="_blank">http://10.0.102.11:8080/geoserver/wms</a>',<br> queryVisible: true,<br> eventListeners: {</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
// <span style="color: black;">featureInfo</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">events</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">on</span><span style="color: rgb(92, 92, 92);">({</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<div class="im">
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">getfeatureinfo</span><span style="color: rgb(92, 92, 92);">:</span> <b><span style="color: rgb(0, 0, 192);">function</span></b><span style="color: rgb(92, 92, 92);">(</span><span style="color: black;">e</span><span style="color: rgb(92, 92, 92);">)</span> <span style="color: rgb(92, 92, 92);">{</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<b><span style="color: rgb(0, 0, 192);">new</span></b> <span style="color: black;">GeoExt</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">Popup</span><span style="color: rgb(92, 92, 92);">({</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">title</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(0, 92, 0);">"Feature Info"</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">width</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(0, 64, 128);">200</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">height</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(0, 64, 128);">150</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">autoScroll</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(128, 0, 64);">true</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">queryVisible</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(128, 0, 64);">true</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">map</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: black;">map</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">feature_count</span><span style="color: rgb(92, 92, 92);">:</span>
<span style="color: rgb(0, 64, 128);">50</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92);">//Used as
some
layers consist of point data that are grouped in close proximity to each
other</span><span style="font-size: 10pt;"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">lonlat</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: black;">mapPanel</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">map</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">getLonLatFromPixel</span><span style="color: rgb(92, 92, 92);">(</span><span style="color: black;">e</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">xy</span><span style="color: rgb(92, 92, 92);">),</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: black;">html</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: black;">e</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">text</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: rgb(92, 92, 92);">}).</span><span style="color: black;">show</span><span style="color: rgb(92, 92, 92);">();</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: rgb(92, 92, 92);">}</span></span></p><p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"><span style="color: rgb(92, 92, 92);"> }</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">});</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">mapPanel</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">.</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">map</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">.</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">addControl</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">(</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">featureInfo</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">);</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">featureInfo</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">.</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">activate</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">();</span><br>
<br></div>Double check that parenthesis and braces match, I looked through it quickly...<br><br>elshae<br><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Fri, Jan 14, 2011 at 10:42 AM, Evans, Barry <span dir="ltr"><<a href="mailto:be208@exeter.ac.uk" target="_blank">be208@exeter.ac.uk</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div><div></div><div class="h5">
<div link="blue" vlink="purple" lang="EN-GB">
<div>
<p class="MsoNormal">I think this question may have been asked before but I’ve
looked online and can’t find it now. I’m using the following code
to get feature information to display in a popup, for some reason however, it
is only showing information from just one layer which is the first layer that
is called into the map? Does anyone know if this is a problem with GeoExt or
more likely something missing from code? Below is the snippet of code I am
using for generating featureinfo popup:</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"><b><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(0, 0, 192); background: none repeat scroll 0% 0% white;">var</span></b><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: black;">featureInfo</span> <span style="color: rgb(92, 92, 92);">=</span>
<b><span style="color: rgb(0, 0, 192);">new</span></b> <span style="color: black;">OpenLayers</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">Control</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">WMSGetFeatureInfo</span><span style="color: rgb(92, 92, 92);">();</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: black;">featureInfo</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">events</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">on</span><span style="color: rgb(92, 92, 92);">({</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">getfeatureinfo</span><span style="color: rgb(92, 92, 92);">:</span> <b><span style="color: rgb(0, 0, 192);">function</span></b><span style="color: rgb(92, 92, 92);">(</span><span style="color: black;">e</span><span style="color: rgb(92, 92, 92);">)</span> <span style="color: rgb(92, 92, 92);">{</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<b><span style="color: rgb(0, 0, 192);">new</span></b> <span style="color: black;">GeoExt</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">Popup</span><span style="color: rgb(92, 92, 92);">({</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">title</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(0, 92, 0);">"Feature Info"</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">width</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(0, 64, 128);">200</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">height</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(0, 64, 128);">150</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">autoScroll</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(128, 0, 64);">true</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: black;">queryVisible</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: rgb(128, 0, 64);">true</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: black;">map</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: black;">map</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">feature_count</span><span style="color: rgb(92, 92, 92);">:</span>
<span style="color: rgb(0, 64, 128);">50</span><span style="color: rgb(92, 92, 92);">,</span></span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92);">//Used as some
layers consist of point data that are grouped in close proximity to each other</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;">
<span style="color: black;">lonlat</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: black;">mapPanel</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">map</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">getLonLatFromPixel</span><span style="color: rgb(92, 92, 92);">(</span><span style="color: black;">e</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">xy</span><span style="color: rgb(92, 92, 92);">),</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: black;">html</span><span style="color: rgb(92, 92, 92);">:</span> <span style="color: black;">e</span><span style="color: rgb(92, 92, 92);">.</span><span style="color: black;">text</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: rgb(92, 92, 92);">}).</span><span style="color: black;">show</span><span style="color: rgb(92, 92, 92);">();</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> <span style="color: rgb(92, 92, 92);">}</span></span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal" style="margin-left: 108pt; text-indent: 36pt;"><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">});</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">mapPanel</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">.</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">map</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">.</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">addControl</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">(</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">featureInfo</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">);</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">featureInfo</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">.</span><span style="font-size: 10pt; font-family: "Courier New"; color: black; background: none repeat scroll 0% 0% white;">activate</span><span style="font-size: 10pt; font-family: "Courier New"; color: rgb(92, 92, 92); background: none repeat scroll 0% 0% white;">();</span><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> </span></p>
<p class="MsoNormal"><span style="font-size: 10pt; font-family: "Courier New"; background: none repeat scroll 0% 0% white;"> </span></p>
<p class="MsoNormal">Any help would be greatly appreciated.</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Kind regards,</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Barry</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">Email: <a href="mailto:be208@ex.ac.uk" target="_blank">be208@ex.ac.uk</a><span style="font-size: 10pt; font-family: "Courier New";"></span></p>
</div>
</div>
<br></div></div>_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@geoext.org" target="_blank">Users@geoext.org</a><br>
<a href="http://www.geoext.org/cgi-bin/mailman/listinfo/users" target="_blank">http://www.geoext.org/cgi-bin/mailman/listinfo/users</a><br>
<br></blockquote></div><br>
</blockquote></div><br>