Hey guys

I only today started looking at this API as a way of finding
directions between 2 postcodes in the UK.

here is my dev version:
http://dev.myhookup.co.uk/contacts/distance


There is a link that says click here now

When you click the link the map appears and 2 postcodes will alert
out:
B29 7NF
and
SK9 2BB

and the query string will alert out too:

from: B29 7NF, UK to: SK9 2BB, UK

However, when the directions are rendered (if that is the phrase to
use) the from postcode comes out as:

B29 5

and the to postcode comes out as:

SK9 2

I can't work out why this might be... here's my code:

<script type="text/javascript">
    var map;
    var directionsPanel;
    var directions;

    function initialize(from, to)
    {
      map = new GMap2(document.getElementById("map"));
      map.setCenter(new GLatLng(54.622978,-2.592773), 5);
      map.addControl(new GSmallMapControl());
      map.addControl(new GMapTypeControl());
      directionsPanel = document.getElementById("route");
      directions = new GDirections(map, directionsPanel);
      alert(from);
      alert(to);
      alert("from: "+from+",UK to: "+to+",UK");
      directions.load("from: "+from+",UK to: "+to+",UK");
        }
</script>
<a href="#" onclick="javascript:initialize('B29 7NF', 'SK9
2BB')">click here now</a>
<div id="map" style="width: 430px; height: 300px"></div>
<div id="route"></div>



As you can see I am sending the 2 postcodes as attributes to the
method initialize... these eventually will be dynamic depending on
what is displayed on screen...

The directions and distances end up being wrong because the postcodes
seem to be changing.

Is there any reason for this?

Any help would be GREATLY appreciated.

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