/* 
 * Copyright (C) 2012 B3Partners B.V.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

/**
 * OpenLayers Overview component
 * Creates a Overview component for OpenLayers
 * @author <a href="mailto:meinetoonen@b3partners.nl">Meine Toonen</a>
 */
Ext.define ("viewer.viewercontroller.openlayers.components.OpenLayersOverview",{
    extend: "viewer.viewercontroller.openlayers.OpenLayersComponent",    
    config:{
        top:null,
        left:null,
        url:null,
        layers:null,
        position:null
    },
    
    constructor: function (conf){        
        viewer.viewercontroller.openlayers.components.OpenLayersOverview.superclass.constructor.call(this, conf);
        var layer =  new OpenLayers.Layer.WMS(
            "OverviewLaag", 
            this.url,
            {layers: this.layers}); 
        var maxExtent =this.viewerController.mapComponent.getMap().frameworkMap.maxExtent;
        this.frameworkObject = new OpenLayers.Control.OverviewMap({
            maximized: true,
            mapOptions: {
                maxExtent: maxExtent,
                projection: "EPSG:28992"
            },
            layers: [layer]
        });
        
        return this;
    },
    
    getExtComponents: function() {
        return [];
    }
});



@@ -1113,16 +1113,141 @@
 ion:null
+,%0A        height: 300,%0A        width: 300,%0A        lox: null,%0A        loy: null,%0A        rbx: null,%0A        rby: null        
 %0A    %7D,%0A
@@ -1419,134 +1419,447 @@
     
-var layer =  new OpenLayers.Layer.WMS(%0A            %22OverviewLaag%22, %0A            this.url,
+%0A        var maxBounds =this.viewerController.mapComponent.getMap().frameworkMap.maxExtent;%0A        var bounds;%0A        if (this.getLox()!=null && this.getLoy()!=null && this.getRbx()!=null && this.getRby()!=null)%7B%0A            bounds = new OpenLayers.Bounds(this.getLox(),this.getLoy(),this.getRbx(),this.getRby());%0A        %7Delse%7B%0A            bounds= maxBounds;
 %0A     
+   %7D%0A
        
-%7Blayers: this.layers%7D
+ var size=new OpenLayers.Size(%22%22+this.height,%22%22+this.width
 );
- 
 %0A   
@@ -1871,86 +1871,152 @@
 var 
-maxExtent =this.viewerController.mapComponent.getMap().frameworkMap.maxExtent;
+layer =  new OpenLayers.Layer.Image(%0A            %22OverviewLaag%22, %0A            this.url,%0A            bounds,%0A            size%0A        );%0A        
 %0A   
@@ -2165,22 +2165,22 @@
 ent: max
-Extent
+Bounds
 ,%0A      
@@ -2225,24 +2225,48 @@
          %7D,%0A
+            size: size,%0A
             
@@ -2389,16 +2389,1066 @@
 urn %5B%5D;%0A
+    %7D,%0A    %0A    //setters for bounds, make sure it are numbers%0A    setLox: function (value)%7B%0A        if (isNaN(value))%7B%0A            this.lox=null;%0A            return;%0A        %7D%0A        this.lox = Number(value);%0A    %7D,%0A    setLoy: function (value)%7B%0A        if (isNaN(value))%7B%0A            this.loy=null;%0A            return;%0A        %7D%0A        this.loy = Number(value);%0A    %7D,%0A    setRbx: function (value)%7B%0A        if (isNaN(value))%7B%0A            this.rbx=null;%0A            return;%0A        %7D%0A        this.rbx = Number(value);%0A    %7D,%0A    setRby: function (value)%7B%0A        if (isNaN(value))%7B%0A            this.rby=null;%0A            return;%0A        %7D%0A        this.rby = Number(value);%0A    %7D,%0A    //make sure the heigth and width are numbers%0A    setHeight: function (value)%7B%0A        if (isNaN(value))%7B%0A            this.height=null;%0A            return;%0A        %7D%0A        this.height = Number(value);%0A    %7D,%0A    setWidth: function (value)%7B%0A        if (isNaN(value))%7B%0A            this.width=null;%0A            return;%0A        %7D%0A        this.width = Number(value);%0A
     %7D%0A%7D)

Implement settings for overview in OL