question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Incomplete map until resize

See original GitHub issue

Hi,

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);

captura de pantalla 2016-08-22 a les 15 24 12

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: captura de pantalla 2016-08-22 a les 15 26 22

Anyone facing the same problems?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:6
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

14reactions
avizcainocommented, Aug 22, 2016

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…

7reactions
yohanbonifacecommented, Aug 22, 2016
Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found