Skip to content

Instantly share code, notes, and snippets.

@niuage
Created June 14, 2012 15:03
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save niuage/2930873 to your computer and use it in GitHub Desktop.
Save niuage/2930873 to your computer and use it in GitHub Desktop.
How to add the Quest mode in Google Maps from April Fools Day 2012
// Set map options
var mapOptions = {
center: new google.maps.LatLng(41.917142, -87.673837), // Or whatever
zoom: 15,
mapTypeId: "quest",
mapTypeControlOptions: {
mapTypeIds: [google.maps.MapTypeId.ROADMAP, google.maps.MapTypeId.SATELLITE, "quest"]
},
scrollwheel: false
}
// Create map, attach options
map = new google.maps.Map(window.document.getElementById("map_div"), mapOptions);
// Set quest options
var questOptions = {
getTileUrl: function(coord, zoom) {
return "http://mt1.google.com/vt/lyrs=8bit,m@174000000&hl=en&src=app&s=Galil&" + "z=" + zoom + "&x=" + coord.x + "&y=" + coord.y;
},
tileSize: new google.maps.Size(256, 256),
isPng: true,
maxZoom: 20,
minZoom: 0,
radius: 1738000,
name: "Quest",
credit: "SQUARE ENIX"
};
// Register quest options with a mapType "quest"
map.mapTypes.set("quest", new google.maps.ImageMapType(questOptions));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment