Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

246
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda