Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

245
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!