Adrian Iftode
Adrian Iftode

Reputation: 15663

jQuery dialog and Google Map don't behave correctly after the dialog is closed and re-opened

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.

http://jsfiddle.net/KHctC/5/

How can I fix this?

Upvotes: 1

Views: 1802

Answers (1)

GodLesZ
GodLesZ

Reputation: 919

You just have to use the setCenter method if the map is already created.

Please see this jsFiddle fork.

Upvotes: 4

Related Questions