Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing google-maps API with twitter bootstrap having trouble with CSS on the div container containing the actual map
    text
    copied!<p>The map will load just fine but the second I try to set a height and width % it won't show, how can I fix this? The only way the map will show is if I set it with px, but then the mobile version of the map is all wonky and offset on the side of the screen. Thanks.</p> <pre><code>&lt;?php /* Include header and config and set variable*/ require_once('config.inc.php'); require_once($rootdir . $dirsubfolder . 'navbar.php'); $route = $_GET['route']; ?&gt; &lt;?php /* User wants to retrieve their route */ if (isset($route)) { ?&gt; &lt;?php /* User wants Route 1 */ if (strcmp($route, "sunroute1") == 0) { ?&gt; &lt;script type="text/javascript"&gt; function initialize() { var mapOptions = { center: new google.maps.LatLng(-34.397, 150.644), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP }; var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); } function loadScript() { var script = document.createElement("script"); script.type = "text/javascript"; script.src = "http://maps.googleapis.com/maps/api/js?key=asdasd&amp;sensor=true&amp;callback=initialize"; document.body.appendChild(script); } window.onload = loadScript; &lt;/script&gt; &lt;?php printf('worked'); } else { printf('failed'); } ?&gt; &lt;div class="container hero-unit"&gt; &lt;div id="map_canvas" style="width: 50%; height: 50%;"&gt;&lt;/div&gt; &lt;/div&gt; &lt;?php /* End isset(route) */ } /* Include footer */ require_once($rootdir . $dirsubfolder . 'footer.php'); ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload