Created
June 14, 2012 15:03
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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