<div class="gmail_quote"><div class="gmail_quote"><div class="im"><div>Sorry - its seems my previous mail with the rather large attachment were a bit of an issue, here's the text of the message:</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#ffffff" text="#000000">
<br>
The code looks correct (don't forget to call
context.switchToDisplayCRS() or switchToDisplayCRS() to set the
system in which you are painting), if you need more examples you can
have a look at the<br>
WMS/WMTS/OSM-TMS/KML Clients modules, they all use custom subclasses
of MapLayer and GraphicBuilders.<br>
<br></div></blockquote><div><br></div></div><div>Hi Johann . I took your advice and created a custom MapLayer:</div><div><br></div><div><div>public class TargetMapLayer extends AbstractMapLayer {</div><div><br></div>
<div> private TargetManager manager;</div>
<div> private TargetGraphicBuilder builder;</div><div> // full world extend</div><div> private static final Envelope MAXEXTEND_ENV = new Envelope2D(DefaultGeographicCRS.WGS84, -180, -90, 360, 180);</div><div> private static final MutableStyleFactory SF = (MutableStyleFactory) FactoryFinder.getStyleFactory(</div>
<div> new Hints(Hints.STYLE_FACTORY, MutableStyleFactory.class));</div><div><br></div><div> public TargetMapLayer(TargetManager manager) {</div><div> super(new DefaultStyleFactory().style());</div><div>
this.manager = manager;</div><div> //register the default graphic builder for geotk 2D engine.</div><div> builder = new TargetGraphicBuilder(manager);</div><div> graphicBuilders().add(builder);</div>
<div> setDescription(SF.description(manager.getName(), manager.getName() + " Target Manager"));</div><div> }</div><div><br></div><div> @Override</div><div> public Envelope getBounds() {</div><div>
return MAXEXTEND_ENV;</div><div> }</div><div>}</div></div><div><br></div><div>I have several implementations of my TargetProviders (radars), the attached screenshot shows the simulated radar. The red dots are acquired targets.</div>
<div>My current issue is that the targets are only painted when I toggle the "Stateful Rendering Mode" check and manually refresh. Manually refreshes after checking</div><div>statefull does not work either - I have to cycle through the "Stateful Rendering Mode" again.</div>
<div><br></div><div>How do I switch on auto refreshing - the refresh()methods don't seem to work for me...</div><div><br></div><div>Tanks and regards</div><div><br></div><div><br></div></div>
</div><br><br clear="all"><br>-- <br>Thys Meintjes<br><br><br>