Hi everyone!! <br><br>I tried to test this script:<br><br><pre class="wiki">/*<br> * Get the Ajax response and pop up a info bubble<br> */<br>function setHTML(response) {<br> if (response.responseText.indexOf('no results') == -1) {<br>
var cat="Unknown", src="Unknown", leg="Unknown", linkinfo="";<br> var lines = response.responseText.split('\n');<br> for (lcv = 0; lcv < (lines.length); lcv++) {<br>
var vals = lines[lcv].replace(/^\s*/,'').replace(/\s*$/,'').replace(/ = /,"=").replace(/'/g,'').split('=');<br> if (vals[1] == "") {<br> vals[1] = "Unknown";<br>
}<br> if (vals[0].indexOf('CATEGORY') != -1 ) {<br> cat = vals[1];<br> } else if (vals[0].indexOf('SOURCE') != -1 ) {<br> src = vals[1];<br> } else if (vals[0].indexOf('LEGEND') != -1 ) {<br>
leg = vals[1];<br> } else if (vals[0].indexOf('DATAITEM') != -1 ) {<br> linkinfo = vals[1];<br> }<br> }<br> var popup_info = "<font size=2><b>" + cat +<br>
"<br>Description:</b> " + leg +<br> "<br><a href='" + linkinfo + "' target='_blank'>More Info</a>" +<br>
"<br><font size=1>Source: " + src +<br> "</font></font>";<br> if (popup != null) {<br> popup.destroy();<br> popup = null;<br>
}<br> popup = new OpenLayers.Popup.AnchoredBubble("SDVegetationInfo",<br> mouseLoc,<br> new OpenLayers.Size(250,120),<br>
popup_info,<br> null,<br> true);<br> popup.setBackgroundColor("#bcd2ee");<br>// popup.setOpacity(.7);<br>
map.addPopup(popup);<br> popup.events.register("click", map, popupDestroy);<br> }<br>}<br><font style="font-family: arial,helvetica,sans-serif;" size="2"><br></font><font style="font-family: arial,helvetica,sans-serif;" size="2">It is defined here <a href="http://trac.openlayers.org/wiki/GetFeatureInfo">http://trac.openlayers.org/wiki/GetFeatureInfo</a>, as an example!<br>
<br>I'm using Geoserver 1.6.5 and I've got this error from my javascript debbuger:<br><br>Error: OpenLayers.Popup is undefined<br><br>Then, I tried to find it in openlayers.js that's inside Geoserver... and there isn't<br>
any kind of code that sounds a Popup class definition.<br><br>I'd really like to use some popups on my geoserver maps, using openlayers... <br><br>Does anyone knows something about this issue?? <br><br>I apreciate any help =)<br>
<br>Thanks for now!<br><br>Rodrigo</font><br><br><br><br></pre><br clear="all"><br>======================================<br>Rodrigo C. Antonialli<br>Rio Claro - SP - Brasil<br>LinkedIn: <a href="http://www.linkedin.com/in/rcaprofile">http://www.linkedin.com/in/rcaprofile</a><br>
Contato: (19) 9757-0370<br> <a href="mailto:rca.cirdan@gmail.com">rca.cirdan@gmail.com</a><br> <a href="mailto:rcantonialli@gmail.com">rcantonialli@gmail.com</a><br> Skype: rc_antonialli<br>
<br><br>