[OpenLayers-Users] Fwd: Path problem with kml files

Ravi Pavuluri ravitheja at ymail.com
Wed Mar 16 15:56:52 EDT 2011


Hi Andres,

Based on my experience with Google Maps API in the past, you need to keep the 
kml on a web accessible location. Localhost doesn't work. 


-Ravi.




________________________________
From: Andres Deparis <andres.deparis at gmail.com>
To: users at openlayers.org
Sent: Wed, March 16, 2011 1:33:02 PM
Subject: [OpenLayers-Users] Fwd: Path problem with kml files


Hello all,
I am trying to load some kml file into openlayer however, if I put my htm page 
in the browser this way: http://localhost/mypage.htm it does not find the kml 
file which is loaded in the root of the site.
Now, if I load the page in the browser this way:  file:///C:/inetpub/wwwroot/ , 
then openlayers can open it very fast and  no problem.

Can someone please help me to solve this problem? Below is my piece of code.

Thank you all!

map.addLayer(new OpenLayers.Layer.GML("KML", "myTest.kml", 
               {
                projection: new OpenLayers.Projection("EPSG:
4326"),
                displayProjection: new OpenLayers.Projection("EPSG:900913"), 

                format: OpenLayers.Format.KML, 
                formatOptions: {
                  extractStyles: true, 
                  extractAttributes: true,
                  maxDepth: 2
                }
               }));

Andres



      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-users/attachments/20110316/61d8613d/attachment.html


More information about the Users mailing list