From: Andreas Wagner <andyw@ao...> - 2004-10-18 19:07:45
Im trying to print out whole maps scaled to the size and orientation of
I have the problem that the context i want to print is allways coupelt
to a StyledMapPane, what means to a Screen presentation,
The first approache was setting the Zoom of the MapPane back with the
reset() Methode, in my case this methode sets the zoom back to the
initial Zoom, but with initial zoom not the whole map is shown in my
Next step was the BoundingBox of the biggest Layer over getArea() and
set it with setVisibleArea() this should set the Zoom so that the whole
map is displayed on the screen. Did not work, the zoom was not changed.
The Zoom only worked when I set a Square in the setVisibleArea Methode.
But when setting a square i have a white space at the top. Becouse of
this empty space, when printing in landscape format, again a part is
So i also tried to use the transform method to apply a Affinetransform
with a scale, after the transform the map was somewhere in the zoompane,
but not centers, think the center of the zoom was missing?
So all this tries where with a Customized StyledMapPane which implements
the Printable Interface.
Is there another possibility to get the whole map rendert maybe
independent from the screen representation?
When i give the printer a new MapPane object whitout displaying it in a
frame (or something similar) it seemes that nothing is rendert. The
MapPane context and so on but nothing is shown on the paper.
So a lot of questions.
Thanks in advance
From: Martin Desruisseaux <martin.desruisseaux@te...> - 2004-10-18 23:53:11
Andreas Wagner a =E9crit :
> Im trying to print out whole maps scaled to the size and orientation of=
> the paper.
I have not tried it myself, but I guess there is two possibilities:
1) Do you want to print the content of a widget? In this case, would
it be possible to get the printer's Graphics2D and invokes
MapPane.print(...) method on it? If some scale is needed, it should
be applied on the Graphics2D object before to pass it to the
2) If there is no widget (for example just printing as a server work),
then we may avoid completly MapPane and work directly with
Renderer. Again, pass the printer's Graphics2D object to the
Renderer.paint(...) method. You can specify explicitly the
AffineTransform as the zoom parameter in this case, which should
give you full control.