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

249
Visualizações
Mapbox map not correctly displaying javascript

I have added map to my site and everything works fine when the map is placed in a parents div with display:flex.

But I have a requirement to display my map after the user clicks on a button so the parent div in which map is placed at the loading of page has display:none and then when clicking on button it becomes flex.

But when clickng on button something strange happens to map map not shown correctly

I found out that when resizing it becomes normal map shown correctly

here is the map css:

#add_adv_map {
    width: 90%;
    height: 400px;
    margin-top: 20px;
    margin-bottom: 5px;
}

and html

<div class="add-adv__info__item add-adv__info__item--block add-info-address">
     <div class="add-adv__form__title">adress</div>
     <input type="text" name="flat_location" class="object_parameter_input object_parameter_input--large"
                 id="add_adv_address"
      <div id='add_adv_map'></div>  required> <!--map container-->
</div>

havent found any questions on this topic and any answers either

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

had the same issue I simply resized window by some value and then returned size back Haven't found any better solution

about 4 years ago · Juan Pablo Isaza Relatório
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