Jquery 谷歌地图不会显示整个地图

Jquery 谷歌地图不会显示整个地图,jquery,map,Jquery,Map,我对谷歌地图有一个问题。情况是,它不会加载整个地图,但只加载地图的一部分,其余部分已经为空。可能是什么问题 这是密码 <div id="map_addresses" class="map"> <p>This will be replaced with the Google Map.</p> </div> $(function() { $('#map_addresses').gMap({ controls: {

我对谷歌地图有一个问题。情况是,它不会加载整个地图,但只加载地图的一部分,其余部分已经为空。可能是什么问题

这是密码

<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"
            }

        ]
    });
}

这将被谷歌地图所取代

$(函数() { $(“#映射地址”).gMap({ 控制:{ 泛控制:对, 动物控制:对, mapTypeControl:true, scaleControl:对, 街景控制:对, }, 滚轮:对, 缩放:5, 地图类型:“路线图”, 标记:[ { 纬度:10.318577, 经度:123.908062, html:“Jinisys软件公司销售办事处” }, { 纬度:10.324213, 经度:123.911546, html:“Jinisys软件公司总部” } ] }); }
谷歌地图只能加载到可见的
div
。此外,元素的
宽度和
高度必须固定。地图不会调整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>

.地图{
宽度:400px;
高度:400px;
}
这将被谷歌地图所取代


查看页面的css,map\u addresses div是否足够大?我敢打赌您正在尝试将此地图加载到一个隐藏元素中。不,地图的大小正好适合页面。问题是它只显示地图的一部分。@sparky-是的。只有单击某个按钮才能看到它的容器。我使用了切换幻灯片这有点有趣,因为当我打开firebug时,地图似乎加载了整个地图内容,但如果我再次刷新它,它就会消失