@SuppressWarnings(value = "unchecked")
@Override
protected Object doInBackground() throws Exception {
try {
final String url2 = ci.getUrl();
WMSClient client = new WMSClient(url2);
client.connect(new ICancellable() {
@Override
public boolean isCanceled() {
return false;
}
@Override
public Object getID() {
return System.currentTimeMillis();
}
});
version = client.getVersion();
for (final String s : client.getLayerNames()) {
WMSLayer layer = client.getLayer(s);
// this.service =
// client.getServiceName();
final Vector allSrs = layer.getAllSrs();
boolean epsg = (allSrs != null) ? allSrs
.contains("EPSG:4326") : false;
final Vector formats = client.getFormats();
if (formats.contains("image/png")) {
png = "image/png";
} else if (formats.contains("IMAGE/PNG")) {
png = "IMAGE/PNG";
} else if (formats.contains("png")) {