<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>

<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#ffffff" text="#000000">
Hi,<br>
&nbsp;&nbsp;&nbsp; in feature.attributes I have an empty object. One more problem is
how could i find the LonLat of the selected feature?<br>
<br>
-------- Messaggio originale --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
 cellspacing="0">
  <tbody>
    <tr>
      <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Oggetto: </th>
      <td>Re: [OpenLayers-Users] Popup over GPX track</td>
    </tr>
    <tr>
      <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Data: </th>
      <td>Tue, 11 May 2010 13:24:13 -0400</td>
    </tr>
    <tr>
      <th align="RIGHT" nowrap="nowrap" valign="BASELINE">Mittente: </th>
      <td>Charles Galpin <a class="moz-txt-link-rfc2396E" href="mailto:cgalpin@lhsw.com">&lt;cgalpin@lhsw.com&gt;</a></td>
    </tr>
    <tr>
      <th align="RIGHT" nowrap="nowrap" valign="BASELINE">A: </th>
      <td>Francesco <a class="moz-txt-link-rfc2396E" href="mailto:webfrank@tiscali.it">&lt;webfrank@tiscali.it&gt;</a></td>
    </tr>
  </tbody>
</table>
<br>
<br>
<pre>Francesco, the feature attributes will be in feature.attributes (feature.attributes.name etc)

hth,
charles

On May 11, 2010, at 12:43 PM, Francesco wrote:

&gt; Hi,
&gt;     I'm trying to display a popup on mouse over GPX track. This is the 
&gt; code used to load the track:
&gt; 
&gt; var lgpx = new OpenLayers.Layer.Vector("Track", {
&gt;                 style: {strokeColor: 'red', strokeWidth: 10, 
&gt; strokeOpacity: 0.5},
&gt;                 projection: map.displayProjection,
&gt;                 strategies: [new OpenLayers.Strategy.Fixed()],
&gt;                 protocol: new OpenLayers.Protocol.HTTP({
&gt;                     url: 'gpx.php',
&gt;                     format: new OpenLayers.Format.GPX()
&gt;                 })
&gt;             });
&gt; 
&gt;             map.addLayer(lgpx);
&gt; 
&gt;             lgpx.events.register('loadend',lgpx,function() {
&gt;                 var bounds = this.getDataExtent();
&gt;                 map.zoomToExtent(bounds);
&gt;             });
&gt;             var hoverSelect = new OpenLayers.Control.SelectFeature(lgpx, {
&gt;                 hover: true,
&gt;                 onSelect: function(feature) {
&gt; 
&gt; --------------&gt; Here I want to display a popup with info from the GPX file
&gt; 
&gt;                 },
&gt;                 onUnselect: function(feature) {
&gt;                         if (feature.popup) {
&gt;                         map.removePopup(feature.popup);
&gt;                         feature.popup.destroy();
&gt;                         delete feature.popup;
&gt;                     }
&gt;                 }
&gt;             });
&gt;             map.addControl(hoverSelect);
&gt;             hoverSelect.activate();
&gt; 
&gt; I cannot find a way to get the currently selected track segment and 
&gt; extract attributes to display inside the popup.
&gt; 
&gt; Any idea?
&gt; 
&gt; Tnx
&gt; Francesco
&gt; _______________________________________________
&gt; Users mailing list
&gt; <a class="moz-txt-link-abbreviated" href="mailto:Users@openlayers.org">Users@openlayers.org</a>
&gt; <a class="moz-txt-link-freetext" href="http://openlayers.org/mailman/listinfo/users">http://openlayers.org/mailman/listinfo/users</a>


</pre>
</body>
</html>