Skip to content

Instantly share code, notes, and snippets.

@tomedme
Created August 23, 2010 21:49
Show Gist options
  • Save tomedme/546413 to your computer and use it in GitHub Desktop.
Save tomedme/546413 to your computer and use it in GitHub Desktop.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-GB">
<head>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script type="text/javascript">
// <![CDATA[
$(document).ready(function () {
if ($('#'+ Location.map_dom_id).size() && google.maps) {
Location.embedMap();
}
});
// ]]>
</script>
<script type="text/javascript">
// <![CDATA[
var Location = {
map: null,
map_dom_id: 'map_canvas',
lat: '51.36',
lng: '-0.05',
zoom: 12,
embedMap: function () {
var latlng = new google.maps.LatLng(this.lat, this.lng);
var options = {
zoom: this.zoom,
center: latlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
this.map = new google.maps.Map(document.getElementById(this.map_dom_id), options);
}
};
// ]]>
</script>
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0px; padding: 0px }
#map_canvas { height: 100% }
</style>
</head>
<body>
<div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment