1 | <!DOCTYPE html> |
---|
2 | <html> |
---|
3 | <head> |
---|
4 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
---|
5 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0"> |
---|
6 | <meta name="apple-mobile-web-app-capable" content="yes"> |
---|
7 | <title>OpenLayers: Wrap Date Line</title> |
---|
8 | <link rel="stylesheet" href="../theme/default/style.css" type="text/css"> |
---|
9 | <link rel="stylesheet" href="style.css" type="text/css"> |
---|
10 | <script src="../lib/OpenLayers.js"></script> |
---|
11 | <script type="text/javascript"> |
---|
12 | var map; |
---|
13 | function init(){ |
---|
14 | map = new OpenLayers.Map( 'map', {maxResolution: 1.40625} ); |
---|
15 | var mapserv = new OpenLayers.Layer.MapServer( "OpenLayers Basic", |
---|
16 | "http://vmap0.tiles.osgeo.org/wms/vmap0", |
---|
17 | {layers: 'basic'}, |
---|
18 | {wrapDateLine: true} ); |
---|
19 | |
---|
20 | var kamap = new OpenLayers.Layer.KaMap( "Blue Marble NG", |
---|
21 | "http://www.openlayers.org/world/index.php", |
---|
22 | {g: "satellite", map: "world"}, |
---|
23 | {wrapDateLine: true} ); |
---|
24 | |
---|
25 | var wms = new OpenLayers.Layer.WMS( "DM Solutions Demo", |
---|
26 | "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap", |
---|
27 | {layers: "bathymetry,land_fn,park,drain_fn,drainage," + |
---|
28 | "prov_bound,fedlimit,rail,road,popplace", |
---|
29 | transparent: "true", format: "image/png"}, |
---|
30 | {wrapDateLine: true}); |
---|
31 | |
---|
32 | /* WW doesn't quite work yet */ |
---|
33 | ww = new OpenLayers.Layer.WorldWind( "LANDSAT", |
---|
34 | "http://worldwind25.arc.nasa.gov/tile/tile.aspx", 2.25, 4, |
---|
35 | {T:"105"}, |
---|
36 | {'maxResolution': .28125, |
---|
37 | tileSize: new OpenLayers.Size(512, 512), |
---|
38 | wrapDateLine: true}); |
---|
39 | |
---|
40 | map.addLayers([mapserv, kamap, wms]); |
---|
41 | map.addControl(new OpenLayers.Control.LayerSwitcher()); |
---|
42 | map.addControl(new OpenLayers.Control.MousePosition()); |
---|
43 | map.zoomToMaxExtent(); |
---|
44 | } |
---|
45 | </script> |
---|
46 | </head> |
---|
47 | <body onload="init()"> |
---|
48 | <h1 id="title">Wrapping the Date Line</h1> |
---|
49 | <div id="tags"> |
---|
50 | WMS, |
---|
51 | MapServer, |
---|
52 | wrapDateLine |
---|
53 | </div> |
---|
54 | |
---|
55 | <p id="shortdesc">Shows how to work around dateline issues, by wrapping the dateline on a number of layer types.</p> |
---|
56 | <div id="map" class="smallmap"></div> |
---|
57 | <div id="docs"> |
---|
58 | <p> |
---|
59 | This is an example that shows wrapping the date line. Wrapping the |
---|
60 | date line is an option on the layer. |
---|
61 | </p> |
---|
62 | <p> |
---|
63 | You can do it with a 'Layer.WMS' or a 'Layer.MapServer' layer. |
---|
64 | </p> |
---|
65 | <pre id="code"> |
---|
66 | var mapserv = new OpenLayers.Layer.MapServer( "OpenLayers Basic", |
---|
67 | "http://vmap0.tiles.osgeo.org/wms/vmap0", |
---|
68 | {layers: 'basic'}, |
---|
69 | <b>{wrapDateLine: true}</b> ); |
---|
70 | </pre> |
---|
71 | </div> |
---|
72 | </body> |
---|
73 | </html> |
---|