Не удается запустить google.maps.Geocoder

Я не понимаю почему, но я получаю эту ошибку, когда пытаюсь инициализировать google.maps.Geocoder.

Вот ошибка:

Uncaught TypeError: undefined is not a function

И код:

function updateMapPosition(map){
    var geocoder = new google.maps.Geocoder(); //crashes here !!
    var position = geocoder.geocode( {'address':$('#id_address').val()},
        function(results,status){
            if(status == google.maps.GeocoderStatus.OK){
                if (status != google.maps.GeocoderStatus.ZERO_RESULTS) {
                    map.setCenter(results[0].geometry.location);
                    var marker = new google.maps.Marker({map:map, position:results[0].geometry.location});
                }
                else{
                    alert("hop")
                }
            }
        }
    )
}
13
задан ayublin 23 August 2011 в 20:13
поделиться