-
Notifications
You must be signed in to change notification settings - Fork 49
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
How to add multiple maps on same page #135
Comments
Should be no problem at all, just make sure that you provide each a unique |
Funnily enough I got the two maps to load, but landed onto another problem. The maps only load after inspector is opened. I have my map-containers hidden in panels by default and call GoogleMaps.load() when a panel is toggled visible. The first map displays right away when the panel is toggled whereas the second one always stays blank until I open inspector. What could cause this? I use unique names on the maps, as well as unique options. |
It seems like it might be an issue with how you're hiding/showing the maps. How are you handling that? |
I am using basic Bootstrap collapsibles for hiding/showing the maps. Which are triggered by buttons: The GoogleMaps.load() is called whenever either of the buttons is clicked Both maps load correctly if they are both toggled visible when GoogleMaps.load() is called AND neither of the maps have loaded before. I wonder if the maps can be loaded asynchronously like I have intended. |
Your issue is most likely that the map is failing to correctly calculate the height of its container which causes the height to be calculated to 0. I left more detail on how to solve it over here #58 |
I have explicitly defined the map-container height, and width is auto: I also tried defining the width explicitly but without luck. :/ |
Strange, post a simple reproduction app and I'll take a look |
Here's reproduction. Please try adding class 'in' in the panels its toggling, it makes them visible by default and makes the maps load correctly. |
How can I add multiple maps on same page? Seems like the package cannot load the second map after the first one has been loaded.
The text was updated successfully, but these errors were encountered: