I have found some code, that i've modified, so that the distance of
pointa to pointb, can be multiplied by the cost per mile to give a
cost of journey.

See here:

var miles=directions.getDistance().meters/1600;
var cost=miles*10;

I've got this so it shows perfectly on the webpage, it shows the route
and the mileage and cost.

What I need to do now is add 3 types of vehicle, but not sure how I
get the selection to actually send to the gmap.js. Here is what i want
to do:

  <label>
    <input type="radio" name="vehicle" value="small" id="vehicle" />
    Small</label>
  <br />
  <label>
    <input type="radio" name="vehicle" value="medium" id="vehicle" />
    Medium</label>
  <br />
  <label>
    <input type="radio" name="vehicle" value="large" id="vehicle" />
    Large</label>

And on the gmap.js:

if (document.vehicle.value == "small")
            {
            var cost = miles *10;
        }
else if (document.vehicle.value == "medium")
                {
            var cost = miles *100;
        }
else
                {
            var cost = miles *1000;
                }


But I don't understand how to get from the form to the map and change
the results?

Thanks in advanced!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" 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