The following example will limit the panning of the map to predefined bounds, if that is what you intend doing:
// Bounds for North America
var allowedBounds = new GLatLngBounds(new GLatLng(48.19, -127.52),
new GLatLng(28.72, -68.81));
function checkBounds() {
if (allowedBounds.contains(map.getCenter())) {
return;
}
var c = map.getCenter();
var x = c.lng();
var y = c.lat();
var maxX = allowedBounds.getNorthEast().lng();
var maxY = allowedBounds.getNorthEast().lat();
var minX = allowedBounds.getSouthWest().lng();
var minY = allowedBounds.getSouthWest().lat();
if (x < minX) { x = minX; }
if (x > maxX) { x = maxX; }
if (y < minY) { y = minY; }
if (y > maxY) { y = maxY; }
map.setCenter(new GLatLng(y, x));
}
GEvent.addListener(map, "move", function() { checkBounds(); });