Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

151
Visualizações
issue Loading maps when switching between iframes

I created a web site to load different maps (ArcGIS online web applications) by using tabs. I used iframes to switch between maps. It works but I have a little issue. The maps are not downloaded correctly, some layers are not visible. I should refresh every time before clicking on the buttons loading the maps. Any idea loading the maps without clicking on refresh button each time. Thanks in advance. I used this code:

`

      <button class="tablinks" onclick="loadMAP(event, 'MAP1')">Map1</button>
      <button class="tablinks" onclick="loadMAP(event, 'MAP2')">Map2</button>
      <button class="tablinks" onclick="loadMAP(event, 'MAP3')">Map3</button>
      
  </div>

  <!-- Tab content -->

  <div id="Map1" class="tabcontent">
    <iframe id="map1frame"  width="500" height="400" frameborder="1" scrolling="no" 
    marginheight="0" marginwidth="0"
    src="link to the map1"></iframe>
  </div>

  <div id="Map2" class="tabcontent">
    <iframe id="map2frame" width="500" height="400" frameborder="1" scrolling="no" 
    marginheight="0" marginwidth="0"
    src="Link to the map2"></iframe>
  </div>

  <div id="Map3" class="tabcontent">
    <iframe id="map3frame" width="500" height="400" frameborder="1" scrolling="no" marginheight="0" marginwidth="0"
        src="Link to the map3"></iframe>
  </div>

 

<script>

function loadMAP(evt, MAPname) {
    // Declare all variables

    var i, tabcontent, tablinks;

    // Get all elements with class="tabcontent" and hide them
    tabcontent = document.getElementsByClassName("tabcontent");
    for (i = 0; i < tabcontent.length; i++) {
    tabcontent[i].style.display = "none";

    }

    // Get all elements  with class="tablinks" and remove the class "active"
           
    tablinks = document.getElementsByClassName("tablinks");
    for (i = 0; i < tablinks.length; i++) {
    tablinks[i].className = tablinks[i].className.replace(" active", "");
    }

    // Show the current tab, and add an "active" class to the button that opened the tab
    location.reload();
    document.getElementById(MAPname).style.display = "block";
    evt.currentTarget.className += " active";
    }



</script>
`
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda