<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
        <meta http-equiv="Content-Language" content="es"/>
        <meta name="description" content="ZEPA en la Region de Murcia. Direccion General de Patrimonio Natural y Biodiversidad. Consejeria de Agricultura y Agua." />
        <meta name="keywords" content="ZEPA, Murcia, Aves, Biodiversidad, Agricultura" />
    <title>Geovisor - ZEPA ES0000173 (Parque Regional de Sierra Espuña)</title>
        <link href="zepa/google/css/base.css" type="text/css" rel="stylesheet"></link>
    <script src="openlayers-2.8/OpenLayers.js"></script>

        <style type="text/css">
        #map {
            width: 100%;
            height: 100%;
            border: 1px solid black;
        }
        .olPopup p { margin:0px; }
                a img{
                        border:0;
                }
    </style>
        <style type='text/css'>
                .olControlNavToolbar div {
                        top: 200px;
                }
        </style>  
        
    <script type="text/javascript">
        var lon = 627450.933819;
        var lat = 4192143.79093;
        var zoom = 3;
        var map, ortofoto;
                
        function init(){
                        
                        var options = {
                        //maxExtent: new OpenLayers.Bounds(617318.212500,4184035.317700,636413.646600,4200609.996100),
                        //Extensión de la imagen NATMUR08
                        //maxExtent: new OpenLayers.Bounds(-2.361258105,37.33777847,-0.608435375,38.78491152)
                        //Extensión de la ZEPA de Sierra Espuña + aprox. 1 minuto.
                        maxExtent: new OpenLayers.Bounds(-1.676282,37.804626,-1.458695,37.953379),
                        units: 'd',
                        projection: new OpenLayers.Projection("EPSG:4326"),
                        displayprojection: new OpenLayers.Projection("EPSG:25830"),
                        numZoomLevels: 10,
                        maxResolution: 0.00084994921875
                        //Resolución max de la imagen en metros
                        //maxResolution: 590.7410156
                        }; 

                        OpenLayers.Control.CustomNavToolbar = OpenLayers.Class(OpenLayers.Control.Panel, {
                                initialize: function(options) {
                                        OpenLayers.Control.Panel.prototype.initialize.apply(this, [options]);
                                    this.addControls([
                                                new OpenLayers.Control.Navigation(),
                                                new OpenLayers.Control.ZoomBox({alwaysZoom:true})
                                        ]);
                                        this.displayClass = 'olControlNavToolbar'
                                },
                                draw: function() {
                                        var div = OpenLayers.Control.Panel.prototype.draw.apply(this, arguments);
                                        this.activateControl(this.controls[0]);
                                        return div;
                                }
                        });
                                
            map = new OpenLayers.Map('map', options);

                        ortofoto = new OpenLayers.Layer.WMS( "Orto_alex Cacheado", "http://147.84.162.149/tilecache/tilecache.cgi?",
                        {layers: 'ES0000173',
                        format: 'image/png',
                        resolutions: [0.00084994921875],
                        serverResolutions: [0.00084994921875]}
                        );
                        map.addLayer (ortofoto);
                        
                        map.addLayer(new OpenLayers.Layer.GML("KML", "http://147.84.162.149/zepa/google/kml/ES0000173.kml",
                        {
                        format: OpenLayers.Format.KML,
                        formatOptions: {
                        extractStyles: true,
                        maxDepth: 2,
                        extractAttributes: true
                        }
                        }));

/*                        
                        ortofoto = new OpenLayers.Layer.WMS( "Orto",
                    "http://localhost/cgi-bin/mapserv.exe?map=C:/ms4w/datos/prueba_raster.map&", {layers: 'ortofoto', transparent: true}, {isBaseLayer: true} );
            
                        natmur08 = new OpenLayers.Layer.WMS( "Natmur08",
                    "http://meristemum.carm.es/cgi-bin/wmsimg_2008NATMUR?", {layers: 'Ortoimagen_NATMUR08'} );
         
                        map.addLayer(natmur08);*/

            map.setCenter(new OpenLayers.LonLat(lon, lat), zoom);
            map.addControl( new OpenLayers.Control.LayerSwitcher() );
                        
                        var panel = new OpenLayers.Control.CustomNavToolbar();
                map.addControl(panel);                        
        selectControl = new OpenLayers.Control.SelectFeature(map.layers[1],
                {onSelect: onFeatureSelect, onUnselect: onFeatureUnselect});
  
            map.addControl(selectControl);
            selectControl.activate();   
            map.zoomToMaxExtent();
        }
                
                
        function onPopupClose(evt) {
            selectControl.unselect(selectedFeature);
        }
                
                
        function onFeatureSelect(feature) {
            selectedFeature = feature;
            popup = new OpenLayers.Popup.FramedCloud("chicken", 
                                     feature.geometry.getBounds().getCenterLonLat(),
                                     new OpenLayers.Size(100,100),
                                     "<div style='font-size:.8em'>"+feature.attributes.description+"</div>",
                                     null, true, onPopupClose);
            feature.popup = popup;
            map.addPopup(popup);
        }
        function onFeatureUnselect(feature) {
            map.removePopup(feature.popup);
            feature.popup.destroy();
            feature.popup = null;
        }
    </script>
  </head>
 <body onload="init()">
        <div id="north">
                <div id="logo-catalogo"><img src="zepa/google/img/encabezado_izq.jpg" height="26px" width="251px" alt="logo cat&aacute;logo de geoservicios" /></div>
                <div id="logo-carm"><img src="zepa/google/img/encabezado_der.jpg" height="26px" width="140px" alt="escudo carm" /></div>
                <span>ZEPA ES0000173 (Parque Regional de Sierra Espuña)</span>
        </div>
  
        <div id="map" style="width: 100%; height:800px"></div>
        </body>
</html>