Approximately one month ago this script, helped us provide the
distance and approximate for taxi journeys but it no longer seems to
be working, can anyone help please?

http://southliverpooltaxis.co.uk/calc.html


<<-----------------------------------------------------------------------
>>

<script src="http://maps.google.com/maps?
file=api&amp;v=2&amp;sensor=true&amp;key=ABQIAAAA9q8VmFQtX6D64uQeHR1qSxSJNeiRTTAzkN73DHFrlQbv2DtWKhTos24FcP6ZBTpXifCi2VdEFtMKrg"
type="text/javascript"></script>
<script type="text/javascript">
var map;
    var directionsPanel;
    var directions;
    var geocoder = new GClientGeocoder();
    var firstMile = 2.30;
    var costPerMile = 1.40;

    function initialize() {
      map = new GMap2(document.getElementById("map_canvas"));
      map.setCenter(new GLatLng(53.410827, -2.977478), 13);
      directionsPanel = document.getElementById("route");
      directions = new GDirections(map, directionsPanel);
      GEvent.addListener(directions, "load", getFare);
    }

    function getDirections(){
        var fromAddress = document.getElementById
("fromAddress").value.toString();
        var toAddress = document.getElementById
("toAddress").value.toString();
        directions.load(fromAddress + " to " + toAddress);
    }

    function getGoogleDistance(){
        var distance = directions.getDistance().meters;
        var miles = (distance*0.000621371192).toPrecision(4);
        return miles;
    }

function getFare(){
var extraDistance = getGoogleDistance()-1;
var fare = (firstMile+(extraDistance*costPerMile)).toPrecision(3);
document.getElementById('total').innerHTML="<h5>&pound;" +
fare.toString() + "</h5>" +  directions.getSummaryHtml();
    }
</script>


<<-----------------------------------------------------------------------
>>


<body onload="initialize()" onunload="GUnload()" style="font-family:
Arial;border: 0 none;">
  Fare Calculator
        <form>From: <input type="text" id="fromAddress"
onclick="this.value='';" value="Liverpool Airport" />
         To: <input type="text" id="toAddress"
onclick="this.value='';" value="Duke Street, Liverpool" />
         <input type="button" onclick="getDirections()" value="Quote
Me" />
         <br />
        </form>
        </div>
    <div id="map_canvas" style="width: 500px; height: 350px;
float:left; border: 1px solid black;"></div>
    <br />
       Estimated Cost:<div id="total"></div>



<<-----------------------------------------------------------------------
>>

--

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