Reputation: 15663
I'm trying to show a dialog with a google map, when the user clicks on a certain button.
On this first load the map is shown correctly. After the user hides the dialog and opnes it again, the map is not centered, but moved to the left upper corner.
See this fiddle.
How can I fix this?
Upvotes: 1
Views: 1802
Reputation: 919
You just have to use the setCenter
method if the map is already created.
Please see this jsFiddle fork.
Upvotes: 4