1 <html xmlns="http://www.w3.org/1999/xhtml">
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">
13 OpenLayers.DOTS_PER_INCH = 72;
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,
25 minResolution: "auto",
26 minExtent: new OpenLayers.Bounds(-1, -1, 1, 1),
27 maxResolution: "auto",
28 maxExtent: new OpenLayers.Bounds(-180, -90, 180, 90)
31 map = new OpenLayers.Map( 'map' , options);
34 layer = new OpenLayers.Layer.WMS( "OpenLayers WMS",
35 "http://labs.metacarta.com/wms/vmap0", {layers: 'basic'});
39 map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
44 <body onload="init()">
45 <h1 id="title">Zoom Level</h1>
51 This example shows the use of the resolutions layer option on a number of layer types.
54 <div id="map" class="smallmap"></div>
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.
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.
71 You can do it with a ...