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

Supporting map initialization event handling on server-side #15

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

futaz
Copy link

@futaz futaz commented Mar 17, 2021

Hey!

I use this Vaadin Addon in my current Vaadin 8 based project and there is a need to set the map's initial viewport to fit all markers added. Unfortunately I can't use setCenter and setZoom. It would be inconvenient, because I had to calculate the center and zoom by marker positions. There is already a fitToBounds method for this purpose but according to the official Google Maps Javascript API reference, it is only works when the map element in the DOM has size. So after when it has been rendered by GWT.

So I called this method during initialization of my vaadin view, but it doesn't worked.
This is why I added support for map initialization event. After this event, in the handler, I can call fitToBounds and it is working at this point.

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

Successfully merging this pull request may close these issues.

1 participant