Google地图不会显示整个地图

时间:2012-12-19 03:50:56

标签: jquery map

我有谷歌地图的问题..案例是,它不会加载整个地图,但只加载地图的一部分,其余部分已经空白......可能是什么问题?..

这是代码..

<div id="map_addresses" class="map">
    <p>This will be replaced with the Google Map.</p>
</div>


$(function()
{

   $('#map_addresses').gMap({
        controls: {
        panControl: true,
        zoomControl: true,
        mapTypeControl: true,
        scaleControl: true,
        streetViewControl: true,
    },
        scrollwheel: true,
        zoom: 5,
         maptype: 'ROADMAP',
        markers:[
            {
                latitude: 10.318577,
                longitude: 123.908062,
                html: "Jinisys Software Inc. Sales Office"
            },
            {
                latitude: 10.324213,
                longitude: 123.911546,
                html: "Jinisys Software Inc. Main Office"
            }

        ]
    });
}

1 个答案:

答案 0 :(得分:2)

Google地图只能加载到可见的div。此外,必须修复元素的widthheight。地图不会调整div的大小。

试试这个:

<style>
    .map{
        width:400px;
        height:400px;
    }
</style>

<div id="map_addresses" class="map">
    <p>This will be replaced with the Google Map.</p>
</div>