File: wrapDateLine.html

package info (click to toggle)
openlayers 2.13.1%2Bds2-6
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 67,180 kB
  • sloc: xml: 7,435; python: 891; sh: 44; makefile: 19
file content (73 lines) | stat: -rw-r--r-- 3,000 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
<!DOCTYPE html>
<html>
  <head>
    <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="openlayers/theme/default/style.css" type="text/css">
    <link rel="stylesheet" href="style.css" type="text/css">
    <script src="openlayers/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",
                        "http://vmap0.tiles.osgeo.org/wms/vmap0",
                        {layers: 'basic'},
                        {wrapDateLine: true} );

            var kamap = new OpenLayers.Layer.KaMap( "Blue Marble NG",
                        "http://www.openlayers.org/world/index.php",
                        {g: "satellite", map: "world"},
                        {wrapDateLine: true} );

            var wms = new OpenLayers.Layer.WMS( "DM Solutions Demo",
                "http://www2.dmsolutions.ca/cgi-bin/mswms_gmap",
                {layers: "bathymetry,land_fn,park,drain_fn,drainage," +
                         "prov_bound,fedlimit,rail,road,popplace",
                 transparent: "true", format: "image/png"},
                {wrapDateLine: true});

            /* WW doesn't quite work yet */
            ww = new OpenLayers.Layer.WorldWind( "LANDSAT",
                    "http://worldwind25.arc.nasa.gov/tile/tile.aspx", 2.25, 4,
                    {T:"105"},
                    {'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());
            map.zoomToMaxExtent();
        }
    </script>
  </head>
  <body onload="init()">
    <h1 id="title">Wrapping the Date Line</h1>
    <div id="tags">
        WMS,
        MapServer,
        wrapDateLine
    </div>

    <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">
        <p>
        This is an example that shows wrapping the date line. Wrapping the
        date line is an option on the layer.
        </p>
        <p>
          You can do it with a 'Layer.WMS' or a 'Layer.MapServer' layer.
        </p>
    <pre id="code">
    var mapserv = new OpenLayers.Layer.MapServer( "OpenLayers Basic",
                "http://vmap0.tiles.osgeo.org/wms/vmap0",
                {layers: 'basic'},
                <b>{wrapDateLine: true}</b> );
    </pre>
    </div>
  </body>
</html>