Re: [OpenMap Users] Screen not refreshing after changes

From: Don Dietrick <dfdietrick_at_gmail.com>
Date: Sat, 14 Mar 2015 22:47:29 -0400

Hi Gary,

Thanks for writing - yes, I’ll be moving OpenMap to GitHub over the next couple of weeks.

As for your problem, I think you just need to call layer.doPrepare(); after you set the list. The layer still thinks the latest projection it has is still valid, and probably thinks it doesn’t need to do work, since it’s already handled that projection change. Calling doPrepare() will force the layer to regenerate the OMGraphicList for the current projection, and will also call repaint() on the layer for you.

Hope this helps,

Don


> On Mar 14, 2015, at 7:47 PM, Gary Briggs <chunky_at_icculus.org> wrote:
>
> Afternoon
>
> Quick first question: With the demise of google code, are you planning
> on migrating to github or other repo anytime soon?
> ref: http://google-opensource.blogspot.co.uk/2015/03/farewell-to-google-code.html
>
> Now the real question:
> I'm currently using openmap-5.1.10 embedded a mapbean in my application.
> Here's a mostly-simplified code example showing the issue:
>
> // Previously:
> OverlayMapPanel mp = new OverlayMapPanel();
> LayerHandler lh = new LayerHandler();
> mp.getMapHandler().add(lh);
>
>
> OMGraphicHandlerLayer layer = null;
> public void doThings() {
> if(null == layer) {
> layer = new OMGraphicHandlerLayer();
> Properties props = new Properties();
> props.setProperty("prettyName", "Blah");
> layer.setProperties(props);
> }
>
> lh.removeLayer(layer); // First time through will do nothing
>
> OMGraphicList gl = new OMGraphicList();
> // Do a whole bunch of gl.add(new OMText(...)) and gl.add(new OMPoint(...))
> layer.setList(gl);
>
> lh.addLayer(layer, 0); // HERE
> }
>
> The first time through this code, everything works perfectly.
> On second and subsequent times through, the layer doesn't appear on the
> map until I resize or zoom the map window. I tried a number of different
> ways to force a repaint [including moving the map center away and then
> back again immediately], but none of them seem to work.
>
> Please could I get some direction on what's going wrong? I've tried
> without the remove/add, but it didn't make a difference.
>
> Gary
>
> --
> [To unsubscribe to this list send an email to "majdart_at_bbn.com"
> with the following text in the BODY of the message "unsubscribe openmap-users"]

--
[To unsubscribe to this list send an email to "majdart_at_bbn.com"
with the following text in the BODY of the message "unsubscribe openmap-users"]
Received on Sat Mar 14 2015 - 22:48:48 EDT

This archive was generated by hypermail 2.3.0 : Tue Mar 28 2017 - 23:25:10 EDT