I'm trying to pass additional variables to the addToMap function. I'm
using Function Closure to pass the data from my loop, but don't know
the syntax to pass it to the addToMap. The goal is to display cname to
the title so when you mouse over the point it displays the name and
address

Here's what I have so far:

for(var i=0;i<userArray.length;i++)
        {
        var address = userArray[i];
        var cname = nameArray[i];
        callGeocoder(cname,address);
                }
   }

function callGeocoder(cname,address)
 { geocoder.getLocations(address, addToMap);
 }

   // This function adds the point to the map

   function addToMap(response)
   {
      place = response.Placemark[0];

      point = new GLatLng(place.Point.coordinates[1],
                          place.Point.coordinates[0]);

      map.setCenter(point, 13);

      marker = new GMarker(point);
      map.addOverlay(marker);
      //marker.openInfoWindowHtml(place.address);
   }

--~--~---------~--~----~------------~-------~--~----~
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