|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
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); } |
|
|
RE: Why won't my layer re-render?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"] |
|
|
RE: Why won't my layer re-render?Thanks - that did it.
-----Original Message----- From: Chris Allport [mailto:callport@...] Sent: Monday, November 10, 2008 7:43 AM To: openmap-users@... Cc: Benito, Robert P. Subject: RE: [OpenMap Users] Why won't my layer re-render? 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--tp20369107p203691 0 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"] |
| Free embeddable forum powered by Nabble | Forum Help |