From GamingWiki
Jump to: navigation, search
 
(28 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
<includeonly>
 
<includeonly>
 +
</includeonly>
 
<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 20: Line 21:
 
var map;
 
var map;
 
var infowindow;
 
var infowindow;
 +
var markers = new Array();
  
 
function initialize() {
 
function initialize() {
Line 29: 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 42: Line 44:
 
var marker = new google.maps.Marker({position:latlng, map: map, title:title});
 
var marker = new google.maps.Marker({position:latlng, map: map, title:title});
 
google.maps.event.addListener(marker, "click", function() {  
 
google.maps.event.addListener(marker, "click", function() {  
console.debug(infowindow);
+
infowindow.setContent(document.getElementById(descId).innerHTML);
infowindow.setContent(document.getElementById(descId));
 
 
infowindow.open(map,marker);  
 
infowindow.open(map,marker);  
 
});
 
});
Line 75: Line 76:
 
  */
 
  */
 
function getMarkerList() {
 
function getMarkerList() {
// The Purple Door
+
for ( i = 0; i < markers.length; i++ ) {
addMarkerByLatLng(44.234807,-76.490271, "The Purple Door", "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, "The Woolen Mill", "descWoolenMill");
+
} else {
 
+
addMarkerByAddress(marker['address'], marker['name'], marker['node']);
// Queen's Library
+
}
addMarkerByLatLng(44.228188,-76.496108, "Joseph S. Stauffer Library", "descLibrary");
+
}
 
 
// Tir nan Og
 
addMarkerByAddress("200 Ontario St Kingston Ontario K7L 2Y9", "Tir Nan Og Irish Pub", "descTirNanOg");
 
 
}
 
}
  
 
// --></script>
 
// --></script>
 
</html>
 
</html>
<div style="display:none" id="locationdescriptions">
 
<div id="descTirNanOg" class="mapmarker">{{Ghost Town/Tir nan Og}}</div>
 
<div id="descWoolenMill" class="mapmarker">{{Ghost Town/Woolen Mill}}</div>
 
<div id="descLibrary" class="mapmarker">{{Ghost Town/Joseph S. Stauffer Library}}</div>
 
{{Ghost Town/Purple Door.js}}
 
</div>
 
</includeonly>
 

Latest revision as of 17:55, 17 March 2011