Google Map API V3返回异常"类型错误"在执行geocoder.geocode时使用Internet Explorer

时间:2012-11-05 12:10:14

标签: google-maps-api-3

最近我开发了一个Asp.net网络应用程序,它使用Google Map API V3脚本生成街景视图,传递地址的全景视图。代码和应用程​​序与Chrome,FireFox,Safari完美配合,但在Internet Explorer上我得到了例外

 "Type Error : Object doesn't support this property or method "

 while executing the API's ***geocoder.geocode*** function. 

我试图在IE 7和8上运行相同的操作并且两者都抛出相同的错误。


代码段

geocoder.geocode({'address': addresstoshow}, function (results, status) {
            //alert(google.maps.GeocoderStatus.OK);
            if (status == google.maps.GeocoderStatus.OK) {
                mapStreetView.setCenter(results[0].geometry.location);

                marker = new google.maps.Marker({
                    position: results[0].geometry.location,
                    map: mapStreetView,
                    animation: google.maps.Animation.DROP,

                    title: results[0].geometry.location.description
                });
                marker.setAnimation(google.maps.Animation.BOUNCE);
                google.maps.event.addListener(marker, 'click', toggleBounce);


                panormacenter = new google.maps.LatLng(results[0].geometry.location.lat(), results[0].geometry.location.lng());
                myOptionForPanorama = {
                    position: panormacenter,
                    pov: {
                        heading: 34,
                        pitch: 10,
                        zoom: 1
                    }
                };

                myOptionForPlace = {
                    location: panormacenter,
                    radius: '1000',
                    types: ['lodging']

                };

1 个答案:

答案 0 :(得分:0)

问题与发布的代码无关。

相关问题