<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div>Hi Andres,<br><br>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. <br><br>-Ravi.<br></div><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;"><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Andres Deparis <andres.deparis@gmail.com><br><b><span style="font-weight: bold;">To:</span></b> users@openlayers.org<br><b><span style="font-weight: bold;">Sent:</span></b> Wed, March 16, 2011 1:33:02 PM<br><b><span style="font-weight: bold;">Subject:</span></b> [OpenLayers-Users] Fwd: Path problem with kml files<br></font><br><br>Hello all,<br>I am trying to load some kml
file into openlayer however, if I put my htm page in the browser this way: <a rel="nofollow" target="_blank" href="http://localhost/mypage.htm">http://localhost/mypage.htm</a> it does not find the kml file which is loaded in the root of the site.<br>
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.<br><br>Can someone please help me to solve this problem? Below is my piece of code.<br><br>
Thank you all!<br><br>map.addLayer(new OpenLayers.Layer.GML("KML", "myTest.kml", <br> {<br> projection: new OpenLayers.Projection("EPSG:<div>4326"),<br>
displayProjection: new OpenLayers.Projection("EPSG:900913"), <br>
<br> format: OpenLayers.Format.KML, <br> formatOptions: {<br> extractStyles: true, <br> extractAttributes: true,<br> maxDepth: 2<br> }<br>
}));<br><font color="#888888"><br>Andres</font></div><br>
</div></div>
</div><br>
</body></html>