<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Arial, sans-serif" size="2">
<div>Below is my code for when I hover over a specific layer and the popup hotspot information is shown. I am trying to figure out how to only get one popup to show at a time so that I can show them like tooltips and destroy the existing one if another is shown.
I have tried using if (infopop) or if (!infopop) but this doesn't seem to work in the way I have this coded. If anyone has any advice on how to destroy my popup when another is created thanks!</div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div> </div>
<div>var info, infopop;</div>
<div> </div>
<div> //Getfeatureinfo object</div>
<div> info = new OpenLayers.Control.WMSGetFeatureInfo({</div>
<div> url: '<a href="http://ITS701X5J1/RedWMS/Request.aspx"><font color="#0000FF"><u>http://ITS701X5J1/RedWMS/Request.aspx</u></font></a>', </div>
<div> title: 'Identify features by clicking',</div>
<div> layers: [layer_Garbage_Zones],</div>
<div> queryVisible: true,</div>
<div> infoFormat: 'text/html',</div>
<div> maxFeatures: 1,</div>
<div> hover:true</div>
<div> });</div>
<div> </div>
<div> info.events.on({</div>
<div> getfeatureinfo: function(e) {</div>
<div> </div>
<div> infopop = new GeoExt.Popup({ //utilizing the GeoExt popup functionality</div>
<div> title: "Hotspot Information",</div>
<div> //height: 215,</div>
<div> //width: 600,</div>
<div> autoWidth: true,</div>
<div> autoHeight: true,</div>
<div> autoScroll: false,</div>
<div> // panIn: true,</div>
<div> map: map,</div>
<div> lonlat: map.getLonLatFromPixel(e.xy),</div>
<div> html: e.text</div>
<div> })</div>
<div> </div>
<div> etext = e.text;</div>
<div> // if the hotspot information is empty (layer doesn't match) don't display!</div>
<div> if (etext.length == 45)</div>
<div> {</div>
<div> infopop.close();</div>
<div> }</div>
<div> else</div>
<div> {</div>
<div> infopop.show();</div>
<div> }</div>
<div> }});</div>
<div> </div>
<div> </div>
<div> map.addControl(info);</div>
<div> info.activate();</div>
<div> </div>
<div> </div>
</font>
<DIV><P><HR>
This e-mail is intended for the original recipient(s) only. If you have received it in error, please advise the sender and delete this message.
</P></DIV>
</body>
</html>