It is (now) very easy to do this using the Google LocalSearch API:
function usePointFromPostcode(postcode, callbackFunction) { localSearch.setSearchCompleteCallback(null, function() { if (localSearch.results[0]) { var resultLat = localSearch.results[0].lat; var resultLng = localSearch.results[0].lng; var point = new GLatLng(resultLat,resultLng); callbackFunction(point); } else { alert("Postcode not found!"); } }); localSearch.execute(postcode + ", UK"); }
callbackFunction() will get a GLatLng object, in my experience, very accurate coordinates. In fact, it is trivial to then pass this GLatLng to the getLocations () method of GClientGeoCoder and get full Placemark information that includes details down to the address range level (e.g. 1-18 Foo Street).
The real question is: is this legal?
Bobby jack
source share