/**
 * @requires OpenLayers/Layer/WMS.js
 */

OpenLayers.Layer.WMS.KKGEO = OpenLayers.Class(OpenLayers.Layer.WMS, {

    /**
     * Constructor: OpenLayers.Layer.WMS.KKGEO
     *
     * Parameters:
     * name - {String} 
     * url - {String} 
     * params - {Object} 
     * options - {Object} 
     */
    initialize: function(name, url, params, options) {
        OpenLayers.Layer.WMS.prototype.initialize.apply(this, arguments);
    },

    /** 
     * APIMethod: getFullRequestString
     * Combine the layer's url with its params and these newParams. 
     *
     * Use SRS parameter from layer if defined, else use map projection.
     * Use this to mix different EPSG codes for identical SRS.
     *
     * Parameters:
     * newParams - {Object}
     * altUrl - {String} Use this as the url instead of the layer's url
     *
     * Returns:
     * {String}
     */
    getFullRequestString:function(newParams, altUrl) {
        if (this.params.SRS == null) {
          var projectionCode = this.map.getProjection();
          this.params.SRS = (projectionCode == "none") ? null : projectionCode;
        }

        return OpenLayers.Layer.Grid.prototype.getFullRequestString.apply(
                                                    this, arguments);
    },

    CLASS_NAME: "OpenLayers.Layer.WMS.KKGEO"
});

