<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=us-ascii" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.19019"></HEAD>
<BODY>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial>Hi,</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial>if your page and kml comes from the same location
like:</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial><A
href="http://yourserver/somepage.html">http://yourserver/somepage.html</A></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial><A
href="http://yourserver/data/somevectors.kml">http:<U>//yourserver/data/somevectors.kml</A></U></FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial>you don't need a proxy script to get the
kml.</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial>If it is so, then your script should work. The kml file (<FONT
color=#000000 size=3 face="Times New Roman">url: "borewells.kml"</FONT>) is
searched at the location of your page and there is no need of a proxy script.
There have to be an other reason, why you kml file isn't displayed. Are you
sure, that the coordinates in EPSG:4326 or that the coordinates are lay in the
viewport?</FONT></SPAN></DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial></FONT></SPAN> </DIV>
<DIV dir=ltr align=left><SPAN class=372094317-13042011><FONT color=#0000ff
size=2 face=Arial>Arnd</FONT></SPAN></DIV><BR>
<DIV dir=ltr lang=de class=OutlookMessageHeader align=left>
<HR tabIndex=-1>
<FONT size=2 face=Tahoma><B>Von:</B> openlayers-users-bounces@lists.osgeo.org
[mailto:openlayers-users-bounces@lists.osgeo.org] <B>Im Auftrag von </B>Vishal
Mehta<BR><B>Gesendet:</B> Mittwoch, 13. April 2011 00:17<BR><B>An:</B>
users@openlayers.org<BR><B>Betreff:</B> [OpenLayers-Users] trouble adding local
kml file to OL<BR></FONT><BR></DIV>
<DIV></DIV>Hi all,<BR><BR>I;m having some trouble adding a kml file to
openlayers. The script is at bottom, and i'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'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" code" 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><html><BR><head><BR> <title>OpenLayers
Example</title><BR> <script src="<A
href="http://openlayers.org/api/OpenLayers.js">http://openlayers.org/api/OpenLayers.js</A>"></script><BR>
<script src="<A
href="http://maps.google.com/maps/api/js?sensor=false">http://maps.google.com/maps/api/js?sensor=false</A>"></script><BR>
</head><BR>
<body><BR> <div style="width:100%;
height:100%"
id="map"></div><BR> var map =
new OpenLayers.Map('map');<BR> <BR> var
googlemap = new OpenLayers.Layer.Google('Google Layer');<BR>
map.addLayer(googlemap);<BR>
map.setCenter(<BR>
new OpenLayers.LonLat(77.6,
13).transform(<BR>
new
OpenLayers.Projection("EPSG:4326"),<BR>
map.getProjectionObject()<BR>
), 12);<BR>
console.log(map.getProjection());<BR> var vector_layer = new
OpenLayers.Layer.Vector('borewells',<BR>
{<BR> projection: new
OpenLayers.Projection('EPSG:4326'),<BR>
protocol: new
OpenLayers.Protocol.HTTP({<BR>
url:
"borewells.kml",<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('got
here');<BR> </script>
<BR></body><BR></html><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></BODY></HTML>