[OpenLayers-Users] Reading KML file into multiple layers

Roxana Grigore roxananmaria at yahoo.com
Thu Apr 21 09:41:31 EDT 2011


Hello Yerry,
You can do it by using a file with all the placemarks (having its own Vector layer).
For every placemark you put the tracks into another file and access it through a different Vector layer.
 
P.S Use extractTracks: true if you want the track.
--- On Wed, 4/20/11, Yerry <yerry at gmx.net> wrote:


From: Yerry <yerry at gmx.net>
Subject: [OpenLayers-Users] Reading KML file into multiple layers
To: users at openlayers.org
Date: Wednesday, April 20, 2011, 11:22 PM


Hello,

I have KML files with multiple tracks and multiple placemarks.

I would like to have each track in a seperate layer
and a seperate layer for all placemarks.

Currently I use the following code:

           layer = new OpenLayers.Layer.Vector("All", {
                projection: map.displayProjection,
                strategies: [new OpenLayers.Strategy.Fixed()],
                protocol: new OpenLayers.Protocol.HTTP({
                    url: KML_FILE,
                    format: new OpenLayers.Format.KML({
                        extractStyles: true,
                        extractAttributes: true
                    }),    
                }),
            });

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Reading-KML-file-into-multiple-layers-tp6293353p6293353.html
Sent from the OpenLayers Users mailing list archive at Nabble.com.
_______________________________________________
Users mailing list
Users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/openlayers-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110421/385c3b83/attachment.html


More information about the Users mailing list