I've made some minor changes to your code. In fact I've added a few properties to your layer:
var skoLayer = new OpenLayers.Layer.XYZ("skobbler",
["${z}/${x}/${y}.png?api_key=<Your Key Here>"],
{numZoomLevels: 18,
sphericalMercator: true,
isBaseLayer: true,
wrapDateLine: true,
maxExtent: new OpenLayers.Bounds(-180, -180, 180, 120),
attribution: attrib
});
Some explanations:
wrapDateLine
repeats the maps horizontally but only ifthe layer
isBaseLayer
the
120
value in themaxExtent
is not choosed arbitrary, but for centering the map, focusing like in your example. It seems that usingwrapDateLine: true
overridessetCenter
. If you need another center you must to adjust all the values by attempts.
And here's the whole code for you, to easily test it. Just unzip the archive (tested for viruses), extract the scrobbler.html file and double click it.
Just zoom out and move the map, as you like.