set variables instead of having end-user input them from html form
I have attempted to set these variables (to, from and mode), instead of
having the user input them. What step am I missing?
var from = (40.750484, -111.811177);
var to = (40.775041, -111.718560);
var mode = driving;
//$('#directions-form').submit(function(e) {
//$('#error').hide();
ds.route({
origin: from,
destination: to,
travelMode: mode
}, function(result, status) {
if (status == google.maps.DirectionsStatus.OK) {
fitBounds = true;
dr.setDirections(result);
}
else {
$('#error').text(status).show();
}
recalcHeight();
});
e.preventDefault();
return false;
});
ds.route(from,to,mode);
No comments:
Post a Comment