--- Clusterer2_old.js	2008-12-16 12:43:05.000000000 +1100
+++ Clusterer2.js	2008-12-16 12:30:16.000000000 +1100
@@ -24,7 +24,7 @@
 // http://www.acme.com/javascript/
 //
 //
-// Copyright © 2005,2006 by Jef Poskanzer <jef@mail.acme.com>.
+// Copyright ï¿½ 2005,2006 by Jef Poskanzer <jef@mail.acme.com>.
 // All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
@@ -257,18 +257,45 @@ Clusterer.Display = function ( clusterer
 	var latRange = bounds.getNorthEast().lat() - bounds.getSouthWest().lat();
 	var latInc = latRange / clusterer.gridSize;
 	var lngInc = latInc / Math.cos( ( bounds.getNorthEast().lat() + bounds.getSouthWest().lat() ) / 2.0 * Math.PI / 180.0 );
-	for ( var lat = bounds.getSouthWest().lat(); lat <= bounds.getNorthEast().lat(); lat += latInc )
-	    for ( var lng = bounds.getSouthWest().lng(); lng <= bounds.getNorthEast().lng(); lng += lngInc )
-		{
-		cluster = new Object();
-		cluster.clusterer = clusterer;
-		cluster.bounds = new GLatLngBounds( new GLatLng( lat, lng ), new GLatLng( lat + latInc, lng + lngInc ) );
-		cluster.markers = [];
-		cluster.markerCount = 0;
-		cluster.onMap = false;
-		cluster.marker = null;
-		clusterer.clusters.push( cluster );
+	for ( var lat = bounds.getSouthWest().lat(); lat <= bounds.getNorthEast().lat(); lat += latInc ) {
+		if ( bounds.getSouthWest().lng() <= bounds.getNorthEast().lng() ) {
+			for ( var lng = bounds.getSouthWest().lng(); lng <= bounds.getNorthEast().lng(); lng += lngInc ) {
+				cluster = new Object();
+				cluster.clusterer = clusterer;
+				cluster.bounds = new GLatLngBounds( new GLatLng( lat, lng ), new GLatLng( lat + latInc, lng + lngInc ) );
+				cluster.markers = [];
+				cluster.markerCount = 0;
+				cluster.onMap = false;
+				cluster.marker = null;
+				clusterer.clusters.push( cluster );
+			}
 		}
+		else {
+			var tempsw, tempne;
+			for ( var lng = bounds.getSouthWest().lng(); lng <= (180 + (180 + bounds.getNorthEast().lng())); lng += lngInc ) {
+				cluster = new Object();
+				cluster.clusterer = clusterer;
+				if ( lat <= 180 ) {
+					tempsw = new GLatLng( lat, lng );
+				}
+				else {
+					tempsw = new GLatLng( lat, (-180 + (lng - 180)) );
+				}
+				if ( lat + latInc <= 180 ) {
+					tempne = new GLatLng( lat + latInc, lng + lngInc );
+				}
+				else {
+					tempne = new GLatLng( lat + latInc, (-180 + ((lng + lngInc) - 180)) );
+				}
+				cluster.bounds = new GLatLngBounds( tempsw, tempne );
+				cluster.markers = [];
+				cluster.markerCount = 0;
+				cluster.onMap = false;
+				cluster.marker = null;
+				clusterer.clusters.push( cluster );
+			}
+		}
+	}
 
 	// Put all the unclustered visible markers into a cluster - the first
 	// one it fits in, which favors pre-existing clusters.
