相关疑难解决方法(0)

Google Maps API v3 + jQuery UI标签的问题

当使用Google Maps API在jQuery UI选项卡中呈现地图时,有许多问题似乎都是众所周知的.我已经看到关于类似问题发布的SO问题(例如这里这里),但那里的解决方案似乎只适用于Maps API的v2.我检查过的其他参考文献在这里这里,以及我可以通过谷歌搜索挖掘的几乎所有内容.

我一直在尝试将地图(使用API​​的v3)填充到具有混合结果的jQuery选项卡中.我正在使用最新版本的一切(目前jQuery 1.3.2,jQuery UI 1.7.2,不了解Maps).

这是标记和javascript:

<body>
    <div id="dashtabs">
        <span class="logout">
            <a href="go away">Log out</a>
        </span>
        <!-- tabs -->
        <ul class="dashtabNavigation">
            <li><a href="#first_tab" >First</a></li>
            <li><a href="#second_tab" >Second</a></li>
            <li><a href="#map_tab" >Map</a></li>
        </ul>

        <!--  tab containers -->
        <div id="first_tab">This is my first tab</div>
        <div id="second_tab">This is my second tab</div>
        <div id="map_tab">
             <div id="map_canvas"></div>
        </div>
    </div>
</body>
Run Code Online (Sandbox Code Playgroud)

$(document).ready(function() {
    var map = null;
    $('#dashtabs').tabs();
    $('#dashtabs').bind('tabsshow', function(event, ui) { …
Run Code Online (Sandbox Code Playgroud)

jquery google-maps jquery-ui-tabs google-maps-api-3

70
推荐指数
5
解决办法
9万
查看次数

Ui-Tabs中的Google Maps Api v3地图已被剪切

我知道这是一个常见的问题,我已经在这里查看了解决方案的所有主题,但是,当我更改标签时,我继续这个问题:

在此输入图像描述

请看看我的js代码:

  function initialize() {

//replace 0's on next line with latitude and longitude numbers from earlier on in tutorial.
var myLatlng = new google.maps.LatLng(40.654372, -7.914174);
var myLatlng1 = new google.maps.LatLng(43.654372, -7.914174);
    var myOptions = {
      zoom: 16,
      center: myLatlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }

    var myOptions1 = {
      zoom: 16,
      center: myLatlng1,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }

//here's where we call the marker.
//getElementById must be the same as the id you gave for the container of the map
var map = new …
Run Code Online (Sandbox Code Playgroud)

javascript jquery tabs google-maps google-maps-api-3

1
推荐指数
1
解决办法
5435
查看次数