Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…
Cannot retrieve contributors at this time
74 lines (68 sloc) 2.92 KB
<!DOCTYPE html>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes">
<title>OpenLayers: Wrap Date Line</title>
<link rel="stylesheet" href="../theme/default/style.css" type="text/css">
<link rel="stylesheet" href="style.css" type="text/css">
<script src="../lib/OpenLayers.js"></script>
<script type="text/javascript">
var map;
function init(){
map = new OpenLayers.Map( 'map', {maxResolution: 1.40625} );
var mapserv = new OpenLayers.Layer.MapServer( "OpenLayers Basic",
{layers: 'basic'},
{wrapDateLine: true} );
var kamap = new OpenLayers.Layer.KaMap( "Blue Marble NG",
{g: "satellite", map: "world"},
{wrapDateLine: true} );
var wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
{layers: "bathymetry,land_fn,park,drain_fn,drainage," +
transparent: "true", format: "image/png"},
{wrapDateLine: true});
/* WW doesn't quite work yet */
ww = new OpenLayers.Layer.WorldWind( "LANDSAT",
"", 2.25, 4,
{'maxResolution': .28125,
tileSize: new OpenLayers.Size(512, 512),
wrapDateLine: true});
map.addLayers([mapserv, kamap, wms]);
map.addControl(new OpenLayers.Control.LayerSwitcher());
map.addControl(new OpenLayers.Control.MousePosition());
<body onload="init()">
<h1 id="title">Wrapping the Date Line</h1>
<div id="tags">
<p id="shortdesc">Shows how to work around dateline issues, by wrapping the dateline on a number of layer types.</p>
<div id="map" class="smallmap"></div>
<div id="docs">
This is an example that shows wrapping the date line. Wrapping the
date line is an option on the layer.
You can do it with a 'Layer.WMS' or a 'Layer.MapServer' layer.
<pre id="code">
var mapserv = new OpenLayers.Layer.MapServer( "OpenLayers Basic",
{layers: 'basic'},
<b>{wrapDateLine: true}</b> );
Jump to Line
Something went wrong with that request. Please try again.