I have a form, and in a php form the user chooses city and state (source / destination), so the user clicks the search, so system searches the carriers that serve those cities and states, along with carriers appears a map.
Now begins my problem. Once the user clicks on "Tracing Route" I take away from city to city, sendig $. post(), get the distance and update the divs "price" (are dynamically created, depending on how many carriers serving that route) I did it just to test.
In the database of each carrier has a field "precoMetro" which is as a carrier charges for meters. Now I wanted to know one way rather than put away, I put the same price, do the math.
Staff if it is something very simple I apologize, I do not understand much of javascript / jquery / ajax.
CODE
function calcRoute() {
if (marker) marker.setMap(null);
route = true;
var start = document.getElementById("inputStart").value;
var end = document.getElementById("inputEnd").value;
var request = {
origin:start,
destination:end,
travelMode: google.maps.DirectionsTravelMode.DRIVING
};
directionsService.route(request, function(response, status) {
if (status == google.maps.DirectionsStatus.OK) {
directionsDisplay.setDirections(response);
var distancia;
var rota = response.routes[0];
var etapa = rota.legs[0];
Bookmarks