public Pair<BufferedImage, String> getMap( GetMap getMap, Map<String, String> hardParameters, int timeout,
boolean errorsInImage )
throws IOException {
if ( VERSION_111.equals( wmsVersion ) ) {
Worker worker = new Worker( getMap.getLayers(), getMap.getStyles(), getMap.getWidth(), getMap.getHeight(),
getMap.getBoundingBox(), getMap.getCoordinateSystem(), getMap.getFormat(),
getMap.getTransparent(), errorsInImage, false, null, hardParameters );
Pair<BufferedImage, String> result;
try {
if ( timeout == -1 ) {
result = worker.call();
} else {
result = Executor.getInstance().performSynchronously( worker, timeout * 1000 );
}
} catch ( Throwable e ) {
throw new IOException( e.getMessage(), e );
}
return result;
}
throw new IllegalArgumentException( "GetMap request for other versions than 1.1.1 are not supported yet." );
}