sawjd


Hi,
I have an issue with the find function. I'm trying to get the convert addresses to the latitude, longitude property for which i use the find function. I call the find functions 3 times using different addresses but in the callback function, it always return the latlong of the first address i passed for all 3 calls. I tried various ways and its always the same. Has anyone else seen this problem Appreciate any help possible.

For e.g.
i pass the following 3 addresses
1710 Silver Lake Blvd, Los Angeles, CA, 90026
333 S Spring St, Los Angeles, CA, 90012
6248 Santa Monica Blvd, Los Angeles, CA, 90038

and it always returns the latlong of the first(34.089584,-118.268316)

These are the functions i use

function FindLoc(address)
{
try
{
map.Find(null,address,null,null,0,1,false,false,false,false,MoreResults);
}
catch(e)
{
alert(e.message);
}
}
function MoreResults(a,b,c,d,e)
{
if(c!=false)
{
alert(c[0].LatLong);
}
}
Thanks
Subash




Re: Problem with Find function

Richard_Brundritt


Can you explain how you are passing in your addresses into FindLoc Do you have anouther function that loops through Can you provide sample code on how to reproduce





Re: Problem with Find function

Kartik

I was able to retrieve different Latitude and Longitude values for each of the addresses you provided. Could you please verify that your application in fact passes a different address each time Also, note that the Find method can only find one address at a time.

-Kartik






Re: Problem with Find function

TheClansman

I don't see where you are going through any of the addresses. I would reccomend putting the addresses into an array and then having your callback function do the next Find. So you can basically leave your Findloc the same (except get the address from the array instead) and then change your MoreResults to something like:

function MoreResults(a,b,c,d,e)
if (c!=false)
dosomething

i++
if (addressi)
map.Find(null, addressi, null, null, 0, 1, false, false, false, false, MoreResults);