On Aug 22, 11:11 am, Rob B <[email protected]> wrote:
> Sorry the first link didn't work, it should be:
>
> http://www.foodmilesmaps.co.uk/public_html/fmmtest.co.uk/didyoumeanv4...
>
> On Aug 22, 6:38 pm, Rob B <[email protected]> wrote:
>
>
>
> > Hi there,
>
> > I've been attempting to build an application that calculates the
> > distance between two points. The user puts in two locations into the
> > input box and it displays on the map. I am trying to use the "did you
> > mean" facility on top of this for extra functionality.
>
> > Just to illustrate, this is what it should look
> > like:http://www.foodmilesmaps.co.uk/public_html/fmmtest.co.uk/didyoumeanv4...
> > However, the problem with this is no matter which option the user
> > chooses (using the 'London Road' example) it always selects the first
> > one.
What is the value of location1 when you find multiple results (hint it
is set by the loop, not by clicking on an address in the list):
var point1 = new GLatLng(location1.lat,location1.lon);
or location2
var point2 = new GLatLng(location2.lat,location2.lon);
-- Larry
>
> > This is because I've used the code:
> > result.Placemark[0].Point.coordinates[1]
>
> > Instead I thought it should be:
> > result.Placemark[i].Point.coordinates;
>
> > Which is what I've done
> > here:http://www.foodmilesmaps.co.uk/public_html/fmmtest.co.uk/didyoumeanv3...
>
> > But this places a marker somewhere in Canada everytime, and the second
> > time the user selects 'go' the alert "TypeError: a is undefined"
> > appears.
>
> > I hope I've made it clear what the problem is, and any help will be
> > greatly appreciated.
>
> > Thanks,
> > Rob- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---