I'm trying to use the geo_autocomplete extension (http://
code.google.com/p/geo-autocomplete/) but I allways get the message
"Geocoder is not a constructor", I guess I'm calling geocoder too
soon, so the enviroment is not ready, but I'm using
"google.setOnLoadCallback();" to be sure everything is ok:

function initialize()
{
var map = new google.maps.Map2(document.getElementById("map"));
map.setCenter(new google.maps.LatLng(37.4419, -122.1419), 13);
    $('#location').geo_autocomplete(new google.maps.Geocoder,
    {
        mapkey: 'ABQ',
        selectFirst: false,
        minChars: 3,
        cacheLength: 50,
        width: 300,
        scroll: true,
        scrollHeight: 330
    }).result(function(_event, _data)
    {
        if (_data) map.fitBounds(_data.geometry.viewport);
    })
}

$().ready(function()
{
    google.setOnLoadCallback(initialize);
}

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