how to make leaflet map height variable

前端 未结 4 1432
旧巷少年郎
旧巷少年郎 2021-02-03 20:05

In my Application I was making div of map as

but to make my map responsi

4条回答
  •  别那么骄傲
    2021-02-03 20:17

    You have to set the div size with JavaScript.

    $("#map").height($(window).height()).width($(window).width());
    map.invalidateSize();
    

    You can find a complete example here.

提交回复
热议问题