JXMapKit/-Viewer extremely slow as webstartable - where to start digging?

poppyurchin

New Member
Just tried to add some swingx-ws components to the overall swinglabs demos - and noticed that a simple JXMapKit/-Viewer is orders of magnitude slower to load the tiles in the webstartable compared to loading locally.Rather lost on where I should start looking (ui updates seem to be on the EDT, though might need a closer look):
  • anybody else experiencing the different loading times?
  • any guess on what might be the reason?
  • how to debug a webstartable?
The code is rather straightforward (to run locally, you'll need swingx and swingx-ws:\[code\]public class WSDemo { private JComponent createContent() { JComponent content = new JPanel(); content.setLayout(new BorderLayout()); content.add(createMapKit()); return content; } protected JComponent createMapKit() { final JXMapKit kit = new JXMapKit(); kit.setDefaultProvider(DefaultProviders.OpenStreetMaps); final int max = 17; TileFactoryInfo info = new TileFactoryInfo(1, max - 2, max, 256, true, true, // tile size is 256 and x/y orientation is normal "http://tile.openstreetmap.org",// 5/15/10.png", "x", "y", "z") { public String getTileUrl(int x, int y, int zoom) { zoom = max - zoom; String url = this.baseURL + "/" + zoom + "/" + x + "/" + y + ".png"; return url; } }; TileFactory tf = new DefaultTileFactory(info); kit.setTileFactory(tf); kit.setZoom(14); kit.setAddressLocation(new GeoPosition(51.5, 0)); kit.getMainMap().setDrawTileBorders(true); kit.getMainMap().setRestrictOutsidePanning(true); kit.getMainMap().setHorizontalWrapped(false); return kit; } public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable() { public void run() { JFrame frame = new JFrame(""); frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); frame.add(new WSDemo().createContent()); frame.setLocationByPlatform(true); frame.setSize(400, 400); frame.setVisible(true); } }); }}\[/code\]
 
Back
Top