[OpenMap Users] Screen not refreshing after changes

From: Gary Briggs <chunky_at_icculus.org>
Date: Sat, 14 Mar 2015 19:47:33 -0400

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"]
Received on Sat Mar 14 2015 - 19:49:48 EDT

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