@Override
public void refreshImage() {
//do nothing
}
});
RenderManager rm=map.getRenderManagerInternal();
rm.setMapDisplay(new TestMapDisplay(displaySize));
rm.getRendererCreator().getLayers().add(layer);
map.getViewportModelInternal().setCRS(layer.getCRS());
final Runnable job = new Runnable() {
@Override
public void run() {
map.getViewportModelInternal().zoomToExtent();
}
};
final Thread jobThread = new Thread(job);
jobThread.start();
jobThread.join();
MultiLayerRenderer renderer=(MultiLayerRenderer) RenderFactory.eINSTANCE.createCompositeRenderer();
RenderContext context=new CompositeRenderContextImpl();
context.setRenderManagerInternal(rm);
context.setMapInternal(map);
context.setGeoResourceInternal(layer.getGeoResources().get(0));
context.setLayerInternal(layer);
renderer.setContext(context);
context = rm.getRendererCreator().getConfiguration().iterator().next();
((CompositeRenderContext) renderer.getContext()).addContexts(Collections.singleton(context));
RenderExecutor ex=RenderFactory.eINSTANCE.createRenderExecutor(renderer);
rm.setRenderExecutor(ex);
}
return map;
}