<div dir="ltr"><div><div>Hi,<br><br></div>I have tried displaying data from GeoJSON file which worked fine with both localhost and local file location. But when I tried to get data from a KML file it does not show data on the vector layer, only the base layers is visible. <br>
</div>This is my vector layer instantiation for retrieving KML data. <br><div><br><span style="font-family:courier new,monospace">vector_layer = new OpenLayers.Layer.Vector('KML Data',<br>{ projection:new OpenLayers.Projection('EPSG:4326'),<br>
protocol:new OpenLayers.Protocol.HTTP({url:'flicker_data.kml', format:new OpenLayers.Format.KML({extractAttributes:true})})<br>,stratagies:new OpenLayers.Strategy.Fixed()});<br><br></span></div><div><span style="font-family:courier new,monospace"><span style="font-family:arial,helvetica,sans-serif">Thanks</span>,<br>
</span></div><div><span style="font-family:courier new,monospace"><span style="font-family:arial,helvetica,sans-serif">Nipuni</span><br></span></div><div><span style="font-family:courier new,monospace">  </span>  <br></div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, May 9, 2013 at 10:34 AM, Phil Scadden <span dir="ltr"><<a href="mailto:p.scadden@gns.cri.nz" target="_blank">p.scadden@gns.cri.nz</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">>If so (correct me if my approach incorrect), where should I put the data that I need to access from the OpenLayers application?.<br>

>Do I need to save data in a file or does the data need to be available from a server?.<br>
<br></div>
I am assuming that your application will run off a server? If so, then no problem putting the data as xml file on that server and using http to access it (eg, that is how you normally fetch GML).<br>
<br>
If you are working "server-less" then its a whole different ball game. For starters you will need to use a script protocol to get around browser security restrictions on local files. To make your life easier, if at all possible use a server. If you can feed your data to a spatial database like PostGIS and extract with WMS/WFS server like geoserver or mapserver, then it will be easier still.<br>

<br>
<br>
<br>
<br>
Notice: This email and any attachments are confidential.<br>
If received in error please destroy and immediately notify us.<br>
Do not copy or disclose the contents.<div class="HOEnZb"><div class="h5"><br>
<br>
______________________________<u></u>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/<u></u>mailman/listinfo/openlayers-<u></u>users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><div><span>Nipuni Piyabasi Perera</span></div><span>Undergraduate</span><div>Department of Computer Science And Engineering</div><div>University of Moratuwa<div>
Sri Lanka</div></div>
</div>