Hi all, <br><br>I was using google maps and last week I decided to use OpenLayers, so I&#39;m quite a new user.<br><br>So now I&#39;m changing all my code to OpenLayers, but I have this problem that I was adding features from a database and then I was showing the balloons with the description. <br>
<br>Now I want to show it in a table that it is outside the map. But can anybody advise me what is the best way to add features from the database (they can be hundreds of polygons), I have try to use GML and the text file, but once they are in the map I can not detect when a feature was clicked, I was using this code:<br>
<br><br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; function init(){<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; var mylayer =&nbsp;&nbsp; new OpenLayers.Layer.GML(&quot;GML&quot;, &quot;../KML/MyPolygon.xml&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; map.addLayer(mylayer);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selectControl = new OpenLayers.Control.SelectFeature(mylayer,<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; selectControl.activate();<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br><br><br>But doens&#39;t work, does anybody knows why?<br><br>And just one last thing, is this the best way to add hundreds of features to the map?<br>
<br>Thanks in advance<br><br>Carlos<br>