2013-06-05 39 views
6

Tôi đã nghiên cứu chủ đề nhiều nhất có thể nhưng không tìm thấy giải pháp.Google Map API v3 không tải trong IE9

Trong tất cả các trình duyệt ngoại trừ Internet Explorer (phiên bản 8 hoặc 9), tập lệnh bên dưới sẽ hoạt động để tải bản đồ của Google. Tuy nhiên, ở IE8IE9, tuy nhiên, API bản đồ của Google (v3) dường như không tải. Tôi đã tìm kiếm để tìm lỗi cụ thể trong giao diện điều khiển, nhưng không tìm thấy gì.

Html

<style type="text/css"> 
    #map_canvas { 
     height: 292; 
     width:980 
    } 

    .contactus-Captcha { 
     clear:both; 
    } 
</style> 

<div id="map_canvas"></div> 

Javascript

function initialize() { 
      var homeLatlng = new google.maps.LatLng(29.70280,-95.51731); 

      var myOptions = { 
       zoom: 15, 
       center: homeLatlng, 
       mapTypeId: google.maps.MapTypeId.ROADMAP 
      }; 

      var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); 


       var contentString = '<div id="content">'+ 
         '<div id="siteNotice">'+ 
         '</div>'+ 
         '<h3>ABC</h3>'+ 
         '<div id="bodyContent">'+ 
         '<div class="AddressWrap"><div style="width:100%; margin:1 auto; float:left;"><img src="<?php echo ROOTPATH; ?>images/location-icon.png" style="float:left; padding-right:5px;"> <h3 class="Marker"> xyz</h3></div><h3 class="Mobile"> <img src="<?php echo ROOTPATH; ?>images/mob-icon2.png" style="float:left; padding-right:12px; "> 123445</h3></div>'+ 
         '</div>'+ 
         '</div>'; 
        var infowindow = new google.maps.InfoWindow({ 
         content: contentString 
        }); 

      var image = new google.maps.MarkerImage(  
       '<?php echo ROOTPATH; ?>images/addres-icon.png', 
       new google.maps.Size(32, 32), // size 
       new google.maps.Point(0,0), // origin 
       new google.maps.Point(16, 32) // anchor 
      ); 

      var shadow = new google.maps.MarkerImage(
       'http://maps.google.com/mapfiles/ms/micons/msmarker.shadow.png', 
       new google.maps.Size(59, 32), // size 
       new google.maps.Point(0,0), // origin 
       new google.maps.Point(16, 32) // anchor 
      ); 

      var homeMarker = new google.maps.Marker({ 
       position: homeLatlng, 
       map: map, 
       title: "xyz", 
       icon: image, 
       shadow: shadow 
      }); 
      google.maps.event.addListener(homeMarker, 'click', function() { 
         infowindow.open(map,homeMarker); 
        }); 
     }  

    $(document).ready(function() {    
    initialize(); //Calling on load 
    }); 

thể bất cứ ai giúp tôi không? Tôi sẽ rất biết ơn!

+0

Bạn tải qua http: // hoặc https: //? –

+0

Tôi đang sử dụng giao thức http .. – Pank

+0

@Cảm ơn Brad để chỉnh sửa tốt ... – Pank

Trả lời

4

Bản đồ của bạn không có kích thước. Thay đổi:

#map_canvas { height: 292; width:980 } 

Để:

#map_canvas { height: 292px; width:980px } 
+0

Cảm ơn bạn rất nhiều .. – Pank

Các vấn đề liên quan