Hi all,<br><br>I;m having some trouble adding a kml file to openlayers. The script is at bottom, and i&#39;ve followed this thread without solving the problem: <br><span class="gI"><a href="http://osgeo-org.1803224.n2.nabble.com/adding-KML-file-td6003583.html">http://osgeo-org.1803224.n2.nabble.com/adding-KML-file-td6003583.html</a><br>
<br>note that <br>(a) i have apache running (but no proxy host configured- i tried to do it but it broke my web server, i&#39;m not an expert at troubleshooting it.<br>(b) webserver is back on - i use it for an application with php and postgis (which i actually want to link to an OL application)<br>
(c) i am new to OL<br><br>1. with both the html and kml file on the webserver, <br></span><div style="margin-left: 40px;"><span class="gI">- i get only the google map displayed</span>, no kml file displayed<br>- no error message<br>
- no kml file displayed<br></div><br>2. with the html on local folder and kml file on webserver<br><div style="margin-left: 40px;">- i get only the google map displayed<br>- error message Access to URL denied&quot; code&quot; 1012<br>
<br></div>3. with both html and kml files in local folder<br>   - same response as 1 above<br>   - although i dont know if i shoulde be using url to point to the file in this case<br><br>The code is below. Any help appreciated!!<br>
Also, do i absolutely need proxy hosting or is there some way i can use my existing webserver and working postgis as is?<br>Thanks,<br>Vishal<br><div style="margin-left: 40px;"><span class="gI"></span></div><span class="gI"><br>
<br>&lt;html&gt;<br>&lt;head&gt;<br>  &lt;title&gt;OpenLayers Example&lt;/title&gt;<br>    &lt;script src=&quot;<a href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</a>&quot;&gt;&lt;/script&gt;<br>
    &lt;script src=&quot;<a href="http://maps.google.com/maps/api/js?sensor=false">http://maps.google.com/maps/api/js?sensor=false</a>&quot;&gt;&lt;/script&gt;<br>    &lt;/head&gt;<br>    &lt;body&gt;<br>      &lt;div style=&quot;width:100%; height:100%&quot; id=&quot;map&quot;&gt;&lt;/div&gt;<br>
        var map = new OpenLayers.Map(&#39;map&#39;);<br>    <br>    var googlemap = new OpenLayers.Layer.Google(&#39;Google Layer&#39;);<br>    map.addLayer(googlemap);<br>    map.setCenter(<br>                new OpenLayers.LonLat(77.6, 13).transform(<br>
                    new OpenLayers.Projection(&quot;EPSG:4326&quot;),<br>                    map.getProjectionObject()<br>               ), 12);<br>    console.log(map.getProjection());<br>    var vector_layer = new OpenLayers.Layer.Vector(&#39;borewells&#39;,<br>
        {<br>            projection: new OpenLayers.Projection(&#39;EPSG:4326&#39;),<br>            protocol: new OpenLayers.Protocol.HTTP({<br>                url: &quot;borewells.kml&quot;,<br>                format: new OpenLayers.Format.KML({<br>
                    extractAttributes: true<br>                })<br>            }),<br>            strategies: [new OpenLayers.Strategy.Fixed()]<br>            }<br>        );<br>    //add it to the map<br>    map.addLayer(vector_layer);<br>
    console.log(&#39;got here&#39;);<br>      &lt;/script&gt; <br>&lt;/body&gt;<br>&lt;/html&gt;<br><br></span><br clear="all"><br>-- <br>Vishal K. Mehta, PhD<br>Scientist<br>Stockholm Environment Institute - US<br>133 D St Suite F<br>
Davis CA 95616<br><a href="http://www.sei-us.org">www.sei-us.org</a><br>