SlideToggle does not load Maps correctly

0

I have two maps on one page, I am using slideToggle and slideUp to display let only one map view at a time. map_fix and map_movement are the divs that contain the maps.

#mapa_fixo
{
    display:none;
}

#mapa_movimento
{
    display:none;
}


    function verifica_categoria_carrega_mapa(id)
    {

    var id_categoria = id;


    if(id==1)
    {

        if($("#mapa_fixo").is(":visible") == true)
        {
        }
        else
        {

            $("#mapa_fixo").slideToggle();
            $("#mapa_movimento").slideUp();
            return false;
        }
    }
    else if(id==2)
    {
        if($("#mapa_movimento").is(":visible") == true)
        {
        }
        else
        {

            $("#mapa_fixo").slideUp();
            $("#mapa_movimento").slideToggle();

            gmaps.refresh()

            return false;
        }

    }
}

It's working, but the maps are not being displayed properly, due to jquery components one of the maps is loaded into one .js file and the other directly to the page.

If you are loading maps normally, without displaying: none, maps will load normally.

Fixed Map

MotionMap

    
asked by anonymous 16.12.2015 / 22:12

1 answer

0

Resolved.

I started the maps without Display: none, and after a few seconds I applied the Display: none by function. The maps are already loaded and the problem no longer occurs

window.setTimeout(someFunction, 10000);
function someFunction()
{
    document.getElementById("mapa_fixo").style.display = "none";
    document.getElementById("mapa_movimento").style.display = "none";
}
    
17.12.2015 / 03:20