public GetMap( List<Pair<String, String>> layers, int width, int height, Envelope boundingBox, String format,
boolean transparent ) throws OWSException {
for ( Pair<String, String> layer : layers ) {
this.layers.add( new LayerRef( layer.first ) );
this.styles.add( layer.second != null ? new StyleRef( layer.second ) : null );
}
this.width = width;
this.height = height;
this.bbox = boundingBox;
this.crs = boundingBox.getCoordinateSystem();
this.bgcolor = white;
this.format = format;
this.transparent = transparent;
try {
scale = RenderHelper.calcScaleWMS130( width, height, bbox, crs, pixelSize );
LOG.debug( "GetMap request has a WMS 1.3.0/SLD scale of '{}' (adapted to pixel size of {}).", scale,
pixelSize );
resolution = max( bbox.getSpan0() / width, bbox.getSpan1() / height );
LOG.debug( "Resolution per pixel is {}.", resolution );
} catch ( ReferenceResolvingException e ) {
LOG.trace( "Stack trace:", e );
throw new OWSException( e.getLocalizedMessage(), "InvalidParameterValue" );
}
}