Hi,
I am working on a code and having some problems in it.
I am developing a code,which takes values from excel file as lattitude and longitude and place it on map as a marker.
The problem we are encountering is that only first two cells(means lattitude and longitude for one marker) are plotted.
I need to place several markers at the positios mentioned in the excel sheet.
The code is attached here.
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Google Maps API Sample</title>
<script src="http://maps.google.com/maps?file=api&v=2&sensor=false&key=ABQIAAAA1XbMiDxx_BTCY2_FkPh06RRaGTYH6UMl8mADNa0YKuWNNa8VNxQEerTAUcfkyrr6OwBovxn7TDAH5Q" type="text/javascript"></script>
<script type="text/javascript">
</script></head></html>
function my_function()
{
var Excel;
Excel = new ActiveXObject("Excel.Application");
Excel.Visible = false;
return Excel.Workbooks.Open("C:/desktop/TEST.xls").ActiveSheet.Cells(l,i).Value;}
var i=1;
var l=1;
do
{
a = my_function()
if (a!=null)
{
i++;
b=my_function()
if(b!=null)
initialize()
i++;
}
else
{
l++;
i=1;
}
}
while(a!=null || b!=null);
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map_canvas"));
map.setCenter(new GLatLng(24.884801, 67.056469), 13);
map.addControl(new GSmallMapControl());
map.addControl(new GMapTypeControl());
var point = new GLatLng(a , b);
map.addOverlay(new GMarker(point));
}
}
<body onload="initialize()" onunload="GUnload()" style="font-family: Arial;border: 0 none;">
<h1 align="center">Plotting</h1>
<hr width="50%">
<div id="map_canvas" style="width: 900px; height: 1000px"></div>
</hr></body>
PS I guess there is some problem with do-while loop.
Please help me out.
Confused geminien