navigationControl,mapTypeControl和scaleControl在地图后面

时间:2012-08-20 17:43:26

标签: javascript android html5 google-maps

我打算创建一个应用程序,其中有一个部分可以在Google地图上显示标记的位置。一切运作良好,但navigationControlmapTypeControlscaleControl等Google地图工具隐藏在三星Galaxy Tab 10.1等设备中(它们似乎落后于地图)。即使我已将其值更改为true,但它们仍隐藏在某些设备中。

这就是我所做的:

       <--! The HTML -->
       <article class="container">
       .
       .
       .
       ...( some tags go here )

            <section class="span12">
                <div id="mapDiv"> </div>
            </section>

       </article>  

/*The Javascript*/
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>

<script type="text/javascript">

 function initialize() {
     var position = new google.maps.LatLng(38.89655520572012, -77.03372955322266); 
     var myOptions = {
     zoom: 15,
     center: position,
     mapTypeId: google.maps.MapTypeId.ROADMAP,
     };
     var map = new google.maps.Map(
     document.getElementById("mapDiv"), myOptions);

     var marker = new google.maps.Marker({
     position: position,
     map: map,
     title:"We are here.",
     }); 
     }
</script>

有人知道为什么他们会被隐藏吗?!

感谢任何帮助。

1 个答案:

答案 0 :(得分:0)

尝试将{max-width:none;}添加到#mapDiv。我知道Google Maps API有时会出现响应式设计方面的问题。它使用精灵作为控制图像,Bootstrap可以干扰它。