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

work around showing map on modals #150

Closed
vany0114 opened this issue Jun 16, 2017 · 1 comment
Closed

work around showing map on modals #150

vany0114 opened this issue Jun 16, 2017 · 1 comment

Comments

@vany0114
Copy link

Hi everyone,

Just in case, if you'll use a map over a modal it doesn't show correctly by default, indeed displays a "Grey" area's when it is placed inside a dynamic element. So do you need the next work around:

var currentCenter = GoogleMaps.maps.yourMap.instance.getCenter(); google.maps.event.trigger(GoogleMaps.maps.yourMap.instance, "resize"); GoogleMaps.maps.loadCenterMap.instance.setCenter(currentCenter); // Re-set previous center

The first and the third lines are just for reset the center because the resizing affects the center.

I lost a lot of time thinking that the problem was in api or something like that.

@dburles
Copy link
Owner

dburles commented Jun 18, 2017

Also see #58 and #107

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

2 participants