<div dir="ltr"><div><div><div>Hi Grey,<br><br></div>It works fine, Thanks<br><br></div>Thanks,<br></div>Nipuni<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 25, 2013 at 5:32 PM, Nipuni Perera <span dir="ltr"><<a href="mailto:nipuni880917@gmail.com" target="_blank">nipuni880917@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hi,<br><br></div>This is also not working, it may be an issue with my server. Thanks<br><br>
</div>Thanks,<br></div>Nipuni<br></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, May 25, 2013 at 4:16 PM, Gery . <span dir="ltr"><<a href="mailto:gamejihou@hotmail.com" target="_blank">gamejihou@hotmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div><div dir="ltr"><font style="font-size:10pt" color="#366092" face="Arial"><br></font>it looks good to me, probably modifying your code like this?:<br><br><pre><code><span></span><span>new</span><span> </span><span>OpenLayers</span><span>.</span><span>Layer</span><span>.</span><span>Vector</span><span>(</span><span>"KML"</span><span>,</span><span> </span><span>{</span><span>
            strategies</span><span>:</span><span> </span><span>[</span><span>new</span><span> </span><span>OpenLayers</span><span>.</span><span>Strategy</span><span>.</span><span>Fixed</span><span>()],</span><span>
            protocol</span><span>:</span><span> </span><span>new</span><span> </span><span>OpenLayers</span><span>.</span><span>Protocol</span><span>.</span><span>HTTP</span><span>({</span><span>
                url</span><span>:</span><span> </span><span>"kml/YOUR-KML.kml"</span><span>,</span><span>
                format</span><span>:</span><span> </span><span>new</span><span> </span><span>OpenLayers</span><span>.</span><span>Format</span><span>.</span><span>KML</span><span>({</span><span>
                    extractStyles</span><span>:</span><span> </span><span>true</span><span>,</span><span> 
                    extractAttributes</span><span>:</span><span> </span><span>true</span><span>,</span><span>
                    maxDepth</span><span>:</span><span> </span><span>2</span></code><code><span><br>})</span><span>
            </span><span>})</span><span>
        </span><span>})</span></code><br></pre><br><br><font style="font-size:10pt" color="#1F497D" face="Arial"><br>__________________________________________________________________________________________<br>Piensa en el medio ambie<font face="Arial">nte - mantenlo en la pantalla. NO lo imprimas si NO es necesario.</font></font><font style="font-size:10pt" color="#1F497D" face="Arial"><br>

</font><font style="font-size:10pt" color="#1F497D" face="Arial">Think green - keep it on the screen. Do NOT print if it is NOT necessary.</font><font style="font-size:10pt" color="#1F497D" face="Arial"><br></font><font style="font-size:10pt" color="#1F497D" face="Arial"><span lang="de"><span>Denken Sie an</span> <span>die Umwelt</span></span></font><font style="font-size:10pt" color="#1F497D" face="Arial"><span lang="de"><span></span> <span>-</span> <span>bewahren Sie es</span> <span>auf dem Bildschirm.</span> <span>Drucken Sie es NICHT</span><span>, wenn</span> <span>es NICHT notwendig ist</span><span>.</span></span></font><br>

<div><br><br></div><div><div><hr>Date: Sat, 25 May 2013 14:24:47 +0530<br>Subject: Re: [OpenLayers-Users] Accessing user defined data from a OpenLayers application<br>From: <a href="mailto:nipuni880917@gmail.com" target="_blank">nipuni880917@gmail.com</a><br>

To: <a href="mailto:gamejihou@hotmail.com" target="_blank">gamejihou@hotmail.com</a><br>CC: <a href="mailto:p.scadden@gns.cri.nz" target="_blank">p.scadden@gns.cri.nz</a>; <a href="mailto:openlayers-users@lists.osgeo.org" target="_blank">openlayers-users@lists.osgeo.org</a></div>

<div><div><br><br><div dir="ltr"><div><div>This is the KML file I am using. I have tried with some other KML files, but still it does not work. <br><br></div>Thanks,<br></div>Nipuni<br></div><div><br><br><div>
On Sat, May 25, 2013 at 2:07 PM, Gery . <span dir="ltr"><<a href="mailto:gamejihou@hotmail.com" target="_blank">gamejihou@hotmail.com</a>></span> wrote:<br><blockquote style="border-left:1px #ccc solid;padding-left:1ex">


<div dir="auto"><div>Probably the kml structure is wrong, is it?<br><br>Sent from my iRon</div><div><div><div><br>On May 25, 2013, at 9:14, "Nipuni Perera" <<a href="mailto:nipuni880917@gmail.com" target="_blank">nipuni880917@gmail.com</a>> wrote:<br>


<br></div><div><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><br><br><div>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 style="border-left:1px #ccc solid;padding-left:1ex"><div>>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><div><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>
</div><div><span>_______________________________________________</span><br><span>Users mailing list</span><br><span><a href="mailto:Users@lists.osgeo.org" target="_blank">Users@lists.osgeo.org</a></span><br><span><a href="http://lists.osgeo.org/mailman/listinfo/openlayers-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-users</a></span><br>


</div></div></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></div></div></div>                                          </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>
</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>