}
private static ReferencedEnvelope calculateBoundsFromScale(
ReferencedEnvelope requestedBounds, double scaleDenominator, ILayer layer) {
IRenderManager renderManager = layer.getMap().getRenderManager();
if( renderManager==null ){
// no render manager and therefore no scale to calculate.
return requestedBounds;
}
IMapDisplay mapDisplay = renderManager.getMapDisplay();
return ScaleUtils.calculateBoundsFromScale(scaleDenominator, mapDisplay
.getDisplaySize(), mapDisplay.getDPI(), requestedBounds);
}