add: this.log('Query the most recent geo-tagged post and center there'); 
context: GeoMashup.loadMap = function() {	this.container = document.getElementById("geoMashup");	this.showing_url = '';	this.checkDependencies();	this.map = new GMap2(this.container);	if (document.all&&window.attachEvent) { // IE-Win			 window.attachEvent("onunload", GUnload);	} else if (window.addEventListener) { // Others			 window.addEventListener("unload", GUnload, false);	}	GEvent.addListener(this.map, "moveend", function() {		var request = GXmlHttp.create();		var bounds = GeoMashup.map.getBounds();		var url = GeoMashup.linkDir + '/geo-query.php?minlat=' +			bounds.getSouthWest().lat() + '&minlon=' + bounds.getSouthWest().lng() + '&maxlat=' +			bounds.getNorthEast().lat() + '&maxlon=' + bounds.getNorthEast().lng();		if (GeoMashup.cat) {			url += '&cat=' + GeoMashup.cat;		}		request.open("GET", url, true);		request.onreadystatechange = function() {			if (request.readyState == 4) {				var xmlDoc = request.responseXML;				var markers = xmlDoc.getElementsByTagName("marker");				for (var i = 0; i < markers.length; i++) {					// Make a marker for each new post location					var post_id = markers[i].getAttribute("post_id");					if (!GeoMashup.posts[post_id]) {						// This post has not yet been loaded						var point = new GLatLng(							parseFloat(markers[i].getAttribute("lat")),							parseFloat(markers[i].getAttribute("lon")));						if (!GeoMashup.locations[point]) {							// There are no other posts yet at this point, create a marker							GeoMashup.locations[point] = new Object();							GeoMashup.locations[point].posts = new Array();							GeoMashup.locations[point].posts.push(post_id);							GeoMashup.locations[point].loaded = new Array();							GeoMashup.posts[post_id] = true;							var marker = GeoMashup.createMarker(point);							GeoMashup.locations[point].marker = marker;							GeoMashup.map.addOverlay(marker);						} else {							// There is already a marker at this point, add the new post to it							GeoMashup.locations[point].posts.push(post_id);							GeoMashup.posts[post_id] = true;						}					}				} // end for each marker				if (GeoMashup.firstLoad) {					GeoMashup.firstLoad = false;					GeoMashup.clickCenterMarker();				}			} // end readystate == 4		} // end onreadystatechange function		request.send(null);	});	if (!this.loadLat && !this.loadLon) {		// look for load settings in cookies		this.loadLat = this.getCookie("loadLat");		this.loadLon = this.getCookie("loadLon");	}	// Use default zoom level if appropriate	if (typeof(this.loadZoom) == 'undefined') {		var cookieZoom = parseInt(this.getCookie("loadZoom"));		if (cookieZoom) {			this.loadZoom = cookieZoom;		} else if (typeof(this.defaultZoom) != 'undefined') {			this.loadZoom = this.defaultZoom;		} else {			this.loadZoom = 5;		}	}	// Use default map type if appropriate	if (!this.loadType) {		var cookieTypeNum = parseInt(this.getCookie("loadType"));		if (cookieTypeNum) {			this.loadType = this.map.getMapTypes()[cookieTypeNum];		} else if (this.defaultMapType) {			this.loadType = this.defaultMapType;		} else {			this.loadType = G_NORMAL_MAP;		}	} 	if (this.loadLat && this.loadLon && typeof(this.loadZoom) != 'undefined') {		this.map.setCenter(new GLatLng(this.loadLat, this.loadLon), this.loadZoom, this.loadType);	} else {		// Center the map on the most recent geo-tagged post		var request = GXmlHttp.create();		var url = this.linkDir + '/geo-query.php';		if (this.cat) {			url += '?cat='+this.cat;		}		request.open("GET", url, false);		request.send(null);		var xmlDoc = request.responseXML;		var markers = xmlDoc.getElementsByTagName("marker");		if (markers.length>0) {			var point = new GLatLng(				parseFloat(markers[0].getAttribute("lat")),				parseFloat(markers[0].getAttribute("lon")));			this.map.setCenter(point,this.loadZoom,this.loadType);		}	}	// Add controls	if (this.mapControl == 'GSmallZoomControl') {		this.map.addControl(new GSmallZoomControl());	} else if (this.mapControl == 'GSmallMapControl') {		this.map.addControl(new GSmallMapControl());	} else if (this.mapControl == 'GLargeMapControl') {		this.map.addControl(new GLargeMapControl());	}		if (this.addMapTypeControl) {		this.map.addControl(new GMapTypeControl());	}	if (this.addOverviewControl) {		this.map.addControl(new GOverviewMapControl());		var ov = document.getElementById('geoMashup_overview');		if (ov) {			ov.style.position = 'absolute';			this.container.appendChild(ov);		}	}	if (this.addCategoryControl) {		this.map.addControl(new GeoMashupCategoryControl());	}} // end loadMap();
meta: 6742	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/6742/f084fe9ffe2221cf9c8df93a4325a4d4b918d9b4/geo-mashup.js/buggy/geo-mashup/geo-mashup.js