Eric,<div><br></div><div>If I understand you correctly, every instance of feature.something, should now be evt.feature.something?<br><br><div class="gmail_quote">On Sun, Aug 16, 2009 at 8:00 PM, Eric Lemoine <span dir="ltr">&lt;<a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">On Sunday, August 16, 2009, Nicholas Efremov-Kendall<br>
<div class="im">&lt;<a href="mailto:n.e.kendall@gmail.com">n.e.kendall@gmail.com</a>&gt; wrote:<br>
&gt; Hi all,<br>
&gt; I&#39;m having some issues with my code, and I&#39;m not sure where the problem lies. This code worked at one point, and I&#39;ve been staring at it for too long to see the problem. Two firebug errors fire when I click on one of the POI&#39;s &quot;feature.geometry is undefined&quot; and &quot;popup is undefined&quot;. Any suggestions?<br>

&gt;<br>
&gt;<br>
&gt; var map, layer, selectedFeature, selectControl, selectedFeature, sites;function onPopupClose(evt) {            selectControl.unselect(selectedFeature);        }<br>
&gt;<br>
&gt; function onFeatureSelect(feature) {            selectedFeature = feature;<br>
<br>
</div>&quot;featureselected&quot; listeners do not receive a feature but an object<br>
with a feature property referencing the selected feature. So your code<br>
should look like this:<br>
<br>
function onFeatureSelect(evt) {<br>
    selectedFeature = evt.feature;<br>
    ...<br>
}<br>
<br>
cheers,<br>
<div><div></div><div class="h5"><br>
<br>
<br>
<br>
&gt; popup = new OpenLayers.Popup.FramedCloud(&quot;chicken&quot;,                                      feature.geometry.getBounds().getCenterLonLat(),<br>
&gt;                                      null,                                     &quot;&lt;div style=&#39;font-size:.8em&#39;&gt;Site_ID: &quot; + feature.attributes.title +&quot;&lt;hr /&gt;Locality: &quot; + feature.attributes.title+&quot;&lt;br/&gt;Description: &quot; +feature.attributes+&quot;&lt;br/&gt; Feature ID: &quot;+<a href="http://feature.id" target="_blank">feature.id</a>+&quot;&lt;br/&gt;Feature Type:&quot;+feature.attributes.NEWSITE_ +&quot;&lt;/div&gt;&quot;,<br>

&gt;                                      null, true, onPopupClose);            feature.popup = popup;            map.addPopup(popup);             }<br>
&gt;                 function onFeatureUnselect(feature) {            map.removePopup(feature.popup);            feature.popup.destroy();            feature.popup = null;<br>
&gt;         }<br>
&gt;               function init() {                       map = new OpenLayers.Map (&quot;map&quot;,<br>
&gt;                                       {                                       controls:[                                      new OpenLayers.Control.Navigation(),<br>
&gt;                                       new OpenLayers.Control.PanZoomBar(),                                    new OpenLayers.Control.LayerSwitcher(),<br>
&gt;                                       new OpenLayers.Control.Attribution()],                          sphericalMercator: true,                                maxExtent: new OpenLayers.Bounds(-20037508.34,-20037508.34,20037508.34,20037508.34),<br>

&gt;                               maxResolution: 156543.0399,                             numZoomLevels: 19,                              units: &#39;m&#39;,<br>
&gt;                               projection: new OpenLayers.Projection(&quot;EPSG:900913&quot;),                           displayProjection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
&gt;                                       }                       );<br>
&gt;                       var     sites = new OpenLayers.Layer.GML (                      &quot;Archaeological Sites&quot;, &quot;data/siteswatr.gml&quot;,<br>
&gt;                       {                       style: {pointRadius: 2.5},                      projection: new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>
&gt;                       format: OpenLayers.Format.GML                   }                       );<br>
&gt;               map.addLayer(sites);<br>
&gt;               sites.events.on({                       &#39;featureselected&#39;: onFeatureSelect,<br>
&gt;               &#39;featureunselected&#39;: onFeatureUnselect                          });<br>
&gt;<br>
&gt;             selectControl = new OpenLayers.Control.SelectFeature(sites,                {clickout: true,                               toggle: false,                          hover: false,<br>
&gt;                               }            );            map.addControl(selectControl);<br>
&gt;             selectControl.activate();<br>
&gt;                       if( ! map.getCenter() ){                        sites.events.register(&#39;loadend&#39;, sites, function(){map.zoomToExtent(sites.getDataExtent())});<br>
&gt;                       map.setCenter(null, null);                      };}<br>
&gt; --<br>
&gt; Nicholas Efremov-Kendall<br>
&gt; Fulbright Student 2009-2010, Ukraine<br>
&gt; <a href="mailto:nefremov@artsci.wustl.edu">nefremov@artsci.wustl.edu</a><br>
&gt; c/o Halyna Yerko<br>
&gt; Balzaka 92a, Kv 27<br>
&gt; 02232<br>
&gt; Kyiv, Ukraine<br>
&gt; (mob) +380963576524<br>
&gt;<br>
&gt;<br>
<br>
</div></div>--<br>
Eric Lemoine<br>
<br>
Camptocamp France SAS<br>
Savoie Technolac, BP 352<br>
73377 Le Bourget du Lac, Cedex<br>
<br>
Tel : 00 33 4 79 44 44 96<br>
Mail : <a href="mailto:eric.lemoine@camptocamp.com">eric.lemoine@camptocamp.com</a><br>
<a href="http://www.camptocamp.com" target="_blank">http://www.camptocamp.com</a><br>
</blockquote></div><br><br clear="all"><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>
</div>