]> dev.renevier.net Git - syp.git/blob - openlayers/examples/zoomLevels.html
do not allow empty passwords
[syp.git] / openlayers / examples / zoomLevels.html
1 <html xmlns="http://www.w3.org/1999/xhtml">
2   <head>
3     <link rel="stylesheet" href="../theme/default/style.css" type="text/css" />
4     <link rel="stylesheet" href="style.css" type="text/css" />
5     <script src="../lib/OpenLayers.js"></script>
6     <script type="text/javascript">
7         var lon = 50;
8         var lat = 0;
9         var zoom = 0;
10         var map, layer;
11
12         function init(){
13             OpenLayers.DOTS_PER_INCH = 72;
14             var options = {
15
16 // various ways of specifying similar things
17 //                          resolutions: [1.40625,0.703125,0.3515625,0.17578125,0.087890625,0.0439453125,0.02197265625,0.010986328125,0.0054931640625,0.00274658203125,0.00137329101],
18 //                          scales: [50000000, 10000000],
19 //                          maxResolution: 0.17578125,
20 //                          minResolution: 0.0439453125,
21 //                          maxScale: 10000000,
22 //                          minScale: 50000000,
23 //                          numZoomLevels: 5,
24 //                          units: "dd",
25                             minResolution: "auto",
26                             minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
27                             maxResolution: "auto",
28                             maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
29                           };
30
31             map = new OpenLayers.Map( 'map' , options);
32
33
34             layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
35                     "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});
36             map.addLayer(layer);
37
38
39             map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
40         }
41
42     </script>
43   </head>
44   <body onload="init()">
45     <h1 id="title">Zoom Level</h1>
46
47     <div id="tags">
48     </div>
49
50     <p id="shortdesc">
51         This example shows the use of the resolutions layer option on a number of layer types.
52     </p>
53
54     <div id="map" class="smallmap"></div>
55
56     <div id="docs">
57         <p>
58             Set the extent of the viewable map using preset levels of scale available
59             to the user via the zoom slider bar. You can set the minimum, maximum
60             scales or resolutions, the number of levels in between and the minimum
61             and maximum geographic extents in your map's units.
62         </p>
63         <p>
64         Default units for Scale are in inches. Resolution is specified in map units
65         per pixel where the default map units are decimal degrees(dd).<br/>
66         scale = resolution * OpenLayers.INCHES_PER_UNIT[units] *
67                     OpenLayers.DOTS_PER_INCH <br/>
68         You can either set the scale or the resolution, there is no need to set both.
69         </p>
70         <p>
71           You can do it with a ...
72         </p>
73     </div>
74
75   </body>
76 </html>