Twitter Bootstrap & Google Maps

前端 未结 2 1561
[愿得一人]
[愿得一人] 2021-02-01 23:38

I have a navbar and 100% x 100% google map in my app. I would like to add a sidebar on the right with different filters. Reason for adding it on the right side is because of bet

2条回答
  •  别那么骄傲
    2021-02-02 00:01

    Posted the answer I found as comment before, but to make it more visible, here is the answer: https://github.com/twbs/bootstrap/issues/2475

    You must add a javascript callback that will manually set the height of the map-canvas when the window is resized, for example.

    $(window).resize(function () {
        var h = $(window).height(),
            offsetTop = 60; // Calculate the top offset
    
        $('#map-canvas').css('height', (h - offsetTop));
    }).resize();
    

提交回复
热议问题