From GamingWiki
Jump to: navigation, search
 
(37 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
<div style="display:none" id="locationdescriptions">
+
</includeonly>
<div id="descTirNanOg" class="mapmarker">{{GhostTown/Tir nan Og}}</div>
 
<div id="descPurpleDoor" class="mapmarker">{{GhostTown/Purple Door}}</div>
 
<div id="descWoolenMill" class="mapmarker">{{GhostTown/Woolen Mill}}</div>
 
<div id="descLibrary" class="mapmarker">{{GhostTown/Joseph S. Stauffer Library}}</div>
 
</div>
 
 
<html>
 
<html>
 
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
 
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>
Line 26: Line 21:
 
var map;
 
var map;
 
var infowindow;
 
var infowindow;
 +
var markers = new Array();
  
 
function initialize() {
 
function initialize() {
Line 35: Line 31:
 
}
 
}
 
geocoder = new google.maps.Geocoder();
 
geocoder = new google.maps.Geocoder();
infowindow = new google.maps.InfoWindow();
+
infowindow = new google.maps.InfoWindow({maxWidth: 256});
 
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
 
map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
 
getMarkerList();
 
getMarkerList();
Line 45: Line 41:
 
  * Add a marker to the map
 
  * Add a marker to the map
 
  */
 
  */
function addMarker(latlng, title, description) {
+
function addMarker(latlng, title, descId) {
 
var marker = new google.maps.Marker({position:latlng, map: map, title:title});
 
var marker = new google.maps.Marker({position:latlng, map: map, title:title});
// infowindow = new google.maps.InfoWindow({
 
// content: "<div class=\"mapmarker\">\n" + description + "\n</div>"
 
// });
 
 
google.maps.event.addListener(marker, "click", function() {  
 
google.maps.event.addListener(marker, "click", function() {  
infowindow.setContent(description);
+
infowindow.setContent(document.getElementById(descId).innerHTML);
 
infowindow.open(map,marker);  
 
infowindow.open(map,marker);  
 
});
 
});
Line 58: Line 51:
 
  * Add a marker with a lat/lng pair
 
  * Add a marker with a lat/lng pair
 
  */
 
  */
function addMarkerByLatLng(lat, lng, title, description) {
+
function addMarkerByLatLng(lat, lng, title, descId) {
 
var latlng = new google.maps.LatLng(lat, lng);
 
var latlng = new google.maps.LatLng(lat, lng);
addMarker(latlng, title, description);
+
addMarker(latlng, title, descId);
 
}
 
}
  
Line 66: Line 59:
 
  * Add markers by address
 
  * Add markers by address
 
  */
 
  */
function addMarkerByAddress(address, title, description) {
+
function addMarkerByAddress(address, title, descId) {
 
if (geocoder) {
 
if (geocoder) {
 
geocoder.geocode({'address':address}, function(results, status) {
 
geocoder.geocode({'address':address}, function(results, status) {
 
if (status == google.maps.GeocoderStatus.OK) {
 
if (status == google.maps.GeocoderStatus.OK) {
 
var latlng = results[0].geometry.location;
 
var latlng = results[0].geometry.location;
addMarker(latlng, title, description);
+
addMarker(latlng, title, descId);
 
} else {
 
} else {
 
alert(address + " not found: "+results[0]+"; "+status);
 
alert(address + " not found: "+results[0]+"; "+status);
Line 83: Line 76:
 
  */
 
  */
 
function getMarkerList() {
 
function getMarkerList() {
// The Purple Door
+
for ( i = 0; i < markers.length; i++ ) {
addMarkerByLatLng(44.234807,-76.490271, "The Purple Door", document.getElementById("descPurpleDoor"));
+
marker = markers[i];
 
+
if (typeof marker['address'] === 'undefined' || marker['address'] == '') {
// Woolen mill
+
addMarkerByLatLng(marker['lat'], marker['lng'], marker['name'], marker['node']);
addMarkerByLatLng(44.242524,-76.482053,
+
} else {
"The Woolen Mill",
+
addMarkerByAddress(marker['address'], marker['name'], marker['node']);
"<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
 
addMarkerByLatLng(44.228188,-76.496108,
 
"Joseph S. Stauffer Library",  
 
"<div class=\"map_marker\"><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> </div>"
 
);
 
 
 
// Tir nan Og
 
addMarkerByAddress(
 
"200 Ontario St Kingston Ontario K7L 2Y9",
 
"Tir Nan Og Irish Pub",
 
document.getElementById("descTirNanOg"));
 
 
}
 
}
  
 
// --></script>
 
// --></script>
 
</html>
 
</html>
</includeonly>
 

Latest revision as of 17:55, 17 March 2011