Closed (works as designed)
Project:
Openlayers
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
12 Jul 2011 at 03:04 UTC
Updated:
25 Jan 2016 at 08:24 UTC
Jump to comment: Most recent
Comments
Comment #1
phayes commentedThis is an issue with open-layers...
Regrettably I think this is *actually* an issue with the google-maps API that is used to draw the base-layer you are using.
I would suggesting googling for the openlayers JS library and see how it deals with google maps layers and see if other people have seen this issue
Comment #2
nicolash commentedYeah, ok....makes sense. Thanks for the clarification.
Comment #3
zzolo commentedHey @NicolasH, were you able to find a way around this. Its a tough one.
Comment #4
zzolo commentedRelated issue: #1025708: Open Layers and Quicktabs (with ajax): TypeError: this.center is null
This is mostly a limitation of the OL library not being able to initialize maps on page load. We can either workaround this in the module, or focus on fixing upstream. The latter is better but requires specific expertise and time.
Basic search suggests using
map.updateSize()?Comment #5
nod_Actually i think it's an issue with verticaltabs. I have a custom form with a few fieldsets hidden in one of them is a OL map, no problem with it. Can someone post a way to replicate this ? (and it's working fine for the center map in admin form too)
Is this just with gmap ?
thansk.
Comment #6
castawaybcn commentedSubscribing.
I came here from #1168440: google maps layer not properly displayed - thanks zzolo- I have a similar issue but with 6.x and the map (google only) is displayed in a colorbox
Comment #7
nicolash commented@zzolo, no, having the map in an initially closed tab was a nice-to-have, not a requirement, so I just placed it somewhere else. Thanks for looking into it, though.
Comment #8
zzolo commentedSo, this should in theory be working fine. The OL UI module uses vertical tabs and has a map in one.
If this is still a problem, the only solution we can try to do is create a behavior for fieldsets that runs map.updateSize() when it it opens up, but otherwise, people will have to manage this themselves.
Comment #9
RuiMendes commentedI'm having the same problem with views accordion:
http://www.bichodepessego.com/fpsk_new/en/user/20
did anyone find a solution for this?
Thanks.
Comment #10
zzolo commentedThis should work if the element is rendered on load (not hidden with display none). And if that doesn't work, you'll have to use map.updateSize() in some way.
Comment #11
Countzero commentedJust for people who are struggling with this, here is some sample code I finally used to make it work.
This works for a map embeded in a JQuery Tab :
Hope it can help and thanks for the tips contained in this thread.
Comment #12
polFor which version of Openlayers ?
Comment #13
Countzero commentedOL 2-dev, the one listed for this issue.
Comment #14
polOk.
Comment #15
namwebs commented@Countzero #11 - I have the same requirement; can you please elaborate on where this code needs to go?
Comment #16
Countzero commentedSomewhere in a custom module's js file, as per https://www.drupal.org/node/756722.
Comment #17
namwebs commentedThanks, I will give it a go.
Update - great, I got it working.
:-)