Skip to content

Instantly share code, notes, and snippets.

Created July 30, 2014 14:04
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save nmccready/503e3d778852f7ab48f1 to your computer and use it in GitHub Desktop.
Example for html on angular google maps for having dynamic height.
let me google that for you (many ways to skin this cat) (implemented here)
body, html {
height: 100%;
width: 100%;
.angular-google-map-container {
height: 100%;
width: 50%;
position: absolute;
.middle {
display: table;
width: 50%;
margin-left: auto;
margin-right: auto;
Use bootstraps container w/ some overrides, nice thing about this on bootstrap is there is
psuedo element with clearfix and display: table; , all after (which is why I know .middle works above)
width: 50%;
padding-left: 0;
padding-right: 0;
<!DOCTYPE html>
<html ng-app="app">
<script src="//"></script>
<link rel="stylesheet" href="//">
<link rel="stylesheet" href="assets/stylesheets/example.css">
<link rel="stylesheet" href="assets/stylesheets/dynamic-height.css">
<script src="//"></script>
<script src="//"></script>
<script data-require="angular.js@1.2.x" src="" data-semver="1.2.16"></script>
<script src="//"></script>
<script src="../dist/angular-google-maps.js"></script>
<script src="assets/scripts/controllers/dynamic-map-height.js"></script>
<div data-ng-controller="ctrl" class="middle">
<google-map id="map"
<map-control template="clear.tpl.html" position="top-right" index="1" controller="mapWidgetCtrl"></map-control>
<nggmap-free-draw-polygons polygons="map.polys" draw="map.draw" ></nggmap-free-draw-polygons>
<li ng-repeat="p in map.polys">{{p.getPath()}}</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment