Latitude:
On a Mercator projection, the maximum north latitude is not 90, but something around 85.05113. In JavaScript you can do:
Math.atan(Math.sinh(Math.PI)) * 180 / Math.PI;
This way you can find the real north and south edges of the projection.
Longitude:
What's the difference between a longitude of -180 and 180? None.
You can still identify all 4 quarters of the projection:
var maxLat = Math.atan(Math.sinh(Math.PI)) * 180 / Math.PI;
var center = new google.maps.LatLng(0, 0);
var sw = new google.maps.LatLng(-maxLat, 180);
var ne = new google.maps.LatLng(maxLat, -180);
// Southwest part of the world
new google.maps.LatLngBounds(sw, center);
// Southeast part of the world
new google.maps.LatLngBounds(center, sw);
And so on.
JSFiddle demo
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…