On Feb 8, 11:50 pm, Jack <[email protected]> wrote:
>
> It is only using the static data because I haven't written the code to
> pull it from my database yet.

So when you pull the data from your database, you should ensure that
the *location* gets passed to the page with the icon, not the
*address*. Then you avoid the geocoding and the problem.

However, one way of doing what you want is to use a helper function:

   for(i in data){
    address = data[i][0];
    customicon = data[i][1];
    geocode(address,customicon)
    }

  function geocode(ad,ic) {
    geocoder.getLatLng( ...
    //etc

because then you get function closure on your address and custom icon
and keep both things together. You will need to have the function
definition before the code where it's called; I've illustrated it this
way round here as it's easier to relate it to your existing code.

Again, this is NOT the best way of using Google's resources. You
really should not use the geocoder for addresses you already know
about.

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