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

  • SOLVED

at this address:

http://www.kickproduction.it/grupporem/?category=99&prezzo=&prezzo_anywhere=&asw_search=true

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:


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

Answers (3)

2012-09-13

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: https://groups.google.com/forum/#!topic/wordpress-geo-mashup-plugin/orORRG892yw/discussion

2012-09-13

Arnav Joy answers:

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


Manlio Ma comments:

look here http://www.kickproduction.it/grupporem/immobili/

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

2012-09-13

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 :(