Hi,

Here i am creating some markers and corresponding infowindows. Since each
infowindow will have different data set, i am creating those along with
marker(in showTown() function (please see the code below..).
But this seems hectic. Is it possible to create only one infowindow and then
setting contents (using setContent())? where i can get some example on
this....


Thanks'



for(var i=0;i<1000;i++){
        pointOutlet=new
google.maps.LatLng(20+Math.random(),80+Math.random())
        showTown("blr",pointOutlet,"abc").setMap(map);
        }



 function showTown(town,pointTown,customers){

      var cust_info= "<DIV
STYLE='background-color:#eeeeee;overflow:auto;height:100px;'>"+customers+"</div>";
      var infowindow_rs = new google.maps.InfoWindow({
       content: cust_info,
        maxWidth: '400',
       noCloseOnClick: false
      });
      //var image= "./images/people35.png";red-circle1.png
      var marker = new google.maps.Marker({
       position: pointTown,
       flat: true,
       icon: image,
       shadow: null
            });

     google.maps.event.addListener(marker, 'click', function()
         {
         infowindow_rs.open(map,marker);
         });

     google.maps.event.addListener(map, 'click', function()
        {
        infowindow_rs.close();
       });

     return marker;
     }





-- 
Warm Regards,

Pankaj Jha

P Go green....Save the Trees*****.*

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.

Reply via email to