[OpenLayers-Users] Howto extract document attributes(name/description) from KML Layer

Sven Geggus lists at fuchsschwanzdomain.de
Mon Aug 2 05:20:38 EDT 2010


Arnd Wippermann <arnd.wippermann at web.de> wrote:

> As you have set extractAttributes to true you can do something like this:
> 
> var fts = brewpub_layer.features;
> 
> var theHTML = "";
> 
> for(var i=0;i<fts.length;i++)
> {
>      theHTML = fts[i].attributes.name + ", " +
> fts[i].attributes.description + "<br>";
> }

Hm fts seems to be of zero length here.

So when do I have to run this code? Looks like the kml is not been read
immediately after layer generation.

Sven

-- 
"If you don't make lower-resolution mapping data publicly
available, there will be people with their cars and GPS
devices, driving around with their laptops" (Tim Berners-Lee)
/me is giggls at ircnet, http://sven.gegg.us/ on the Web



More information about the Users mailing list