WARNING: This server is unstable and will be retired in the next days. If you want to keep this forum available, please request immediately a migration on the Nabble Support forum. Forums that don't receive any migration request will be deleted forever.

 « Return to Thread: Why won't my layer re-render?

RE: Why won't my layer re-render?

by Chris Allport-2 :: Rate this Message:

| View in Thread

Try calling generate on your OMGraphicList with your current projection
as the parameter:
                omgl.generate(mMapBean.getProjection());
               
You may also need to issue a repaint() call in your layer.



-----Original Message-----
From: SlikWilly [mailto:rbenito@...]
Sent: Thursday, November 06, 2008 3:35 PM
To: openmap-users@...
Subject: [OpenMap Users] Why won't my layer re-render?


Hi,
 
   I have a custom layer that extends OMGraphicHandlerLayer.  When I
initially load the layer with OMGraphics in it, the icons display just
fine.
The problem occurs after the initial loading of the layer when I add new
graphics to the layer.  They don't render at all.  How do I get the
layer to
render properly after adding new icons to i?  My Layer is below.

Thanks!


============================================

public class MCULayer extends OMGraphicHandlerLayer{

    /**
     * A list of graphics to be painted on the map.
     */
    private OMGraphicList omgraphics;
    private OMGraphic selectedGraphic;

    public MCULayer() {
        super();
        omgraphics = new OMGraphicList();
    }

    public void addSingleGraphic(float lat, float lon){
       
        ImageIcon simpsons = new
ImageIcon("C:/Temp_Images/Simpsons.png");
       
        OMScalingIcon simpsonsScalingIcon = new
OMScalingIcon(lat,lon,simpsons);
       
        OMGraphic simsonAsOMGraphic = (OMGraphic) simpsonsScalingIcon;
       
        omgraphics.add(simsonAsOMGraphic);
       
    }


    @Override
    public void paint(java.awt.Graphics g) {
        omgraphics.render(g);
    }
--
View this message in context:
http://www.nabble.com/Why-won%27t-my-layer-re-render--tp20369107p2036910
7.html
Sent from the OpenMap mailing list archive at Nabble.com.

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe
openmap-users"]

--
[To unsubscribe to this list send an email to "majdart@..."
with the following text in the BODY of the message "unsubscribe openmap-users"]

 « Return to Thread: Why won't my layer re-render?