This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

OSM/Openlayers - wrap dateline

2

How do you wrap the dateline in OpenLayers with OSM data like they do on the main openstreetmap.org map?

I can't seem to get wrapDateLine to work with OpenLayers.Layer.OSM?

Is there another way?

asked 26 Nov '10, 15:51

maw269's gravatar image

maw269
1157714
accept rate: 0%


One Answer:

1

Seems to be "wrapDateLine: true". Maybe you also need the "displayOutsideMaxExtent: true".

Here's the actual code as in the repo :

   var mapnik = new OpenLayers.Layer.OSM.Mapnik(i18n("javascripts.map.base.mapnik"), {
      keyid: "mapnik",
      displayOutsideMaxExtent: true,
      wrapDateLine: true,
      layerCode: "M"
   });

answered 27 Nov '10, 14:39

Harry%20Wood's gravatar image

Harry Wood
9.5k2588128
accept rate: 14%

Source code available on GitHub .