From GamingWiki
| Line 1: | Line 1: | ||
<html> | <html> | ||
| − | <script type="text/javascript"> | + | <script type="text/javascript"> |
| + | /** | ||
| + | * Google Maps overlay for Kingston: Ghost Town | ||
| + | * | ||
| + | * This is the driver for the map overlay for the Dresden Files campaign, | ||
| + | * "Ghost Town". We put various important locations on this map. | ||
| + | * | ||
| + | * Google Maps API documentation: | ||
| + | * http://code.google.com/apis/maps/documentation/javascript/ | ||
| + | * Reference docs: | ||
| + | * http://code.google.com/apis/maps/documentation/javascript/reference.html | ||
| + | */ | ||
| + | |||
| + | // Initialization | ||
| + | function initialize() { | ||
| + | var myLatlng = new google.maps.LatLng(44.24,-76.5); | ||
| + | var myOptions = { | ||
| + | zoom: 13, | ||
| + | center: myLatlng, | ||
| + | mapTypeId: google.maps.MapTypeId.ROADMAP | ||
| + | } | ||
| + | var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions); | ||
| + | var markers = getMarkerList(map); | ||
| + | //for (i = 0; i < len(markers); i++) { marker.setMap(map); } | ||
| + | } | ||
| + | |||
| + | function loadScript() { | ||
| + | var script = document.createElement("script"); | ||
| + | script.type = "text/javascript"; | ||
| + | script.src = "http://maps.google.com/maps/api/js?sensor=false&callback=initialize"; | ||
| + | document.body.appendChild(script); | ||
| + | } | ||
| + | |||
| + | window.onload = loadScript; | ||
| + | |||
| + | // Helper function | ||
| + | function mkMarker(map, lat, lng, mrkTitle, html) { | ||
| + | var latlng = new google.maps.LatLng(lat, lng); | ||
| + | var marker = new google.maps.Marker({position:latlng, map: map, title: mrkTitle}); | ||
| + | var infowindow = new google.maps.InfoWindow({ | ||
| + | content: "<div class=\"mapmarker\">\n" + html + "\n</div>" | ||
| + | }); | ||
| + | google.maps.event.addListener(marker, "click", function() { | ||
| + | infowindow.open(map,marker); | ||
| + | }); | ||
| + | return marker; | ||
| + | } | ||
| + | |||
| + | /** | ||
| + | * Set up the various locations in Ghost Town, to be placed on the map. | ||
| + | */ | ||
| + | function getMarkerList(map) { | ||
| + | var locations = new Array(); | ||
| + | |||
| + | // The Purple Door | ||
| + | locations.push(mkMarker(map, 44.234807,-76.490271, | ||
| + | "The Purple Door", | ||
| + | "<p><b>The Purple Door Books & Gifts</b></p> " + | ||
| + | "<p><b>Aspect: <span class=\"aspect\">Struggling to stay open</span></b> " + | ||
| + | "Threats of foreclosure have been hounding the Purple Door, and causing "+ | ||
| + | "its proprietor, Madame Esmerelda, to scramble to keep it open. " | ||
| + | )); | ||
| + | |||
| + | // Woolen mill | ||
| + | locations.push(mkMarker(map, 44.242524,-76.482053, | ||
| + | "The Woolen Mill", | ||
| + | "<p><b>The Woolen Mill</b></p> " + | ||
| + | "<p><b>Aspect: <span class=\"aspect\">Working to obsolete itself</span></b> " + | ||
| + | "The Woolen Mill is an office building in downtown Kingston that houses, " + | ||
| + | "among other companies and agencies, a StarTek call centre.</p> " | ||
| + | )); | ||
| + | |||
| + | // Queen's Library | ||
| + | locations.push(mkMarker(map, 44.228188,-76.496108, | ||
| + | "Joseph S. Stauffer Library", | ||
| + | "<p><b>Joseph S. Stauffer Library</b></p> " + | ||
| + | "<p><b>Aspect: <span class=\"aspect\"></span></b> " + | ||
| + | "This is the main library at Queen's University. " + | ||
| + | "Any book mentioning the occult or the supernatural has been lost, stolen " + | ||
| + | "or defaced.</p> " | ||
| + | )); | ||
| + | |||
| + | return dw_locations; | ||
| + | } | ||
| + | |||
| + | </script> | ||
</html> | </html> | ||
Revision as of 16:06, 24 October 2010