Map.baseLayers = {
    defaultCentre: [12.4558, 41.9022, 5], // St Peter's
    mapOptions: {
        maxExtent: new OpenLayers.Bounds(6, 36, 19, 48),
        resolutions: [0.02,0.01,0.005,0.0025,0.001,0.0005,0.0002,0.0001,0.00005,0.000025,0.00001]
    },
    get: function() {
        var mapTypes = ['DTM_20M','DTM_20M','DTM_20M','DTM_20M','igm250','igm250','igm100','igm100','igm25','igm25','igm25'];
        var baseUrl = "http://wms.pcn.minambiente.it/cgi-bin/mapserv.exe?map=/ms_ogc/service/";
        var moveTo = function(bounds, zoomChanged, dragging) {
            if (zoomChanged) {
                if (this.name == 'Rasters/Digital terrain') {
                    var mapType = this.mapTypes[this.map.getZoom()];
                    this.setUrl(this.baseUrl+mapType+".map&amp;");
                    this.params.LAYERS = mapType;
                }
            }
            OpenLayers.Layer.Grid.prototype.moveTo.apply(this, arguments);
        }
        var pcn = ' from <a target="_blank" href="http://www.pcn.minambiente.it/PCN/">PCN</a>'
        return [
            new OpenLayers.Layer.WMS( "Rasters/Digital terrain",
                baseUrl+"igm250.map&amp;",
                {layers: 'igm250'},
                { buffer: 0, baseUrl: baseUrl, mapTypes: mapTypes, moveTo: moveTo, attribution: 'Digital terrain and IGM topo maps'+pcn }
            ),
            new OpenLayers.Layer.WMS( "2006 Aerial photos",
                baseUrl+"ortofoto_colore_06.map&amp;",
                { layers: 'ortofoto_colore_06' },
                { scales: [50000, 25000, 12000, 6000, 3000, 1500], buffer: 0, attribution: 'Ortofoto'+pcn}
            ),
            new OpenLayers.Layer.WMS( "2008 Aerial photos",
                baseUrl+"ortofoto_colore_08.map&amp;",
                { layers: 'ortofoto_colore_08' },
                { scales: [50000, 25000, 12000, 6000, 3000, 1500], buffer: 0, attribution: 'Ortofoto'+pcn}
            )
        ]
    }
}
