This map cannot be displayed. The site's key may be ",
"incorrect, or your browser may not compatible (see if ",
"your browser is listed ",
'
here).
',
''
].join('\n');
div.style.visibility = 'visible';
div.style.padding = '0.3em';
div.style.background = '#eee';
div.style.overflow = 'auto';
}
}
}
else {
alert( [
'Your browser is not capable of displaying',
'Google Maps on this page.',
'' ].join('\n') );
}
return;
}
addOnUnload( GUnload );
function getTotalOffset( elem ) {
point = new GPoint( 0, 0 );
while( elem ) {
point.x += elem.offsetLeft;
point.y += elem.offsetTop;
//alert( elem.offsetTop + ' = ' + point.y );
elem = elem.offsetParent;
}
return point;
}
function GSmallMapTypeControl() {
GMapTypeControl.call( this, true );
}
GSmallMapTypeControl.prototype = new GMapTypeControl();
GSmallMapTypeControl.prototype.constructor = GSmallMapTypeControl;
window.GSmallMapTypeControl = GSmallMapTypeControl;
var CtrlTable = {
'GOverviewMapControl': true,
'GLargeMapControl': true,
'GSmallMapControl': true,
'GSmallZoomControl': true,
'GSmallMapTypeControl': true,
'GMapTypeControl': true,
'GScaleControl': true
};
var MapTypeTable = {
'G_MAP_TYPE' : true,
'G_SATELLITE_TYPE' : true,
'G_HYBRID_TYPE' : true
};
var idmarkers = {};
function markerForUrl( url ) {
var matcha = /#(.*)/.exec( url );
if( matcha )
return idmarkers[ matcha[ 1 ] ];
else
return null;
}
// For this event handler, "this" is the clicked anchor
function anchorClick() {
var marker = markerForUrl( this.href );
if( marker ) {
if( /\bZOOM\b/.exec( this.className ) ) {
var mapType = marker.mapType || marker.ezmap.map.getCurrentMapType();
var zoomLevel;
if( marker.span ) {
zoomLevel = mapType.getSpanZoomLevel(
marker.point, marker.span, marker.ezmap.viewsize );
}
else {
zoomLevel = marker.ezmap.map.getZoom();
}
marker.ezmap.map.setCenter( marker.point, zoomLevel, mapType );
}
marker.doOpen();
return false;
}
else {
return true;
}
}
function wordMap( str ) {
var wmap = {};
var list = str.split(' ');
for( var j = 0; j < list.length; ++j ) {
wmap[ list[ j ] ] = true;
}
return wmap;
}
function parseParams( str, params ) {
var matchparam;
for( var word in wordMap( str ) ) {
matchparam = /^(\w+):(.*)$/.exec( word );
if( matchparam && matchparam[1] in params ) {
params[ matchparam[1] ] = matchparam[2];
}
}
return params;
}
var markerOpener = {
markers: [],
addMarker: function( marker ) {
this.markers.push( marker );
},
chainOpen: function( i ) {
/*
* This is a work-around for a Google Maps bug. If I try to open
* all the info windows at once, only the last one succeeds.
*
* Otherwise, it is equivalent to:
* for( i = 0; i < this.markers.length; ++i )
* this.markers[ i ].doOpen();
*/
i = i || 0;
if( i < this.markers.length ) {
var onOpen = GEvent.bind(
this.markers[ i ].ezmap.map,
"infowindowopen",
this,
function(){
GEvent.removeListener( onOpen );
this.chainOpen( i + 1 );
});
this.markers[ i ].doOpen( true );
}
else {
//alert('GMapEZ loadtime: ' + ( new Date() - startdate ) );
}
}
};
var laterFuncs = [];
var lastFunc = null;
function doNow() {
if( laterFuncs.length > 0 ) {
laterFuncs.shift().call();
setTimeout( doNow, 1 );
}
else {
if( lastFunc ) {
lastFunc.call();
}
}
}
function doLater( obj, func ) {
laterFuncs.push( function() { func.call( obj ); } );
}
var MiniIcon = new GIcon();
MiniIcon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
MiniIcon.iconSize = new GSize(12, 20);
MiniIcon.shadowSize = new GSize(22, 20);
MiniIcon.iconAnchor = new GPoint(6, 20);
MiniIcon.infoWindowAnchor = new GPoint(5, 1);
function EZInfoMarker( ezmap ) {
this.ezmap = ezmap;
this.icon = G_DEFAULT_ICON;
this.point = null;
this.title = null;
this.blowup = false;
this.tabs = [];
this.infoZoomOffset = undefined;
this.infoZoomLevel = undefined;
this.infoMapType = null;
}
EZInfoMarker.prototype = new GMarker( new GLatLng( 0, 0 ) );
EZInfoMarker.prototype.constructor = EZInfoMarker;
EZInfoMarker.prototype.initialize = function( map ) {
GMarker.call(
this,
this.point,
{
icon: this.icon,
clickable: ( this.tabs.length > 0 || this.blowup ),
title: this.title
});
GMarker.prototype.initialize.call( this, map );
};
EZInfoMarker.prototype.doOpen = function( autoopen ) {
if( ! autoopen ) {
var body = document.body || document.getElementsByTagName('body')[0];
if( 'scrollLeft' in body ) {
// http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement &&
( document.documentElement.clientWidth ||
document.documentElement.clientHeight ) )
{
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body &&
( document.body.clientWidth || document.body.clientHeight ) )
{
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
var mapdiv = this.ezmap.div;
var totalOffset = getTotalOffset( mapdiv );
if( totalOffset.x < body.scrollLeft ||
totalOffset.x + mapdiv.offsetWidth > body.scrollLeft+myWidth ||
totalOffset.y < body.scrollTop ||
totalOffset.y + mapdiv.offsetHeight > body.scrollTop+myHeight)
{
//alert( totalOffset.x + ', ' + totalOffset.y );
scrollTo( totalOffset.x, totalOffset.y );
}
}
}
var zoom = null;
if( this.tabs.length > 0 ) {
var opts = { maxWidth: this.ezmap.div.offsetWidth - 100 };
if( this.icon ) {
this.openInfoWindowTabs( this.tabs, opts );
}
else {
// "INVISIBLE" markers are never added as overlays -- GMap2
// knows nothing about them.
this.ezmap.map.openInfoWindowTabs( this.point, this.tabs, opts );
}
for( var i = 0; i < this.tabs.length; ++i ) {
this.setupInfoForm( this.tabs[ i ] );
}
}
else if( this.blowup ) {
if( this.infoZoomOffset != undefined )
zoom = this.ezmap.map.getZoom() + this.infoZoomOffset;
else if( this.infoZoomLevel != undefined )
zoom = this.infoZoomLevel;
if( zoom >= this.ezmap.map.getCurrentMapType().numZoomLevels )
zoom = this.ezmap.map.getCurrentMapType().numZoomLevels - 1;
else if( zoom < 0 )
zoom = 0;
this.showMapBlowup( { zoomLevel: zoom, mapType: this.infoMapType } );
}
else {
this.ezmap.map.closeInfoWindow();
}
};
EZInfoMarker.prototype.setupInfoForm = function( tab ) {
var div, a;
var tabElem = tab.contentElem;
var classes = tabElem.className ? wordMap( tabElem.className ) : {};
if( classes.DirectionsToHere ||
classes.DirectionsFromHere ||
classes.SearchNearby )
{
if( tab.infoFormId ) {
div = document.getElementById( tab.infoFormId );
div.innerHTML = '';
}
else {
div = document.createElement('div');
div.className = 'ez_infoForm';
tab.infoFormId = div.id = newId();
tabElem.appendChild( div );
}
var _this = this;
if( classes.DirectionsToHere || classes.DirectionsFromHere ) {
div.appendChild( document.createTextNode( 'Get directions: ' ) );
if( classes.DirectionsToHere ) {
a = document.createElement('a');
a.innerHTML = 'To here';
a.onclick = function() { _this.showForm( tab ); };
a.href = 'javascript:void(null)';
div.appendChild( a );
}
if( classes.DirectionsToHere && classes.DirectionsFromHere ) {
div.appendChild( document.createTextNode( ' - ' ) );
}
if( classes.DirectionsFromHere ) {
a = document.createElement('a');
a.innerHTML = 'From here';
a.onclick = function() {};
a.href = 'javascript:void(null)';
div.appendChild( a );
}
div.appendChild( document.createElement('br') );
}
if( classes.SearchNearby ) {
a = document.createElement('a');
a.innerHTML = 'Search nearby';
a.onclick = function() {};
a.href = 'javascript:void(null)';
div.appendChild( a );
}
}
};
EZInfoMarker.prototype.showForm = function( tab ) {
var div = document.getElementById( tab.infoFormId );
div.innerHTML = '