* Don Dietrick (dietrick_at_bbn.com) wrote:
> You need to call generate(Projection) on the OMGraphic, the other
> OMGraphics should be OK if the map isn't changing.
So this *should* work (see below). Its what I'm using, it lives in my
Layer class. When a line is added that layer disappears. resizing the
window makes it come back with the added line.
TIA
public void setLine(LatLonPoint a, LatLonPoint b)
{
System.out.println("adding line "+
+a.getLatitude()+","
+a.getLongitude() + " "
+b.getLatitude() + ","
+b.getLongitude());
OMLine l = new OMLine(
a.getLatitude(),
a.getLongitude(),
b.getLatitude(),
b.getLongitude(),
com.bbn.openmap.omGraphics.geom.BasicGeometry.LINETYPE_STRAIGHT
);
graphics.add( l);
graphics.generate( getProjection(), true);
repaint();
System.out.println(graphics.size());
} // setLine
have fun,
SteveC steve_at_fractalus.com
http://www.fractalus.com/steve/
--
[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 Tue Dec 07 2004 - 14:35:51 EST