> > One geocoding function called twice. The geocoding result handler > should push its result on to global array and then a call a > "zoomMyMap" function. The "zoomMyMap" function checks the length of > the global array, and if it containstwoelements, zooms the map. Mike > shows that athttp://econym.org.uk/gmap/basic14.htm > > Checking for the availability oftworesults after each geocode result > means it doesn't matter about the order the results are returned in. > When the second result arrives, there will be enough data to do the > zoom.
I appreciate your help and I'm sorry it took me so long to try this and report back to teh group. I'm fairly new to JavaScript, so I have a questions: 1. What is the best way to call the geocoding function twice? Should I set up a third function that has two arguments that calls the geocoding function twice and passes the two address inputs into the geocoding function that way? I'm not sure what the "best practices" are when it comes to this. If this is the case, how do I pass two text field values into this? It doesn't seem to work when I try to pass both text field values into the function -- I keep getting an error that says that I'm missing a closing parenthesis even though I don't think I am (and if I add one, I still get the same error). I can post my code if it would help. I understand the rest of this as far as creating a global array goes, and then looping through that to set my zoom level. Thanks! I appreciate it. -- 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.
