[OpenMap Users] FW: No layers displayed by ImageServer

From: Joe Reger, Jr. <joe_at_joereger.com>
Date: Wed, 23 Mar 2005 10:47:19 -0500

Thanks Don!

>>Don Dietrick, dietrick_at_bbn.com writes:
>>I'd put
>>in your init() method, and see if the layers are being called to make
>>the images.

I put the Debug() statements into my init() method and my doGet() method
(latest code at bottom). Here's what I got:

ImageServer: using the new ProjectionPainter interface! createImage with
layer mask.
ImageServer.createGraphics: graphics is cool
ImageServer: considering 2 for image...
ImageServer: image request adding layer graphics from : Graticule Layer
ImageServer: image request adding layer graphics from : Political Solid
ImageServer: ready to create formatted image.
ImageServer: using full scale image (unscaled).

It looks like I don't get much logging in the init() method, but once the
doGet() method is called I get the above log entries on each request. It
seems to say that it's adding the layers properly but I still get a blank
white image. Is there a higher debug level that I should turn on?



package reger.geo;

import java.io.IOException;
import java.util.Properties;
import java.util.Vector;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import javax.servlet.http.*;
import com.bbn.openmap.Layer;
import com.bbn.openmap.util.ComponentFactory;
import com.bbn.openmap.util.Debug;
import com.bbn.openmap.image.*;
import com.bbn.openmap.proj.Projection;
import com.bbn.openmap.proj.ProjectionFactory;

public class MapServlet extends HttpServlet {

    public static Layer polLayer;
    public static Layer gratLayer;
    public static Layer[] layers;
    public static ImageServer imageServer;
    public static AcmeJPEGFormatter formatter = new AcmeJPEGFormatter();
    public static Properties configProperties;
    public static Projection defaultProjection;

    public void init(ServletConfig conf) throws ServletException {


        //Political Boundaries Layer
        if (polLayer==null){
            Properties shapeLayerProps = new Properties();
            shapeLayerProps.put("prettyName", "Political Solid");
            shapeLayerProps.put("lineColor", "000000");
            shapeLayerProps.put("fillColor", "BDDE83");
            polLayer =
                    System.out.println("polLayer created: " +

        //Graticule Layer
        if (gratLayer==null){
            Properties gratLayerProps = new Properties();
            gratLayerProps.put("prettyName", "Graticule Layer");
            gratLayerProps.put("showRuler", "true");
            gratLayerProps.put("show1And5Lines", "true");
            gratLayerProps.put("threshold", "2");
            gratLayerProps.put("10DegreeColor", "99000000");
            gratLayerProps.put("5DegreeColor", "99009900");
            gratLayerProps.put("1DegreeColor", "99003300");
            gratLayerProps.put("equatorColor", "99FF0000");
            gratLayerProps.put("specialLineColor", "99000000");
            gratLayerProps.put("textColor", "99000000");
            gratLayer =
                    System.out.println("gratLayer created: " +

        //Store the layers in an array
        if (layers==null){
                    layers = new Layer[2];
                    layers[0] = polLayer;
                    layers[1] = gratLayer;

        //Initialize the projection
        if (defaultProjection==null){
            defaultProjection =
bbn.openmap.proj.Mercator"), 0f, -90f, 1000000000f, 640, 480);
            System.out.println("defaultProjection created: " +

        //Initialize the imageServer
        if (imageServer==null){

            imageServer = new ImageServer(layers, formatter);
            System.out.println("ImageServer created: " +

        public void doGet(HttpServletRequest request, HttpServletResponse
response) throws IOException {
        //Create the image using the ImageServer and the projection
        byte[] image = imageServer.createImage(defaultProjection);
        //Send the image to the client

[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Wed Mar 23 2005 - 12:18:11 EST

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:06 EDT