### Eclipse Workspace Patch 1.0
#P geoserver-src
Index: wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapXmlReader.java
===================================================================
RCS file: /usr/cvsgbdso/maven/geoserver-src/wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapXmlReader.java,v
retrieving revision 1.2
diff -u -r1.2 GetMapXmlReader.java
--- wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapXmlReader.java	31 Oct 2007 09:55:53 -0000	1.2
+++ wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapXmlReader.java	12 Nov 2007 09:15:25 -0000
@@ -34,6 +34,7 @@
 import org.vfny.geoserver.Request;
 import org.vfny.geoserver.global.MapLayerInfo;
 import org.vfny.geoserver.global.TemporaryFeatureTypeInfo;
+import org.vfny.geoserver.global.WMS;
 import org.vfny.geoserver.util.GETMAPValidator;
 import org.vfny.geoserver.util.SLDValidator;
 import org.vfny.geoserver.util.requests.readers.XmlRequestReader;
@@ -56,6 +57,7 @@
 import java.util.ArrayList;
 import java.util.Enumeration;
 import java.util.HashMap;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Level;
@@ -323,6 +325,7 @@
                 throw new WmsException("A UserLayer without layer name was passed");
             }
 
+        	boolean isBaseMap = false;
             // TODO: add support for remote WFS here
             //handle the InLineFeature stuff
             if ((sl instanceof UserLayer)
@@ -332,13 +335,34 @@
                 GetMapKvpReader.initializeInlineFeatureLayer(getMapRequest, ul, currLayer);
             } else {
                 try {
-                    currLayer.setFeature(GetMapKvpReader.findFeatureLayer(getMapRequest, layerName));
+            		WMS wms = getMapRequest.getWMS();
+            		if (wms.getBaseMapLayers() != null) {
+           				String layerGroup = (String) wms.getBaseMapLayers().get(layerName);
+           				if (layerGroup != null) {
+           					isBaseMap = true;
+           					List layerGroupExpanded = GetMapKvpReader.getBaseMapAsList(layerGroup);
+           					for (Iterator it = layerGroupExpanded.iterator(); it.hasNext();) {
+           						layerName = (String) it.next();
+           			            currLayer = new MapLayerInfo();
+           	                    currLayer.setFeature(GetMapKvpReader.findFeatureLayer(getMapRequest, layerName));
+           	                    GetMapKvpReader.addStyles(getMapRequest, currLayer, styledLayers[i], layers, styles);
+           					}
+            			}
+                		else {                	
+                			currLayer.setFeature(GetMapKvpReader.findFeatureLayer(getMapRequest, layerName));
+                		}
+            		}
+            		else {                	
+            			currLayer.setFeature(GetMapKvpReader.findFeatureLayer(getMapRequest, layerName));
+            		}
                 } catch (Exception e) {
                     currLayer.setCoverage(GetMapKvpReader.findCoverageLayer(getMapRequest, layerName));
                 }
             }
-
-            GetMapKvpReader.addStyles(getMapRequest, currLayer, styledLayers[i], layers, styles);
+            
+            if (!isBaseMap) {
+            	GetMapKvpReader.addStyles(getMapRequest, currLayer, styledLayers[i], layers, styles);
+            }
         }
 
         getMapRequest.setLayers((MapLayerInfo[]) layers.toArray(new MapLayerInfo[layers.size()]));
Index: wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapKvpReader.java
===================================================================
RCS file: /usr/cvsgbdso/maven/geoserver-src/wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapKvpReader.java,v
retrieving revision 1.3
diff -u -r1.3 GetMapKvpReader.java
--- wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapKvpReader.java	8 Nov 2007 16:12:15 -0000	1.3
+++ wms/src/main/java/org/vfny/geoserver/wms/requests/GetMapKvpReader.java	12 Nov 2007 09:15:25 -0000
@@ -1497,6 +1497,10 @@
 		return style;
 	}
 
+    public static List getBaseMapAsList(String layerGroup) {
+		return readFlat(layerGroup, INNER_DELIMETER);
+    }
+	
 	/**
 	 * Parses the requested layers given by the LAYERS request parameter and
 	 * looks up their corresponding FeatureTypeInfo objects in the server.
@@ -1521,8 +1525,7 @@
 				String layerGroup = (String) wms.getBaseMapLayers().get(
 						layerNames.get(i));
 				if (layerGroup != null) {
-					List layerGroupExpanded = readFlat(layerGroup,
-							INNER_DELIMETER);
+					List layerGroupExpanded = getBaseMapAsList(layerGroup);
 					layerNames.remove(i);
 					layerNames.addAll(i, layerGroupExpanded);
 				}
