Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Map in non-active tab is not rendered correctly #47

Open
gb5256 opened this issue Aug 5, 2019 · 1 comment
Open

Map in non-active tab is not rendered correctly #47

gb5256 opened this issue Aug 5, 2019 · 1 comment
Labels

Comments

@gb5256
Copy link

gb5256 commented Aug 5, 2019

When I render the widget on a hidden tab, the map will not be rendered correctly.
(There is a thread from 2014 here, but that code is not working anymore...).

I tried to add a listener to the tab-show event. That works, but I can not figure out how to access the map container.
map.invalidateSize(false); should do it, but it throws "Map not definded"

Any ideas?
Thanks,
gb5256

@tonydspaniard
Copy link
Member

tonydspaniard commented Aug 9, 2019

The problem @gb5256 is that you need to refresh the map on tab view. The issue with hidden tabs is common with leafleft or google maps.

map. <--- Map is not defined. You need to make sure the map is initialized with a name if you wish to refer it afterwards on your code.

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

No branches or pull requests

2 participants