Postpone google maps initialisation until after bootstrap tab is shown

前端 未结 7 1373
-上瘾入骨i
-上瘾入骨i 2020-12-06 22:25

I\'ve researched a lot and it seems like a lot of people have had the same issue as me here, but i cant figure out how to fix it.

Basically i\'m initializing a googl

相关标签:
7条回答
  • 2020-12-06 23:18
    $('#myTab a[href="#location"]').one('shown.bs.tab', function (e) {
        initialize();
    });
    

    Use .one() instead of .on(). This will prevent from reloading map again and again ;)

    0 讨论(0)
提交回复
热议问题