Hello All,
I suspect this is something VERY simple that I'm overlooking, but I've
looked at the code for all the examples, all the layers that come with
openmap, and read the FAQ etc.
What am I missing here so that I get the error message "OMScalingRaster:
null projection in position" ??
Best,
Lynellen Perry
Computer Scientist, SAIC
V: 703-676-5497
package com.saic.jnuance.GAS;
import java.awt.*;
import javax.swing.*;
import com.bbn.openmap.*;
import com.bbn.openmap.omGraphics.*;
import com.bbn.openmap.Layer;
import com.bbn.openmap.proj.Projection;
import com.bbn.openmap.event.ProjectionEvent;
import com.bbn.openmap.MapBean;
/**
* A Layer to display Andrews Air Force Base composite image.
*/
public class AndrewsAFBLayer extends Layer {
private OMGraphicList omgraphics;
private com.bbn.openmap.omGraphics.OMScalingRaster basePhoto;
public AndrewsAFBLayer() {
ImageIcon baseIcon = new
ImageIcon("C:\\NuanceGas\\com\\saic\\jnuance\\GAS\\composite.jpg");
System.out.println("In Andrews constructor... loading image");
basePhoto = new OMScalingRaster(38.8295f, 76.9050f, 38.7815f,
76.8463f, baseIcon);
omgraphics = new OMGraphicList();
omgraphics.clear();
omgraphics.addOMGraphic(basePhoto);
System.out.println("About to generate image.");
}
//----------------------------------------------------------------------
// Layer overrides
//----------------------------------------------------------------------
public void paint(java.awt.Graphics g) {
omgraphics.generate(getProjection());
omgraphics.render(g);
}
//----------------------------------------------------------------------
// ProjectionListener interface implementation
//----------------------------------------------------------------------
/**
* Handler for <code>ProjectionEvent</code>s. This function is
* invoked when the <code>MapBean</code> projection changes. The
* graphics are reprojected and then the Layer is repainted.
* <p>
* @param e the projection event
*/
public void projectionChanged(com.bbn.openmap.event.ProjectionEvent e) {
omgraphics.generate(e.getProjection());
repaint();
}
-- [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 Oct 11 10:39:30 2002
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:33 EDT