I've created a price/distance calculator for a local taxi firm and
currently it calculates the cost of a journey between 2 selected
points. I'm trying to add the ability to select more than one
destination but I'm having difficulties.

I've created the form, which has 3 points - a pick-up point, a
destination, and an optional way point on the journey, which is hidden
and only available to view if a button asking if an additional
destination is required is clicked.

I've tried to create an if statement in the JavaScript which works as
follows - if the additional destination is empty, then only calculate
the distance between the pickup and drop-off points, but if the
additional destination is populated then calculate the distance
between all 3 points.

This hasn't and has become pretty complicated. Is there a simpler way
to do the above? I'm no JS expert so I'm learning as I go...

Thanks in advance.

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