From GamingWiki
Jump to: navigation, search
 
(10 intermediate revisions by the same user not shown)
Line 21: Line 21:
 
var markers = new Array();
 
var markers = new Array();
 
var defaultLatLng = new google.maps.LatLng(43.243702,-79.889145);
 
var defaultLatLng = new google.maps.LatLng(43.243702,-79.889145);
var defaultZoom  = 12;
+
var defaultZoom  = 13;
  
 
function initialize() {
 
function initialize() {
Line 34: Line 34:
 
getMarkerList();
 
getMarkerList();
 
//addOverlays();
 
//addOverlays();
 +
addRailways();
 
jumpto = unescape(self.document.location.hash.substring(1));
 
jumpto = unescape(self.document.location.hash.substring(1));
 
recentre(jumpto);
 
recentre(jumpto);
Line 92: Line 93:
 
// Also add a marker
 
// Also add a marker
 
addMarkerByLatLng(lat,lng,title,id);
 
addMarkerByLatLng(lat,lng,title,id);
 +
}
 +
 +
/**
 +
* Add a polyline to the map
 +
*/
 +
function addPath(corners, title, id) {
 +
var path = new google.maps.Polyline({
 +
path:          corners,
 +
strokeColor:  "#00FF00",
 +
strokeOpacity: 0.8,
 +
strokeWeight:  2,   
 +
map:          map
 +
});
 +
// Don't create a marker
 
}
 
}
  
Line 130: Line 145:
 
if (key) {
 
if (key) {
 
var marker = markers[key];
 
var marker = markers[key];
if (typeof gMarker !== 'undefined') {
+
if (typeof marker !== 'undefined') {
 
var gMarker = marker["GMarker"];
 
var gMarker = marker["GMarker"];
 
if (typeof gMarker !== 'undefined') {
 
if (typeof gMarker !== 'undefined') {
 
newLatLng = gMarker.getPosition();
 
newLatLng = gMarker.getPosition();
 
if (marker["zoom"]) {
 
if (marker["zoom"]) {
newZoom = marker["zoom"];
+
newZoom = Number(marker["zoom"]);
 
}
 
}
 
}
 
}
 
}
 
}
 
}
 
}
 +
//alert("About to recentre, and zoom to "+newZoom+" for key '"+key+"'");
 
map.panTo(newLatLng);
 
map.panTo(newLatLng);
 
map.setZoom(newZoom);
 
map.setZoom(newZoom);
Line 167: Line 183:
 
});
 
});
 
GagePark.setMap(map);
 
GagePark.setMap(map);
 +
}
 +
 +
