Incomplete map until resize
See original GitHub issueHi,
I’m trying to integrate a map in my application following the documentation. And although the code seems right, the map is not fully displayed:
L.Icon.Default.imagePath = 'vendors/leaflet/images';
var issuesMap = L.map('map',{
fadeAnimation: false,
zoomAnimation: false
}).setView([51.505, -0.09], 13, {
reset: true,
animate: false
});
EL.basemapLayer('Topographic').addTo(issuesMap);
As it can be seen, the map is almost empty, just displaying a small tile at the top-left of the screen…
After the resize, the map is fully displayed:
Anyone facing the same problems?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
Top Results From Across the Web
leaflet map does not appear correctly until resize
The problem is the map container appears but the content (tiles, etc) is not correct. Map becomes fine after a small resize on...
Read more >Map doesn't display correctly until window resize - Drupal
Hello I've setup, in Page Manager, 2 tabs displaying two maps. The default one displays normally, but when I click on the tab...
Read more >Problem with map tiles loading with Leaflet and Bootstrap
I guess there is a problem with size of a because if resize the browsers window tiles load correctly. Any ideas? Here is...
Read more >Leaflet Map Does Not Appear Correctly Until Resize - ADocLib
I guess there is a problem with size of a because if resize the browsers window tiles load correctly. Any ideas? Here is...
Read more >Leaflet.js map not showing until resize - Daniweb
Finally after two days and trying all the suggestions online, I've got this working. In case it helps anyone else, what I did...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thanks but still not working…
Only managed to make it work using a setTimeout, which use I want to skip at all costs…
setTimeout(function(){ issuesMap.invalidateSize()}, 100);
It seems that the
invalidateSize()
method is running before my map is rendered…http://leafletjs.com/reference-1.0.0.html#map-invalidatesize is what you need.