}
}
public Map<String, String> getWMSRequestTemplate(MimeType responseFormat, RequestType reqType) {
Map<String, String> params = new HashMap<String, String>();
FormatModifier mod = getFormatModifier(responseFormat);
params.put("SERVICE", "WMS");
String request;
if (reqType == RequestType.MAP) {
request = "GetMap";
} else { // if(reqType == RequestType.FEATUREINFO) {
request = "GetFeatureInfo";
}
params.put("REQUEST", request);
String version = wmsVersion;
if (wmsVersion == null) {
version = "1.1.1";
}
params.put("VERSION", version);
String layers;
if (this.wmsLayers != null && this.wmsLayers.length() != 0) {
layers = wmsLayers;
} else {
layers = getName();
}
params.put("LAYERS", layers);
if (reqType == RequestType.FEATUREINFO) {
params.put("QUERY_LAYERS", wmsQueryLayers != null ? wmsQueryLayers : layers);
}
String exceptions;
if (errorMime != null) {
exceptions = errorMime;
} else {
exceptions = XMLMime.ogcxml.getMimeType();
}
params.put("EXCEPTIONS", exceptions);
String styles = "";
if (wmsStyles != null && wmsStyles.length() != 0) {
styles = wmsStyles;
}
params.put("STYLES", styles);
if (reqType == RequestType.MAP) {
Boolean tmpTransparent = transparent;
if (mod != null && mod.getTransparent() != null) {
tmpTransparent = mod.getTransparent();
}
if (tmpTransparent == null || tmpTransparent) {
params.put("TRANSPARENT", "TRUE");
} else {
params.put("TRANSPARENT", "FALSE");
}
String tmpBgColor = bgColor;
if (mod != null && mod.getBgColor() != null) {
tmpBgColor = mod.getBgColor();
}
if (tmpBgColor != null && tmpBgColor.length() != 0) {
params.put("BGCOLOR", tmpBgColor);
}
String tmpPalette = palette;
if (mod != null && mod.getPalette() != null) {
tmpPalette = mod.getPalette();
}
if (tmpPalette != null && tmpPalette.length() != 0) {
params.put("PALETTE", tmpPalette);
}