Cannot set map's div height for openlayers map

前端 未结 5 1395
予麋鹿
予麋鹿 2021-01-05 23:25

This code make the map\'s div width max but height to 0 (the % value doesn\'t matter, it\'s always 0)

5条回答
  •  臣服心动
    2021-01-06 00:15

    I ran into this topic because I wanted to set the map height in an ionic tab (ionicframework) to 100%. Even though this was not the original question maybe others run into this topic with the same issue. Additionally to the previous suggestions you have to set the height of the class .scroll to 100%:

    html, body {
        width: 100%;
        height: 100%;
    }
    
    .scroll {
        height: 100%;
    }
    
    #map {
        height: 100%;
    }
    

提交回复
热议问题