Permalink
Browse files

first commit

  • Loading branch information...
aemkei committed Jul 21, 2010
0 parents commit b58f84bad54e354c594cffe51c95ddf5a0700ad4
Showing with 68 additions and 0 deletions.
  1. +68 −0 index.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Google Maps JavaScript API v3 Example: Styled MapTypes</title>
+<style type="text/css" media="screen">
+ body, html, #map_canvas {
+ height: 100%;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ }
+</style>
+<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
+<script>
+
+
+var base_url = "/vt/lyrs=m@130&src=api&apistyle=p.s:-100|p.v:off,s.e:l|p.v:on,s.t:49|p.v:off";
+
+function BabelMapType() {
+}
+
+var languages = "ja zh ru en".split(" ");
+
+BabelMapType.prototype.tileSize = new google.maps.Size(256,256);
+BabelMapType.prototype.maxZoom = 19;
+
+BabelMapType.prototype.getTile = function(coord, zoom, ownerDocument) {
+ var div = ownerDocument.createElement('img');
+ var host = "http://mt" + ((coord.x+coord.y)%3) + ".google.com";
+ var coords = "&x=" + coord.x + "&y=" + coord.y + "&z=" + zoom;
+ var language = "&hl=" + languages[Math.floor(Math.random()*languages.length)];
+
+ var url = host + base_url + coords + language;
+
+ div.style.width = this.tileSize.width + 'px';
+ div.style.height = this.tileSize.height + 'px';
+ div.src = url;
+ return div;
+};
+
+BabelMapType.prototype.name = "Babel";
+BabelMapType.prototype.alt = "Babylonian Map Type";
+
+var map;
+var babelMapType = new BabelMapType();
+
+function initialize() {
+
+ map = new google.maps.Map(document.getElementById("map_canvas"), {
+ zoom: 3,
+ backgroundColor: "#EEEEEE",
+ center: new google.maps.LatLng(32.536389, 44.420833),
+ mapTypeControlOptions: {
+ mapTypeIds: ['babel', google.maps.MapTypeId.ROADMAP],
+ style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
+ }
+ });
+
+ map.mapTypes.set('babel', babelMapType);
+ map.setMapTypeId('babel');
+}
+
+</script>
+</head>
+<body onload="initialize()">
+ <div id="map_canvas"></div>
+</body>
+</html>

0 comments on commit b58f84b

Please sign in to comment.