[OpenLayers-Users] Avoid world repeat with a Google map layer

Guillaume progmls at googlemail.com
Thu Apr 10 06:25:51 EDT 2008


Hello,

I am trying to display a map, with a Google map base layer. A requirement is to see the whole world, but only once: even at the lowest zoom level, the world must not be repeated.

My map div is 700px wide, and the size of the world displayed is a bit smaller, so it is displayed again on each side of the map.

So the question is: is it possible to display the world only once at the lowest zoom level, so as the antimeridian line touches the border of the map on each side, without resizing the map div?

The map I currently have is at http://beta.gogeo.ac.uk/cgi-bin/intl.cgi if it helps.


The options I used to do this are:
layer = new OpenLayers.Layer.Google("Google Normal", { 'type': G_NORMAL_MAP,
						       'sphericalMercator': true,
							MIN_ZOOM_LEVEL: 1 });

and the parameters of the map are:

maxResolution : 156543.0339,
projection : new OpenLayers.Projection("EPSG:900913"),
units : 'm',
maxExtent : worldExtent,
restrictedExtent : worldExtent,
wrapDateLine : true, //not sure where this one come from...

with worldExtent being (-180,-90,180,90) transformed to Projection("EPSG:4326").

All of this with OL 2.6RC1.

Thanks for any hint,

Guillaume



More information about the Users mailing list