Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Geo Mashup map and .slideUp: error display map WordPress


at this address:

I want hide map defalut, and display only if click on "Visualizza i risultati sulla Mappa"

The SlideUp/Down works, but the map doens't load correctly.
(chrome: not center map / firefox: blank map)

The map is a <?php echo GeoMashup::map( 'map_content=contextual' ); ?>, that works in a results page.

Anyone could help me?

this is my JS code:

$('#aTag').live('click', function() {
var divT = $('#divToggle');
if (":hidden")) {
$(this).text('Nascondi Mappa');
else {
$(this).text('Vedi Risultati sulla Mappa');

Answers (3)


Dylan Kuhn answers:

In general google maps will not load properly when hidden. You can load them offscreen instead. I'm not sure if the frame load event is late enough, but you could try

$( '#divToggle .gm-map iframe' ).load( function() {
$( '#divToggle' ).slideUp();
} );

Manlio Ma comments:

Thanx DYlan, your code works !

Bu is impossible to hide ? And if I use a tab jquery would be the same problem ..cause will be no_display tab?

Dylan Kuhn comments:

Right - anything using hide(), slideUp(), toggle(), etc. ends up hidden. Here's some code where I put things way above the viewport with top at -9999px instead of hiding, and there they render correctly:!topic/wordpress-geo-mashup-plugin/orORRG892yw/discussion


Arnav Joy answers:

if you do not use the js , then maps load or not?

Manlio Ma comments:

look here

the map works perfectly if status is not hide (.slideUp)


Michael Caputo answers:

It looks like the map is loading properly when hidden..

I would try adding a div around the <div class="legenda fl"> div

Manlio Ma comments:

nothing new :(