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 | <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>OpenLayers: Single Tile</title> <link rel="stylesheet" href="../theme/default/style.css" type="text/css" /> <link rel="stylesheet" href="style.css" type="text/css" /> <script src="../lib/OpenLayers.js"></script> <script type="text/javascript"> var map; function init(){ map = new OpenLayers.Map('mapDiv', {maxResolution: 'auto'}); var old_ol_wms = new OpenLayers.Layer.WMS.Untiled( "WMS.Untiled", "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'} ); old_ol_wms.addOptions({isBaseLayer: true}); var new_ol_wms = new OpenLayers.Layer.WMS( "WMS w/singleTile", "http://labs.metacarta.com/wms/vmap0?", {layers: 'basic'}, { singleTile: true, ratio: 1 } ); new_ol_wms.addOptions({isBaseLayer: true}); map.addLayers([old_ol_wms, new_ol_wms]); map.addControl(new OpenLayers.Control.LayerSwitcher()); map.setCenter(new OpenLayers.LonLat(6.5, 40.5), 4); } </script> </head> <body onload="init()"> <h1 id="title">Untiled Example</h1> <p id="shortdesc"> Create an untiled WMS layer using the singleTile: true, option or the deprecated WMS.Untiled layer. </p> <div id="mapDiv" class="smallmap"></div> <p> The first layer is an old OpenLayers.Layer.WMS.Untiled layer, using a default ratio value of 1.5. <p> The second layer is an OpenLayers.Layer.WMS layer with singleTile set to true, and with a ratio of 1. </body> </html> |