When embedding a Google Map widget in a Mulipage group, the Google Map does not draw correctly (see attached file).

Calling the Google maps API resize function is the best fix I can think of. Here's a simple fix compatible with the Field group module:

Drupal.multipageControl.prototype.nextPage = function () {
    for (var maps in Drupal.Geolocation.maps) { google.maps.event.trigger(Drupal.Geolocation.maps[maps], 'resize'); }
};

Drupal.multipageControl.prototype.previousPage = function () {
    for (var maps in Drupal.Geolocation.maps) { google.maps.event.trigger(Drupal.Geolocation.maps[maps], 'resize'); }
};

however I'm not sure where this belongs in this module, or if it should be provided by the Field group module.

Comments

daniel.nitsche’s picture

I should note that in my case, the Google map was not on the first page of the Multipage (it was on the third page). I'd imagine maps on the first page wouldn't have this issue.

jjchinquist’s picture

I have the same issue with a multipage node. For me, the Drupal.Geolocation.maps array is empty. Do you have the same result?

Drupal.multipageControl.prototype.nextPage = function () {
    console.log('Drupal.Geolocation.maps length: ' + Drupal.Geolocation.maps.length);
};
daniel.nitsche’s picture

You may find it's actually not empty. Drupal.Geolocation.maps is an Object, which doesn't have a length property, so will always return 0.

So in my case, the length of Drupal.Geolocation.maps is 0, but the Object is not empty (try console.log on Drupal.Geolocation.maps).

jjchinquist’s picture

Hi, thanks for the info.

A very similar issue comes from using the Jcrop JS library from the imagefield_crop (http://drupal.org/project/imagefield_crop) module. The issue is outlined here: http://drupal.org/node/719714#comment-4570944

The code that is important is located in the patch http://drupal.org/files/issues/hidden-breaks-crop-719714-35_0.patch

I will attempt to apply the logic to the geolocation_googlemaps.js file.

funature’s picture

@jjchinquist could you please upload your solution here?

best regards & happy new year!

funature’s picture

I also found similar issue here http://drupal.org/node/352247. The #27 sounds be a good solution.

lklimek’s picture

derjochenmeyer’s picture

Issue summary: View changes
Status: Active » Closed (cannot reproduce)

Does this problem still exist?