Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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