Mervyn Mervyn - 1 year ago 76
HTML Question

Display google map in bootstrap page when javascript is used on the map

I have created a basic html 5 page. I have successfully integrated google map and added some javascript so that when a user clicks on the map, a marker appears at that particular location.
Now I am trying to make this page responsive by using bootstrap.
The map is no more appearing on the page. I have been searching for these last couples of days and found that iframe can be used. Unfortunately, no tutorial, that I found, used iframes and javascript at the same time.
Can you help me please.

Here is the code I used for the map

<div id="map" style="width:50%;height:600px;position:left"><script src="" async defer></script></div>

Answer Source

Do something like this:

<div class="container">
  <div id="map"></div>

And set the div width for map to 100%:

#map {
 width: 100%;

That should do the trick!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download