Posted by NicolasH on July 12, 2011 at 3:04am
6 followers
Jump to:
| Project: | OpenLayers |
| Version: | 7.x-2.x-dev |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed (works as designed) |
Issue Summary
I'm using fieldgroup module to tidy up my input forms. It seems I can't place the map widget into a closed tab, since then the map only displays in a small fraction of the allocated area.
https://skitch.com/nikkenheimer/fjkfg/create-trip-horisontrejser
Placing it in open tabs works.
I'm using Chrome and FF on OSX. The theme is currently still core Bartik.
Comments
#1
This 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
#2
Yeah, ok....makes sense. Thanks for the clarification.
#3
Hey @NicolasH, were you able to find a way around this. Its a tough one.
#4
Related 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()?#5
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.
#6
Subscribing.
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
#7
@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.
#8
So, 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.
#9
I'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.
#10
This 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.