From: Ian Turton <ian@ge...> - 2002-05-22 08:03:28
At 20:56 21/05/02, Ostrowski, Steven wrote:
> Is there some way to force a total update of the map? I've tried
>viewer.repaint(), viewer.invalidateStaticBuffer(), and many other methods,
>but I cannot get it working.
> I'm adding a line point by point to a layer. The theme for that
>layer is added to the map. As I click the points, I update the line that is
>added to that layer, but the line does not display.
You need to call notifyLayerChangedListeners(LayerChangedEvent.GEOGRAPHY)
inside your new layer. This tells the theme that the layer needs redrawing,
which tells the viewer etc.
>However, while I'm
>clicking points, if I very slightly drag the map (it's in pan mode) when I
>click the next point, the line will be displayed. However, if I drag the map
>too far, I get an ArrayIndexOutOfBoundsException. The line will also display
>the previous line when I begin adding a new line.
> This clearly seems like a bug to me, but I'd like to get some
>feedback here first.
We'd need a closer look at your code to see what's going on here. Panning
will force a redraw so it may be that your line is not complete at that time?
Hope that helps