mustardBees/cmb_field_map

Point out of center when map is in hidden div

Closed this issue · 5 comments

Hi,

I really love your pluign, hope @jaredatch include your code in the framework :)

Ok, this is my problem. I have the map inside a hidden div, is a tab actually, so when I click in the tab where the map is the "point" of the location is not in the center it moves to the top-left corner of the iframe, searching for a solution I found this script: http://stackoverflow.com/questions/4528490/google-map-v3-off-center-in-hidden-div
But seams do not work, any idea of how can I fix this?

Thanx.

I believe I've seen the issue you're talking about. Take a look at this snippet, in particular, where we trigger a resize and center the map after the hidden div is made visible.

I tough it works, but don´t :(

Try here: http://ola2.boxqos.com/hoteles/mallorca/ola-hotel-el-vistamar-solo-adultos/ click on the tab "how to arrive" and see the map pint is not in the center. any idea ?

It's centered for me - looks like you've fixed your issue. Let me know if you have any further trouble.

sure?, I´m using chrome and the point is out of the center.

Try moving your tab_5 click function out of loadScript() as it's only being run once. You need it to run every time the tab is selected.