function addRailways() {
 +
var coords = [
 +
new google.maps.LatLng(43.2416,-79.7588),
 +
new google.maps.LatLng(43.2482,-79.7869),
 +
new google.maps.LatLng(43.2524,-79.8048),
 +
new google.maps.LatLng(43.2576,-79.8270),
 +
new google.maps.LatLng(43.2595,-79.8349),
 +
new google.maps.LatLng(43.2648,-79.8576),
 +
new google.maps.LatLng(43.2676,-79.8693),
 +
new google.maps.LatLng(43.2707,-79.8827),
 +
new google.maps.LatLng(43.2721,-79.8852),
 +
new google.maps.LatLng(43.2738,-79.8867),
 +
new google.maps.LatLng(43.2787,-79.8899),
 +
new google.maps.LatLng(43.2843,-79.8911),
 +
new google.maps.LatLng(43.2852,-79.8910),
 +
new google.maps.LatLng(43.2929,-79.8863),
 +
new google.maps.LatLng(43.2950,-79.8841),
 +
new google.maps.LatLng(43.2965,-79.8816),
 +
new google.maps.LatLng(43.3110,-79.8582),
 +
new google.maps.LatLng(43.3183,-79.8464),
 +
new google.maps.LatLng(43.3352,-79.8187),
 +
new google.maps.LatLng(43.3353,-79.8172),
 +
new google.maps.LatLng(43.3348,-79.8158),
 +
new google.maps.LatLng(43.3338,-79.8153),
 +
new google.maps.LatLng(43.3289,-79.8106),
 +
new google.maps.LatLng(43.3229,-79.8040),
 +
new google.maps.LatLng(43.3214,-79.8024),
 +
new google.maps.LatLng(43.3203,-79.8017),
 +
new google.maps.LatLng(43.3192,-79.8021),
 +
new google.maps.LatLng(43.3170,-79.8050),
 +
new google.maps.LatLng(43.3163,-79.8052),
 +
new google.maps.LatLng(43.3152,-79.8051),
 +
new google.maps.LatLng(43.3136,-79.8043),
 +
new google.maps.LatLng(43.3119,-79.8034),
 +
new google.maps.LatLng(43.3100,-79.8031),
 +
new google.maps.LatLng(43.3025,-79.7988),
 +
new google.maps.LatLng(43.2901,-79.7917),
 +
new google.maps.LatLng(43.2853,-79.7890),
 +
new google.maps.LatLng(43.2813,-79.7881),
 +
new google.maps.LatLng(43.2766,-79.7872),
 +
new google.maps.LatLng(43.2757,-79.7869),
 +
new google.maps.LatLng(43.2735,-79.7852),
 +
new google.maps.LatLng(43.2723,-79.7834),
 +
new google.maps.LatLng(43.2714,-79.7827),
 +
new google.maps.LatLng(43.2708,-79.7820),
 +
new google.maps.LatLng(43.2699,-79.7813),
 +
new google.maps.LatLng(43.2693,-79.7812),
 +
new google.maps.LatLng(43.2687,-79.7813),
 +
new google.maps.LatLng(43.2665,-79.7854),
 +
new google.maps.LatLng(43.2655,-79.7867),
 +
new google.maps.LatLng(43.2626,-79.7881),
 +
new google.maps.LatLng(43.2623,-79.7883),
 +
new google.maps.LatLng(43.2615,-79.7910),
 +
new google.maps.LatLng(43.2615,-79.7920),
 +
new google.maps.LatLng(43.2609,-79.7931),
 +
new google.maps.LatLng(43.2583,-79.7942),
 +
new google.maps.LatLng(43.2579,-79.7951),
 +
new google.maps.LatLng(43.2575,-79.7965),
 +
new google.maps.LatLng(43.2571,-79.7971),
 +
new google.maps.LatLng(43.2550,-79.7981),
 +
new google.maps.LatLng(43.2545,-79.7990),
 +
new google.maps.LatLng(43.2546,-79.8002),
 +
new google.maps.LatLng(43.2568,-79.8054),
 +
new google.maps.LatLng(43.2587,-79.8115),
 +
new google.maps.LatLng(43.2589,-79.8129),
 +
new google.maps.LatLng(43.2635,-79.8281),
 +
new google.maps.LatLng(43.2673,-79.8448),
 +
new google.maps.LatLng(43.2682,-79.8494),
 +
new google.maps.LatLng(43.2681,-79.8506),
 +
new google.maps.LatLng(43.2676,-79.8524),
 +
new google.maps.LatLng(43.2666,-79.8540),
 +
new google.maps.LatLng(43.2650,-79.8564),
 +
new google.maps.LatLng(43.2648,-79.8571),
 +
new google.maps.LatLng(43.2648,-79.8578)
 +
];
 +
//var corners = new google.maps.MVCArray();
 +
//var count = 0;
 +
//for (var pair in coords) {
 +
// count += corners.push(new google.maps.LatLng(pair[1],pair[0]));
 +
//}
 +
//console.log("Added "+count+" LatLngs");
 +
addPath(coords,'','');
 
}
 
}
  
 
// --></script>
 
// --></script>
 
</html>
 
</html>

Latest revision as of 19:00, 3 June 2012