I am creating a smart location form field with jquery autocomplete and
google geocode.

One of the two major problems I am having is this:

If I type in 'L' I would like some relevent suggestions (influenced by
the region parameter) of the most likely locations I would be
entering. For example, if I do this in maps.google.co.uk I get
'London, Leeds, Liverpool, Leicester, Luton'... Perfect!! However
using the api's geocode service I get 1 result - 'Limburg, The
Netherlands'... WTF? Where's this come from? Why just 1 result? Am I
missing some settings somewhere?

geocoder.geocode( { 'address': request.term, 'region': 'GB' },
function(results, status) {
    response($.map(results, function(item) {
        for(var i in item.types) {
            if (item.types[i] == 'political') {
                return {
                    label:  item.formatted_address,
                    value: item.formatted_address,
                    latitude: item.geometry.location.lat(),
                    longitude: item.geometry.location.lng()
                }
            }
        }
    }));
})

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

Reply via email to