Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Leaflet Map not loading after window size changes #890

Open
mjdzr opened this issue Nov 8, 2023 · 0 comments
Open

Leaflet Map not loading after window size changes #890

mjdzr opened this issue Nov 8, 2023 · 0 comments

Comments

@mjdzr
Copy link

mjdzr commented Nov 8, 2023

This seems like a common issue because I found it on my own shiny app as well as example apps on shinyapps.io gallery. Take this app for example and do these steps:

1- open the dashboard (example here). You'll see this:
enter image description here

2- Switch to a tab where you can no longer see the map (e.g., Data Explorer tab).

3- Change your browser window size and then change it back (I changed from full screen to smaller window and changed it back to full screen). Use Maximize/Restore Down button OR double-clicking on browser top bar to change window size and change it back. If you drag window to shrink/expand, you won't see any problem.

4- Now the map looks like this:
enter image description here

And the layer is gone:
enter image description here

You get the same outcome from other examples on shinyapps gallery page such as this example and this example. i.e., if you follow the 4 steps above, you'll see the only thing that remains is the basemap.

I tried these on Chrome on both Windows 10 and Mac. It's funny because the problem only happens if you change window size by Maximize/Restore Down button or double-click. Another funny thing is that after the layer is gone, another change of window size will bring the layer back!

The source codes for each case can be found on the pages provided.

Any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant