Search code examples
google-mapsruby-on-rails-3.2gmaps4rails

broken google map with gmaps4rails


I use gmaps4rails 1.5.7 in my Rails 3.2.19 app, so the user can select his location. In the general administrator's page, the map loads without any problem and I (the admin) can select or fix the location of the user. But on the user's edit page, with exactly the same code as the page of the administrator, I have a broken map like this:

[broken google map[1]

No matter if I drag the map, the visible part, is only a small piece of the given area. It is crazy as I have exactly the same code in both cases.

Do you have any idea for this?


Solution

  • The owner of gmaps4rails gave me the hint for my issue.

    The map div must be visible whenever the js code to create the map is executed.

    In my case, the map div was hidden, because it was not on the main tab.

    Thank you for your help Benjamin!