PDA

View Full Version : Why is my postcode location wrong


secure377208
06-29-2009, 03:37 AM
Hi,
I have created a simple input script to provide directions to a fixed location, however when I input my own postcode the directions start from the wrong place, when I input the same postcode on the google maps site it returns the correct location, obviously if we are to provide this functionality to people we need to ensure that the info supplied is correct.

If the postcode yo25 9xz is input into this form http://79.170.44.106/bridlington.net/dir.php
and go pressed it shows that the start location is some 10 miles or so from the correct start location which can be seen by inputting the start location as yo25 9xz and the end location at a165/bessingby hill on the google map uk site.

I have experimented with upper case lower case no space in the postcode all return the incorrect start point, I have also tested this with other start postcodes and also get incorrect start locations for them, could you please advise where I am going wrong.

my form code is below

----------------------------------------------------------------------------

<html xmlns:v="urn:schemas-microsoft-com:vml">
<head>
<title>map test</title>
<script type="text/javascript">
/*wagmp*/
<?php include("google_javascript/wagmp_map_4.php"); ?>
</script>
<script type="text/javascript" src="http://maps.google.com/maps?file=api&v=2&key=ABQIAAAAM0gJaeEVxbPxYT0dunZjVhR5EPdlGYsWKcsrGs qLTd7rpsGUUhS5LxfCX3BQJalwx3_f3xBqpCgZQQ">/*wagmp*/</script>
</head>
<body>
<form action="dir.php" method="get">
<p><label for="saddr">Your postcode</label>
<input type="text" name="saddr" id="saddr" value="" />
<input type="submit" value="Go" />
<input type="hidden" name="daddr" value="A165/Bessingby Hill,Bridlington,East Yorkshire" />
<input type="hidden" name="hl" value="en" /></p>
</form>
<div id="wagmp_map_4" style="width: 300px; height: 300px;"></div><div id="wagmp_directions_4"></div>
<p>
<script type="text/javascript" src="google_javascript/wagmp_maps.js">/*wagmp*/</script>
</body>
------------------------------------------------------------------------------

secure377208
06-29-2009, 03:44 AM
I have managed to resolve this issue by adding more fields for street and town, cannot understand why it will not work on postcode alone as thats how it works on the google maps site.

jon_upton
06-29-2009, 10:18 AM
This is pretty consistent with using the google api directly its not really a Pro Maps issue the recommendation is to use the street and town rather than the UK post code - If you really want to use the UK Post code then you can use a low cost online service which will look up the postcode and return you the geo coding that you can use to draw the map with Pro Maps.

You can find it here - http://www.postcodesoftware.net/geo_credits.htm

Best regards

Jon