Hey Christian,
I think this is because you are using getDefaultProjection() method. Like
Brian suggested in his previous email, take a look at the ProjectionFactory
class in the OpenMap API, and in particular the makeProjection method.
Hope you are doing well, and that this helps. Have a great weekend.
-Tom
-----Original Message-----
From: owner-openmap-users@bbn.com [mailto:owner-openmap-users@bbn.com] On
Behalf Of Christian Weaves
Sent: Friday, May 28, 2004 10:20 AM
To: openmap-users@bbn.com
Cc: Brian.Hudson@rl.af.mil
Subject: [OpenMap Users] MapRequestHandler.createImage problem
Thanks for that Brian, I now have the projection sorted.
The problem I have now is that the map displayed is the whole world and
not zoomed into my specified scale/lat & long.
The map is created with the following line:
MapRequestHandler iServer = new MapRequestHandler(mapProps);
I then want to zoom to a specific scale/lat & lot so I use:
iServer.handleRequest("REQUEST=MAP&PROJTYPE=Mercator&SCALE=180127&LAT=3&LON=
4&WIDTH=500&HEIGHT=500");
Then I output the image to the browser with:
OutputStream os = response.getOutputStream();
os.write(iServer.createImage(iServer.getDefaultProjection()));
But rather than the image zooming in to my scale/lat & long all I get is
the complete map of the world.
I don't want to use the SimpleHttpImageServer, I want to keep it
contained in the servlet container.
Any ideas?
Thanks again.
On Fri, 2004-05-28 at 14:42, Hudson Brian R Contr AFRL/IFSF wrote:
> Hello,
>
> The com.bbn.openmap.image.ImageServerUtils.createOMProjection(properties,
> Projection) will show you how to construct a Projection. It uses the
> ProjectionFactory.makeProjection method.
>
> In fact, this is the method that is used by the MapRequestHandler in order
> to create the Projection based on the http request.
>
> Hopes this helps,
>
> Brian Hudson
>
> -----Original Message-----
> From: owner-openmap-users@bbn.com [mailto:owner-openmap-users@bbn.com] On
> Behalf Of Christian Weaves
> Sent: Friday, May 28, 2004 9:20 AM
> To: openmap-users@bbn.com
> Subject: [OpenMap Users] MapRequestHandler.createImage problem
>
>
> Hi, Can someone please tell me how I use the createImage method in the
> MapRequestHandler object correctly.
>
> I have a servlet (CreateMapImage.java) that is supposed to generate a map
> image using the OpenMap api and send the result to the servlets response
> object.
>
> The MapRequestHandler.createImage method accepts a Projection class as a
> parameter, I can't for the life of me create a new Projection object to
pass
> as a parameter..
>
> Can you point me in the right direction??
>
> Thanks very much, here's the Servlet code:
>
> =======================================================================
>
> public void doPost(HttpServletRequest request, HttpServletResponse
> response)
> throws ServletException, IOException {
>
> response.setContentType("image/jpeg");
>
> MapRequestHandler iServer = new MapRequestHandler(mapProps);
>
> //some dummy coords
> String imageRequest =
>
"REQUEST=MAP&PROJTYPE=Mercator&SCALE=180127&WIDTH=770&HEIGHT=540&LAT=64.4718
> 5&LON=6.161536";
>
> OutputStream os = response.getOutputStream();
>
> iServer.handleRequest(imageRequest);
>
>
> //problem line, can't create image
> os.write( iServer.createImage(***********) );
> }
>
>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com" with the
> following text in the BODY of the message "unsubscribe openmap-users"]
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
openmap-users"]
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"] -- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Fri May 28 11:27:06 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT