Thanks for the effort,

Currently I use a simillar method creating the png and sending it to the
browser. This was never a problem.

My problem is the generation of the html image-map. I was able to create it
with the old 0.8 version, but with this 2.x version I can't access the
transformed data after drawing with the LiteRenderer. Any ideas or
experiences?


Regards,

Peter Lobacz

[EMAIL PROTECTED] schrieb am 31.07.2006 17:39:45:

> Hi Peter,
>
> I hope the following code will help. If you think I can help with
somethin
> let me know.
>
>       ServletOutputStream ouputStream = response.getOutputStream();
>
>    img = the buffered image
>
>
>       // generate byte[] array
>       ByteArrayOutputStream baos = new ByteArrayOutputStream( 1000 );
>       javax.imageio.ImageIO.write( img, "png", baos );
>       baos.flush();
>       byte[] resultImageAsRawBytes = baos.toByteArray();
>       baos.close();
>       ouputStream.write(resultImageAsRawBytes);
>       ouputStream.flush();
>
>
> ......
>
>
>         MapContext mc = mapContext;
>         BufferedImage bufferedImage = null;
>
>         bufferedImage = new BufferedImage(width, height,
> BufferedImage.TYPE_INT_RGB);
>         graphics2D = (Graphics2D)bufferedImage.getGraphics();
>         graphics2D.setRenderingHints(new
> RenderingHints(RenderingHints.KEY_RENDERING,
> RenderingHints.VALUE_RENDER_SPEED));
>         graphics2D.setColor(Color.WHITE);
>         graphics2D.fillRect(0, 0, width, height);
>
>         streamingRenderer = new StreamingRenderer();
>         streamingRenderer.setContext(mc);
>
>         RenderingHints hints = new
> RenderingHints(RenderingHints.KEY_ANTIALIASING,
> RenderingHints.VALUE_ANTIALIAS_ON );
>         streamingRenderer.setJava2DHints(hints);
>
>         //we already do everything that the optimized data loading
does...
>         //if we set it to true then it does it all twice...
>         Map rendererParams = new HashMap();
>         rendererParams.put("optimizedDataLoadingEnabled",new
Boolean(true)
> );
>
>         streamingRenderer.setRendererHints(rendererParams);
>
>         try
>         {
>                     streamingRenderer.paint(graphics2D, new
Rectangle(width,
> height), envelope);
>         }
>         catch(Exception ex)
>         {
>                     ex.printStackTrace();
>         }
>
>         if (graphics2D!=null)
>             graphics2D.dispose();
>
>         return bufferedImage;
>
>
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On Behalf Of
> [EMAIL PROTECTED]
> Sent: Monday, July 31, 2006 2:15 AM
> To: [email protected]
> Subject: [Geotools-gt2-users] Antwort: Re: Web-based mapping with
GeoTools?
>
> Yes I've done this already but I have problems generating the html -
> imagemaps. Any hints in this direction?
>
>
> Regards,
> Peter
>
>
> [EMAIL PROTECTED] schrieb am 28.07.2006
> 18:04:38:
>
> > client requests.
> >
> >
> > On 7/28/06, Bernd Resch <[EMAIL PROTECTED]> wrote:
> > > Hello,
> > >
> > > I've got a very basic question: as I understood, GeoTools aims at
> > > displaying maps etc. in client-side components such as Applets
> > > (using the JFrame class). Using GeoTools, is it also possible to
> > > build web-based applications (maps are displayed directly within an
> > > HTML page e.g. using JSP)?
> > > If yes, are the same classes like (Styled)MapPane etc. used?
> >
> > mostly you just use a renderer to draw directly to an image that the
> > servlet sends to the client.
> >
> > > If no, are there any open-source Java implementations available?
> >
> > check out geoserver and mapbuilder.
> >
> > Ian
> >
> > _______________________________________________
> > Geotools-gt2-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT Join
SourceForge.net's
> Techsay panel and you'll get the chance to share your opinions on IT &
> business topics through brief surveys -- and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geotools-gt2-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
> --
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.10.5/403 - Release Date: 7/28/2006
>
>
> --
> No virus found in this outgoing message.
> Checked by AVG Free Edition.
> Version: 7.1.394 / Virus Database: 268.10.5/403 - Release Date: 7/28/2006
>
>


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to