/*
    Document   : lbgm.maplets.mapcomponent
    Created on : 31-Oct-2009, 10:41:29
    Author     : Andreas Hadjigeorgiou
    Description:
        Purpose of the stylesheet follows.
*/
Ext.namespace('lbgm.maplets');

lbgm.maplets.mapcomponent = function(config) {
    Ext.apply(this, config);
    this.contentEl = this.map.div;

    // Set the map container height and width to avoid css
    // bug in standard mode.
    // See https://trac.mapfish.org/trac/mapfish/ticket/85
    var content = Ext.get(this.contentEl);
    content.setStyle('width', '100%');
    content.setStyle('height', '100%');
    content.setStyle('background', '#F2F2F2');

    lbgm.maplets.mapcomponent.superclass.constructor.call(this);
};

Ext.extend(lbgm.maplets.mapcomponent, Ext.Panel, {
    /**
     * APIProperty: map
     * {<OpenLayers.Map>} A reference to the OpenLayers map object.
     */
    map: null,

    initComponent: function() {
        lbgm.maplets.mapcomponent.superclass.initComponent.apply(this, arguments);
        this.on("bodyresize", this.map.updateSize, this.map);
    }
});
Ext.reg('mapcomponent', lbgm.maplets.mapcomponent);

