<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>GISCO OpenLayers WMS</title>

        <link rel="stylesheet" href="http://openlayers.org/dev/theme/default/style.css" type="text/css" />
        <link rel="stylesheet" href="style.css" type="text/css" />



        <!--set up size of map on screen-100% of width, 400 pixels in height-->
        <style type="text/css">
            #controls
            {
                width: 100%;
                height: 400px;
            }
        </style>


       <!--Get Open Layers JavaScript library-->
       <script src="http://openlayers.org/dev/OpenLayers.js" type='text/javascript'></script>



        <script type="text/javascript">


            <!--When loading tiles from 3rd party, good to have re-tries for tiles not delivered on first request-->
            OpenLayers.IMAGE_RELOAD_ATTEMPTS = 3;
            OpenLayers.Util.onImageLoadErrorColor = "transparent";

            <!--Creates variable that will be the map object-->
            var map;

            <!--Creates variables to designate initial view of map-->
            var lon = -105;
            var lat = 39.71;
            var zoom = 5;


            <!--Initial function that fires when page is loaded-->

            function init(){

                <!--create OpenLayers map object-->
                map = new OpenLayers.Map( 'map' );


                <!--SET UP BASEMAP LAYERS-->


                    <!--State Outlines from the BLM-->
                    var blm_states = new OpenLayers.Layer.WMS("BLM States",
                        "http://www.geocommunicator.gov:80/wmsconnector/com.esri.wms.Esrimap/BLM_MAP_BASEMAPS",
                        {layers: "States", reaspect: "false"},{singleTile: true, ratio: 1, isBaseLayer: true});

                    <!--***NOTE the 'singleTile' parameter:  layers with labels will often have distracting-->
                    <!--   duplicate labeling when streamed normally as tiles-->



                    <!--USGS Topos-->
                    var usgs_topo = new OpenLayers.Layer.WMS( "USGS Topos",
                        "http://terraservice.net/ogcmap.ashx?",
                        {layers: 'DRG'},{isBaseLayer: true} );



                <!--SET UP OVERLAY LAYERS-->

                    var blm_lease = new OpenLayers.Layer.WMS("Producing O&amp;G Leases",
                        "http://www.geocommunicator.gov:80/wmsconnector/com.esri.wms.Esrimap/BLM_MAP_OIL_AND_GAS",
                        {layers: "Oil and Gas Leases Producing", reaspect: "false", transparent: "true"},{isBaseLayer: false,visibility:false});

                    <!--***NOTE the 'reaspect' parameter set to false for BLM layers.  For WMS services emanating from ArcIMS,-->
                    <!--   this parameter often needs to be included for layers to overlay correctly in non-ESRI viewers-->



                    var sale_lease = new OpenLayers.Layer.WMS("O&amp;G Lease Sales",
                        "http://www.geocommunicator.gov:80/wmsconnector/com.esri.wms.Esrimap/BLM_MAP_OIL_AND_GAS",
                        {layers: "Lease Sale Parcels", reaspect: "false", transparent: "true"}, {isBaseLayer: false, visibility:false});

                    var blm_land = new OpenLayers.Layer.WMS("BLM Land",
                        "http://www.geocommunicator.gov:80/wmsconnector/com.esri.wms.Esrimap/BLM_MAP_SURFACE_MGT_AGY",
                        {layers: "BLM Lands Dissolved,BLM Lands", reaspect: "false",transparent: "true"}, {isBaseLayer: false, visibility:false});
                    <!--***NOTE we are requesting multiple layers from the same WMS service.  For large datasets, there will often be-->
                    <!--   an 'overview' layer at zoomed-out scales with a more detailed layer closer in so as to improve performance-->


                    var nf_land = new OpenLayers.Layer.WMS("National Forests",
                        "http://www.geocommunicator.gov:80/wmsconnector/com.esri.wms.Esrimap/BLM_MAP_SURFACE_MGT_AGY",
                        {layers: "National Forest Labels,National Forests Dissolved,National Forests", reaspect: "false",transparent: "true"}, {isBaseLayer: false, singleTile: true, ratio: 1, visibility:false});
                    <!--***NOTE the 'singleTile' parameter:  layers with labels will often have distracting-->
                    <!--   duplicate labeling when streamed normally as tiles-->


                    <!--Pulling a Census Block Group layer from the new DRCOG WMS Service-->
                    var drcog_blk = new OpenLayers.Layer.WMS("DRCOG Census Blk Grps",
                        "http://gis.drcog.org/geoserver/wms?",
                        {layers: "bg2000", transparent: "true"}, {visibility:false, isBaseLayer: false});




                <!--Add layers to the map object-->
                map.addLayers([blm_states,usgs_topo,blm_land,nf_land,blm_lease,sale_lease,drcog_blk]);
                <!--***NOTE:  the order in which they are added determines their order in the layer switcher menu-->

                <!--Add layer switcher menu (with custom color)-->
                var ls = new OpenLayers.Control.LayerSwitcher({'div':OpenLayers.Util.getElement('layerswitcher'),activeColor:'#660066'})
                map.addControl(ls);


                <!--Add lat/long read-out to the menu-->
                map.addControl( new OpenLayers.Control.MousePosition() );

                <!--Add zoom and pan controls to map-->
                var panel = new OpenLayers.Control.NavToolbar();
                map.addControl(panel);


                <!--Have the layer menu already expanded when page is loaded-->
                ls.maximizeControl();

                <!--Set the initial view of map using variables defined above-->
                map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);

                }


                <!--END OF OPEN LAYERS JavaScript-->

        </script>

    </head>

    <!--HTML-->

    <body onload="init()">
        <p style="font-family:verdana;font-size:10pt">
            <b>Rockin' WMS With OpenLayers</b>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <a href="source.html" target="_blank">View Source Code</a>
        </p>

        <hr>
        <br>

       <!--LOAD MAP INTO A DIV-->
       <div id="controls">
            <div id="map" class="smallmap"></div>
       </div>


    </body>
</html>