Dear sir,
I need help on drawing polyline using forloop.  i am having some fixed
place names in an array. Using forloop i am interating the plances
array and taking corresponding lan and long from getLatLng() method.
But the execution is not synchronize. Its working like a thread.
please have a look at my code.

Please reply me with good tutorial and if its there any IDE for Google
map application, inform me. Please help me.

   var map = null;
    var geocoder = null;
        var latlng = new Array(10);
        var latlong = new Array(10);
        var polyOptions = {geodesic:true};
        latlng[0]="Bangalore";
                latlng[1]="Tumkur";
                latlng[2]="Arsikere";
                latlng[3]="Kadur";
                latlng[4]="Birur";
                latlng[5]="Tarikere";
                latlng[6]="Bhadravathi";
                latlng[7]="Shimoga";
        var latlongstring = "";
  function showAddress(address,address1) {

        if (geocoder) {

        for(i = 0; i<=7; i++)   {

///////////////// the following statement is executing something
strangely.///////////////////
                        geocoder.getLatLng(
                                latlng[i],function(point1) {
                                        if (!point1) {
                                                //alert( i + " not found");
                                        } else {
                                                latlong[i]=point1;
                                                                //latlongstring 
+= " , "+point1;
                                                var marker = new 
GMarker(point1);
                                                map.addOverlay(marker);
                                                                
//alert(latlong[i]+"inside else");
                                        }
                                        }
                                );

                }
                var polyline = new GPolyline(
                                [
                                 latlong[0],
                                 latlong[1],
                                 latlong[2],
                                 latlong[3],
                                 latlong[4],
                             latlong[5],
                                 latlong[6],
                                 latlong[7],
                                ], "#FF0000", 4,1, polyOptions
                );

                map.addOverlay(polyline);
                }

--

You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.


Reply via email to