第一次使用Google Maps Java API - 不会出现在IE 10中

时间:2017-06-08 06:34:18

标签: google-maps-api-3

我刚开始使用Google Maps API并遇到API问题。我正在使用Good Maps示例中的代码,它适用于Chrome和Firefox,但IE 10中没有显示任何内容。 我没有帮助就搜索了主题。我已将https://maps.google.com添加到IE中的安全站点,尝试了v = 3.28技巧,还尝试了元标记以实现向后兼容,但没有任何成功。

以下是我的HTML:

      <!DOCTYPE html>
      <html xmlns="http://www.w3.org/1999/xhtml">

      <head>
            <title></title>
      </head>
      <body>

      <div id="map" style="width:100%;height:1200px;"></div>

      <script>        
              function initMap() {
              var myLatLng = { lat: 32.681390, lng: -97.108682 };
          var map = new google.maps.Map(document.getElementById('map'), {
            center: myLatLng,
            zoom: 14
        });

        var marker = new google.maps.Marker({
            position: myLatLng,
            map: map,
        });

        var infowindow = new google.maps.InfoWindow();
        var service = new google.maps.places.PlacesService(map);            
         }        
         </script>
         <script src="https://maps.googleapis.com/maps/api/js?key=MyKey&callback=initMap">
         </script>
         </body>
         </html>

以上标记在IE 10中没有显示任何地图。我无法继续前进。我刚刚开始使用它,并希望在asp.net 4.5的更新面板中使用它。但目前,简单的HTML并不适合我。

有什么建议吗? 谢谢。

0 个答案:

没有答案