[OpenLayers-Users] Problem with KML layer

Diego Roberto diegorrborges at yahoo.com.br
Mon Sep 28 21:37:16 EDT 2009


Hello everyone. Currently I have a problem to load a layer in KML format dynamically. 
It works as follows: 
- It selected the data that you want to build the KML 
- Class in Java that creates the KML file and returns the address where is stored on the server 
- Below I have a function that loads and sets this return address: 

function renderKml(urlListaPontos){
        pontos.destroy();
        pontos= new OpenLayers.Layer.Vector("Lista de Pontos", {
        projection: map.displayProjection,
        strategies: [new OpenLayers.Strategy.Fixed()],
        protocol: new OpenLayers.Protocol.HTTP({


   / / Return  is http://localhost:8080/kml/pontos.kml             url: urlListaPontos,
            format: new OpenLayers.Format.KML({
                extractStyles: true,
                extractAttributes: true
            })
        })
    });

      map.addLayer(pontos);
    select = new OpenLayers.Control.SelectFeature(pontos);

    empresas.events.on({
        "featureselected": onFeatureSelect,
        "featureunselected": onFeatureUnselect
    });

    map.addControl(select);
    select.activate();     
 }

- 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. 


   Can someone help me. My problem is based on the following example of KML OpenALayers: 

http://www.openlayers.org/dev/examples/sundials.html


Thank you all for your attention.

Diego Roberto
+55 (62) 96190902


      ____________________________________________________________________________________
Veja quais são os assuntos do momento no Yahoo! +Buscados
http://br.maisbuscados.yahoo.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20090928/ddf28401/attachment.html


More information about the Users mailing list