I am using the example here (http://code.google.com/apis/maps/
documentation/examples/geocoding-simple.html) to geocode and display
UK postcodes but the marker is placed about a mile off the actual
location. However, if the same query is run in a standard Google Maps
search, the result is accurate. For an example, search for 'BS1 5TR'
in the API demonstration and compare it to this search result:
http://maps.google.com/maps?f=q&source=s_q&hl=en&geocode=&q=bs1+5tr&sll=51.504175,-2.593052&sspn=0.009176,0.019312&ie=UTF8&t=h&z=16&iwloc=A

I added gl=gb to the script source but this made no difference.

The code I am using in the actual project (which is on an intranet so
can't be linked-to) is as follows:

<script src="http://maps.google.com/maps?
file=api&amp;v=2.x&amp;key=ABQIAAAAmzy3n-DABq-
xaDRiwkfVPRSIA2BBHxtE61S0XY0UbaEunckKKRQsmeS-
xvimx0Gbs5_2tDgz0n4thw&gl=gb" type="text/javascript"></script><script
type="text/javascript">

    var map = null;
    var geocoder = null;

    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(51.452408, -2.601442), 13);
        geocoder = new GClientGeocoder();
                        var address='BS1 5TR';
                        var locname='Car park';
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert(address + " not found");
            } else {
              map.setCenter(point, 13);
              var marker = new GMarker(point);
              map.addOverlay(marker);
              marker.openInfoWindowHtml("Approximate location of " +
locname);
            }
          }
        )
      }
     }
    }

    function showAddress() {

    }
    </script>

I'm a novice at this so please explain any suggestions as simply as
possible. Thanks.
--~--~---------~--~----~------------~-------~--~----~
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