Hi There,
I have spent the last few evenings searching the docs and the web for
an example of how to get the Administrative area back for a UK
postcode or partial postcode.
This is definitely due to my meagre understanding of Js, so please be
gentle.
At the moment I am copying the long_name into an empty field, but I'd
like to get the UK County council from the returned results as well.
Any help will be very much appreciated.
Here is what I have:
function codeAddress() {
var address = document.getElementById("address").value;
var idesc = document.getElementById("idesc").value;
geocoder.geocode( { 'address': address}, function(results, status)
{
if (status == google.maps.GeocoderStatus.OK) {
map.setCenter(results[0].geometry.location);
$("#lat").val(results[0].geometry.location.lat());
$("#lng").val(results[0].geometry.location.lng());
$("#extra").val(results[0].formatted_address.long_name);
$
("#extra").val(results[0].formatted_address.types.administrative_area_level_1);
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location,
title: "Test Title",
html: idesc
});
Thank you!
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" 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-js-api-v3?hl=en.