summaryrefslogtreecommitdiff
path: root/misc/openlayers/tests/manual/overviewmap-projection.html
blob: bb15c9fc35200140c0b6462896ee2fed00599f54 (plain)
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
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <link rel="stylesheet" href="../../theme/default/style.css" type="text/css" />
    <link rel="stylesheet" href="../../examples/style.css" type="text/css" />
    <style type="text/css">
        .olControlAttribution { bottom: 0px!important }
        #map {
            height: 512px;
        }
    </style>

    <script src='http://maps.google.com/maps?file=api&amp;v=2&amp;key=ABQIAAAAjpkAC9ePGem0lIq5XcMiuhR_wWLPFku8Ix9i2SXYRVK3e45q1BQUd_beF8dtzKET_EteAjPdGDwqpQ'></script>

    <script src="../../lib/OpenLayers.js"></script>
    <script type="text/javascript">

        // make map available for easy debugging
        var map;

        function init(){
            var options = {
                projection: new OpenLayers.Projection("EPSG:900913"),
                displayProjection: new OpenLayers.Projection("EPSG:4326"),
                units: "m",
                maxResolution: 156543.0339,
                maxExtent: new OpenLayers.Bounds(-20037508, -20037508,
                                                 20037508, 20037508.34)
            };
            map = new OpenLayers.Map('map', options);

            // create Google Mercator layers
            var gmap = new OpenLayers.Layer.Google(
                "Google Streets",
                {'sphericalMercator': true}
            );
            map.addLayers([gmap]);
            map.addControl(new OpenLayers.Control.LayerSwitcher());
            map.addControl(new OpenLayers.Control.Permalink());
            map.addControl(new OpenLayers.Control.MousePosition());
            var ovmap = new OpenLayers.Control.OverviewMap({
                maxRatio: 16,
                layers: [new OpenLayers.Layer.WMS("OpenLayers WMS", 
                    "http://labs.metacarta.com/wms/vmap0",
                    {layers: 'basic'})]
            });
            map.addControl(ovmap);
            ovmap.maximizeControl();
            if (!map.getCenter()) {map.zoomToMaxExtent()};
        }
    </script>
  </head>
  <body onload="init()">
    <h1 id="title">OpenLayers Overview Map Projection Test</h1>

    <div id="tags">
    </div>
    <p id="shortdesc">
        Acceptance test for different projections in map and overview map.
        The map uses EPSG:900913, the overview map EPSG:4326. Zoom the map and
        drag both the map and the overview map to see it in action.
    </p>
    <div id="map" class="smallmap"></div>

    <div id="docs">
    </div>
  </body>
</html>