<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt"><div>Hello everyone. Currently I have a problem to load a layer in KML format dynamically. 
<br> It works as follows: 
<br> - It selected the data that you want to build the KML 
<br> - Class in Java that creates the KML file and returns the address where is stored on the server 
<br> - Below I have a function that loads and sets this return address: 
<br><br>
function renderKml(urlListaPontos){<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pontos.destroy();<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; pontos= new OpenLayers.Layer.Vector("Lista de Pontos", {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; projection: map.displayProjection,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; strategies: [new OpenLayers.Strategy.Fixed()],<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; protocol: new OpenLayers.Protocol.HTTP({<br><table id="texttable"><tbody><tr valign="top"><td id="sourcecell"><div id="file_div" class="file" style="display: none;"><input name="file" id="file" size="50" type="file"></div><script>_SetupBidi('source');</script><br></td><td id="gap">&nbsp;</td><td class="almost_half_cell"><div id="result_box" dir="ltr"><span>/ / Return&nbsp; is <a target="_blank" href="http://localhost:8080/kml/pontos.kml">http://localhost:8080/kml/pontos.kml</a></span></div></td></tr></tbody></table>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;
 &nbsp;&nbsp;&nbsp; url: urlListaPontos,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; format: new OpenLayers.Format.KML({<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extractStyles: true,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; extractAttributes: true<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; })<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; })<br>&nbsp;&nbsp;&nbsp; });<br><br>
&nbsp; &nbsp;&nbsp;&nbsp; map.addLayer(pontos);<br>&nbsp;&nbsp;&nbsp; select = new OpenLayers.Control.SelectFeature(pontos);<br><br>&nbsp;&nbsp;&nbsp; empresas.events.on({<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "featureselected": onFeatureSelect,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; "featureunselected": onFeatureUnselect<br>&nbsp;&nbsp;&nbsp; });<br><br>&nbsp;&nbsp;&nbsp; map.addControl(select);<br>&nbsp;&nbsp;&nbsp; select.activate();&nbsp;&nbsp;&nbsp;&nbsp; <br>&nbsp;}<br><br> - When do so, it built the KML file, it returns the address not
only carries the markers on the map and really do not know why. Testo
If this KML file separately in the map loading the beginning it works
normally. I tried instead to create a file, pass a String most direct
yet without success. That is, it builds the kml, returns the correct
address on the server but does not carry the markers on the map. <br> <table id="texttable"><tbody><tr valign="top"><td id="sourcecell"><div id="file_div" class="file" style="display: none;"><input name="file" id="file" size="50" type="file"></div><script>_SetupBidi('source');</script><br></td><td id="gap">&nbsp;</td><td class="almost_half_cell"><div id="result_box" dir="ltr">Can someone help me. My problem is based on the following example of KML OpenALayers: <br><br><span> <a target="_blank" href="http://www.openlayers.org/dev/examples/sundials.html">http://www.openlayers.org/dev/examples/sundials.html</a></span><br><br><br>Thank you all for your attention.<br><br>Diego Roberto<br>+55 (62) 96190902<br></div></td></tr></tbody></table></div></div><br>


      <hr size=1>Veja quais são os assuntos do momento no Yahoo! + Buscados: <a href="http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/">Top 10</a> - <a href="http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/celebridades/">Celebridades</a> - <a href="http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/m%C3%BAsica/">Música</a> - <a href="http://br.rd.yahoo.com/mail/taglines/mail/*http://br.maisbuscados.yahoo.com/esportes/">Esportes</a></body></html>