Skip to content

Instantly share code, notes, and snippets.

@willwhite
Created September 7, 2010 21:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save willwhite/569105 to your computer and use it in GitHub Desktop.
Save willwhite/569105 to your computer and use it in GitHub Desktop.
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/>
<title>MapBox Afghanistan Winter with Google Maps API</title>
<script src="http://js.mapbox.com/g/2/mapbox.js" type="text/javascript"></script>
<script src="http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key=ABQIAAAAyy_sg_kvGifscGkzZ2uxzxTGv8pFig_qdcIeIanIjQzecSm0lRRq4s4kzJSNgFaqRoQiY2UvM2DKJA" type="text/javascript"></script>
<link rel=stylesheet href="gmapbox.css" type="text/css" media=screen />
</head>
<script type="text/javascript">
function initialize() {
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
// Add custom map type
var options = {minZoom: 5, maxZoom: 13};
var custommap = GMapBox('afghanistan-grey', 'Afghanistan Grey', options);
map.setCenter(new GLatLng(34,65), 6)
map.addMapType(custommap);
map.setMapType(custommap);
map.setUIToDefault();
// Add overlay: ethnic data
var options = {minZoom: 0, maxZoom: 12, overlay: true, type: 'png', opacity: 1.0};
customoverlay = GMapBox('afghanistan-ethnic', 'Ethnic Data', options);
map.addOverlay(customoverlay);
}
else {
alert("The Google Maps API is not compatible with this browser");
}
}
</script>
<body onload="initialize()" onunload="GUnload()">
<div id="map" style="width: 900px; height: 600px"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment