+ private static void groupStylesAndLayers(Set<Distribution> distributions,\r
+ Map<String, Map<Integer, Set<Distribution>>> layerMap,\r
+ List<PresenceAbsenceTermBase<?>> statusList) {\r
+ //iterate through distributions and group styles and layers\r
+ //and collect necessary information\r
+ for (Distribution distribution:distributions){\r
+ //collect status\r
+ PresenceAbsenceTermBase<?> status = distribution.getStatus();\r
+ if(status == null){\r
+ status = defaultStatus;\r
+ }\r
+ if (! statusList.contains(status)){\r
+ statusList.add(status);\r
+ }\r
+ //group by layers and styles\r
+ NamedArea area = distribution.getArea();\r
+ if (area != null){\r
+ String geoLayerString = getWMSLayerName(area);\r
+ if(geoLayerString != null){\r
+ Map<Integer, Set<Distribution>> styleMap = layerMap.get(geoLayerString);\r
+ if (styleMap == null){\r
+ styleMap = new HashMap<Integer, Set<Distribution>>();\r
+ layerMap.put(geoLayerString, styleMap);\r
+ }\r
+ addDistributionToMap(distribution, styleMap, statusList);\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ private static String compileMapSizeParameterValue(int width, int height) {\r