How to draw a line in OpenStreetMap using kml or other way?

148 views
Skip to first unread message

Tany...@gmail.com

unread,
May 2, 2009, 11:34:15 AM5/2/09
to KML Developer Support - Getting Started with KML
Hi all,

I am using OpenStreetMap, embedded the map using this code:
<script src="http://www.openstreetmap.org/openlayers/OpenLayers.js"
type="text/javascript"></script>
<script src="http://www.openstreetmap.org/openlayers/OpenStreetMap.js"
type="text/javascript"></script>
<script src="http://www.openstreetmap.org/javascripts/map.js"
type="text/javascript"></script>

<script type="text/javascript" defer="defer">
<!--
//var brokenContentSize = $("content").offsetWidth == 0;
var marker;
var map;

function mapInit(){

map = createMap("map");

map.dataLayer = new OpenLayers.Layer("Data", { "visibility":
false });
//map.dataLayer.events.register("visibilitychanged",
map.dataLayer, toggleData);
map.addLayer(map.dataLayer);

var centre = new OpenLayers.LonLat(15.566503905624515,
44.84591159037003);
var zoom = 4;
setMapCenter(centre, zoom);
//setMapLayers("B000FTF");
//map.events.register("zoomend", map, updateKey);
//map.events.register("moveend", map, updateLocation);
//map.events.register("changelayer", map, updateLocation);
//updateLocation();

//handleResize();
}

</script>

<body>
<div id="map" class="smallmap" style="width:950px;height:550px;"></
div>
</body>





using this code, the map is embedded in the page,
And now I want to draw a line in the map,
I have a list of coordinates of each node in the line, and how can I
draw this line in the map ?

I tried .... make a line using these coordinates in KML, and add the
kml file to the map as a layer, but didn't work, might be I was using
a wrong way.

anybody knows, please help, it's emergency...

Thanks a million !

Tanya
Reply all
Reply to author
Forward
0 new messages