Created
May 19, 2012 10:07
-
-
Save kwivix/2730322 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>Gmaps</title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<!-- Le styles --> | |
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet"> | |
<style> | |
body { | |
padding-top: 60px; /* 60px to make the container go all the way to the bottom of the topbar */ | |
} | |
.mapdemo { | |
width: auto; | |
height: 300px; | |
} | |
.fix-benmajor .gmnoprint img { | |
max-width: none | |
} | |
.map img { | |
max-width: none | |
} | |
</style> | |
<link href="http://twitter.github.com/bootstrap/assets/css/bootstrap-responsive.css" rel="stylesheet"> | |
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements --> | |
<!--[if lt IE 9]> | |
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> | |
<![endif]--> | |
</head> | |
<body> | |
<div class="navbar navbar-fixed-top"> | |
<div class="navbar-inner"> | |
<div class="container"> | |
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
<span class="icon-bar"></span> | |
</a> | |
<a class="brand" href="#">GMaps</a> | |
<div class="nav-collapse"> | |
<ul class="nav"> | |
<li class="active"><a href="#">Home</a></li> | |
</ul> | |
</div><!--/.nav-collapse --> | |
</div> | |
</div> | |
</div> | |
<div class="container"> | |
<h1>Default <small>No fixes</small></h1> | |
<div id="no-fix" class="mapdemo"></div> | |
<h1>gmnoprint fix by benmajor</h1> | |
<div id="fix-benmajor" class="mapdemo fix-benmajor"></div> | |
<h1>Fix from kwivix</h1> | |
<div id="fix-kwivix" class="mapdemo map"></div> | |
</div> <!-- /container --> | |
<!-- Le javascript | |
================================================== --> | |
<!-- Placed at the end of the document so the pages load faster --> | |
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script> | |
<script> | |
var mapIds = ['no-fix','fix-benmajor','fix-kwivix'] | |
, map, infoWindow | |
, tHq = new google.maps.LatLng(37.782165, -122.400586) | |
, mapOptions = { | |
zoom: 16, | |
center: tHq, | |
mapTypeId: google.maps.MapTypeId.ROADMAP | |
} | |
for(i in mapIds) { | |
map = new google.maps.Map(document.getElementById(mapIds[i]),mapOptions) | |
infoWindow = new google.maps.InfoWindow(); | |
infoWindow.setContent('Twitter, Inc.<br>795 Folsom St., Suite 600<br>San Francisco, CA 94107') | |
infoWindow.setPosition(tHq) | |
infoWindow.open(map) | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there a way to show a pin for the location, like for a place of business?