layer = getContext().getLayer();
// assume everything will work fine
layer.setStatus(ILayer.DONE);
layer.setStatusMessage(""); //$NON-NLS-1$
WMTSource wmtSource = getWmtSourceFromLayer(layer);
if (wmtSource == null)
throw new UnsupportedOperationException(Messages.Render_Error_NoSource);
// Layer properties
WMTLayerProperties layerProperties = new WMTLayerProperties((StyleBlackboard) layer
.getStyleBlackboard());
// Get map extent, which should be drawn
ReferencedEnvelope mapExtent = getRenderBounds();
if (mapExtent == null) {
mapExtent = context.getViewportModel().getBounds();
}
// Scale
double scale = getContext().getViewportModel().getScaleDenominator();
WMTPlugin.trace("[BasicWMTRender.render] Scale: " + scale); //$NON-NLS-1$
WMTRenderJob renderJob = null;
try {
renderJob = WMTRenderJob.createRenderJob(mapExtent, scale, wmtSource);
} catch (Exception exc) {
throw new UnsupportedOperationException(Messages.Render_Error_Projection);
}
int tileLimitWarning = WMTRenderJob.getTileLimitWarning();
// Find tiles
Map<String, Tile> tileList = wmtSource.cutExtentIntoTiles(renderJob,
WMTRenderJob.getScaleFactor(), false, layerProperties, tileLimitWarning);
// if we have nothing to display, return
if (tileList.isEmpty()) {
throw new UnsupportedOperationException(Messages.Render_Error_NoData);