[GIS] How to stop the map at just one world/globe

google mapsopenlayers-2postgis

I am working on a project to put google maps layer and adding our data layers on top of it. using openlayers and google maps layer with out layer of top of it

now the google layer has max resolution of 156543.0339 and 22 zoom levels, I can limit the zoom levels and max resolution etc but how do I stop the map at just one world/globe

i.e. I don't want it to scrolling off to another wrapped around world!

enter image description here

Please see this fiddle for example, http://jsfiddle.net/eaJHn/5

Anyone !!! ?

Best Answer

OpenLayers.Layer.Google (which I assume you are using) has the property "wrapDateLine" set to true. This should be set to false, and as the source says you should also set sphericalMercator to true.

So, something like:

var layer = new OpenLayer.Layer.Google("Google", {
    wrapDateLine: false,
    sphericalMercator: true
});
Related Question