leaflet map shows up grey

后端 未结 6 680
渐次进展
渐次进展 2020-12-10 10:45

I\'m starting leaflet.js with the quickstart but my map shows as grey... is there something I\'m missing?

script.js:

var leafletMap = L.map(\'leaflet         


        
6条回答
  •  醉话见心
    2020-12-10 11:03

    Another thing to watch.

    If you check the network tab and the map tiles are loading ok, yet the map still remains grey, it can be due to CSS contamination from your surrounding page.

    In my case it was:

    img {
        max-height: 100%;
    }
    

    Fixed by overriding with:

    .my-leaflet-map-container img {
        max-height: none;
    }
    

提交回复
热议问题