2008/12/13 Matt Foster <[email protected]>:
> I'm trying to build a simple gui with a JStreamNavMap and a
> JStreamNavigationBar. The problem I'm having is that when the gui first
> starts the map does not display. I can click the "Zoom All" button on the
> nav bar, and then the map will appear correctly. I'm attaching the code.
>
> Any ideas why the map isn't showing up on startup?
>
Hi Matt
I have the same problem. If you modify your constructor like this I
think the map should appear...
public MoverGUI2() throws URISyntaxException {
setSize(600, 600);
initComponents();
final MapContext context = buildContext();
navBar.setMap(map);
map.getRenderingStrategy().setContext(context);
this.addComponentListener(new ComponentAdapter() {
@Override
public void componentShown(ComponentEvent e) {
try {
map.getRenderingStrategy().setMapArea(context.getLayerBounds());
} catch (IOException ex) {
throw new RuntimeException("bummer");
}
}
});
}
Although this works for me it seems like a really ugly hack and it
uses a deprecated method. If anyone knows a more elegant solution
please sing out.
Hope this helps
Michael
------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you. Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users