As soon as you put the OpenLayers map in a vertical tab, the layers are not being displayed anymore.
Moving the map out of the tab fixes the problem.

Still, this is annoying.

Comments

stopopol created an issue. See original summary.

m.stenta’s picture

Status: Active » Closed (duplicate)

I'm willing to bet that this is the same thing as #2644580: Maps with Google layers break when loaded in invisible element

Can you confirm by doing the following:

1. Click on the Vertical Tab that contains the map, to ensure that the map's DIV is visible.
2. Open up Console in Chrome/Firefox
3. Find the CSS ID of the DIV containing your map - the div should also have a "openlayers-map" class. You need the ID of that DIV.
4. Enter the following commands into console (replace [[DIV-ID]] with the ID you found):

var id = [[DIV-ID]];
var map = Drupal.openlayers.getMapById(id);
map.map.updateSize();

Does that cause the map to show up?

stopopol’s picture

Resizing the window itself also makes the map visible, so yes. It's a duplicate.

m.stenta’s picture

Ok cool - thanks for confirming. We should probably generalize that other issue.

It seems that whenever a map is built inside a hidden div it has the same issue.