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);
}