みなさん、こんにちは。
私はグーグルマップAPIを使用して私のウェブサイトにいくつかのアドレスを表示しようとしています。問題は、IEでは機能しないことです...私のコードは次のようになります:
function displayAdress (address) {
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myOptions = {
zoom: 15,
center: results[0].geometry.location,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
var map = new google.maps.Map(document.getElementById("gmap-event"),myOptions); ////$("div[id^='map_canvas']").first()
var marker = new google.maps.Marker({
map: map,
position: results[0].geometry.location
});
} else {
alert(
/*"Geocode was not successful for the following reason: " + status*/
'Google map was unable to found the address: '+ address
);
}
});
IEで使用すると、ログコンソールで問題が発生しますgeocoder = new google.maps.Geocoder();
誰かがこの問題を抱えたことはありますか?助けてくれてありがとう。
トーマス。