Leaflet map not showing properly in bootstrap 3.0 modal

后端 未结 7 1567
迷失自我
迷失自我 2020-12-03 07:47

i have a big problem. i want to open a leaflet map in a modal. but the map is not showing properly. the tiles are not loading.

here is the script:

http://boo

7条回答
  •  借酒劲吻你
    2020-12-03 08:10

    This worked for me -

     $('#gmap').on('shown.bs.tab', function (e) {
        //call the clear map event first
        clearMap();
        //resize the map - this is the important part for you
       map.invalidateSize(true);
       //load the map once all layers cleared
       loadMap();
    })
    

提交回复
热议问题