AWP.Layer.Google = OpenLayers.Class(OpenLayers.Layer.Google, {
	layerId: '',
	title: 'Untitled Layer',
	category: '',
	/**
	 * For tree
	 */
	text: '',
	icon: '',
	radio: true,
	checked: false,

	type: null,
 	sphericalMercator: true,
	
	clone: function () {
        var obj = new OpenLayers.Layer.Google(this.name, this.options);
        // catch any randomly tagged-on properties
        OpenLayers.Util.applyDefaults(obj, this);
        // a cloned layer should never have its map property set
        //  because it has not been added to a map yet. 
        obj.map = null;
        return obj;
    },
    initialize: function(config) {
		config = config || {};
		
		this.layerId = config.layerId || '';
		this.category = config.category || '';
		this.text = config.name || this.layerId || 'Untitled layer';
		this.icon = config.icon || 'http://www.google.com/favicon.ico';
		
		if (config.radio === false) this.radio = false;
		if (config.checked === true) this.checked = true;
		if (config.type) this.type = config.type;
		
		var options = {
			type: this.type,
			sphericalMercator: this.sphericalMercator
		};
		OpenLayers.Layer.Google.prototype.initialize.apply(this, [this.text, options]);
		
		AWP.Layer.array.push(this);
		AWP.Layer.items[this.layerId] = this;
    },    
    CLASS_NAME: "AWP.Layer.Google"
});
