How to reload Google Map in Bootstrap jQuery Tab

前端 未结 2 573
情书的邮戳
情书的邮戳 2020-12-07 05:09

I\'m using gmaps.js to load 2 maps in Bootstrap tabs. What happens, is the first map loads fine, but when the second tab (hidden) is clicked, the map doesn\'t load properly.

2条回答
  •  青春惊慌失措
    2020-12-07 05:27

    Try this way

    http://jsfiddle.net/7PueE/

  • Loveland
  • function loadmap() {
        var nmap = new GMaps({
            div: '#loveland-map',
            lat: 40.431917,
            lng: -105.078848,
            width: '100%',
            height: '500px',
            scrollwheel: false,
        });
        nmap.addMarker({
            lat: 40.431917,
            lng: -105.078848,
            title: 'Loveland Office',
            infoWindow: {
                content: '

    Loveland Office

    3820 N. Grant Ave.

    Loveland, CO 80538

    Directions
    ' } }); }

提交回复
热议问题