<div>Hi all,</div><div><br></div><div>I'm still having troubles with my popups. I don't think I fully grasped Eric's advice. The error I get in Safari's error console is the following result of expression popup is not an object, referencing line 10 of my code and line 803 of Openlayers.js (2.8). Any suggestions?</div>
<div><br></div><div>function onPopupClose(evt) {</div><div> selectControl.unselect(selectedFeature);</div><div> }</div><div><br></div><div>function onFeatureSelect(evt) {</div><div> selectedFeature = evt.feature;</div>
<div> popup = new OpenLayers.Popup.FramedCloud("chicken", </div><div> feature.geometry.getBounds().getCenterLonLat(),</div><div> null,</div>
<div> "<div style='font-size:.8em'>Site_ID: " + feature.attributes.title +"<hr />Locality: " + feature.attributes.title+"<br/>Description: " +feature.attributes+"<br/> Feature ID: "+<a href="http://feature.id">feature.id</a>+"<br/>Feature Type:"+feature.attributes.NEWSITE_ +"</div>",</div>
<div> null, true, onPopupClose);</div><div> feature.popup = popup;</div><div> map.addPopup(popup);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span> }</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span> function onFeatureUnselect(feature) {</div><div> map.removePopup(feature.popup);</div><div> feature.popup.destroy();</div><div> feature.popup = null;</div>
<div> } </div><div>...</div><div><div>sites.events.on({</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>'featureselected': onFeatureSelect,</div><div> <span class="Apple-tab-span" style="white-space:pre">                </span>'featureunselected': onFeatureUnselect</div>
<div><span class="Apple-tab-span" style="white-space:pre">                                </span>});</div><div><br></div><div> selectControl = new OpenLayers.Control.SelectFeature(sites,</div><div> {clickout: true,</div><div>
<span class="Apple-tab-span" style="white-space:pre">                                </span>toggle: false,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>hover: false,</div><div><span class="Apple-tab-span" style="white-space:pre">                                </span>}</div>
<div> );</div><div> map.addControl(selectControl);</div><div> selectControl.activate();</div></div><br>-- <br>Nicholas Efremov-Kendall<br>Fulbright Student 2009-2010, Ukraine<br><a href="mailto:nefremov@artsci.wustl.edu">nefremov@artsci.wustl.edu</a><br>
c/o Halyna Yerko<br>Balzaka 92a, Kv 27<br>02232<br>Kyiv, Ukraine<br>(mob) +380963576524<br>