summaryrefslogtreecommitdiffstats
path: root/gui/MapViewer.java
blob: 3292fdf556d054c4dd735b503e590e15dbf560ab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package gui;

@SuppressWarnings("serial")
public class MapViewer extends javax.swing.JFrame {

	private org.jdesktop.swingx.JXMapKit jXMapKit1;

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		java.awt.EventQueue.invokeLater(new Runnable() {

			@Override
			public void run() {
				new MapViewer().setVisible(true);

			}
		});

	}

	public MapViewer() {
		initComponents();
	}

	private void initComponents() {
		// TileFactoryInfo test = new TileFactoryInfo(1, 14, 3, 50, true, true,
		// "http://tile.openstreetmap.org/", "x", "y", "zoom");
		/*
		 * TileFactoryInfo info = new TileFactoryInfo(0, // min level 8, // max
		 * allowed level 9, // max level 256, // tile size true, true, // x/y
		 * orientation is normal "http://wesmilepretty.com/gmap2/", // base url
		 * "x", "y", "z" // url args for x, y and z ) { public String
		 * getTileUrl(int x, int y, int zoom) { // int wow_zoom = 9 - zoom;
		 * String url = this.baseURL; // if (y >= Math.pow(2, wow_zoom - 1)) {
		 * // url = "http://int2e.com/gmapoutland2/"; // } return url + "zoom" +
		 * zoom + "maps/" + x + "_" + y + "_" + zoom + ".jpg"; } };
		 */

		jXMapKit1 = new org.jdesktop.swingx.JXMapKit();
		setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
		jXMapKit1
				.setDefaultProvider(org.jdesktop.swingx.JXMapKit.DefaultProviders.OpenStreetMaps);
		// jXMapKit1.setDefaultProvider(test);
		// jXMapKit1.setTileFactory(new TileFactory(info));

		getContentPane().add(jXMapKit1);
		pack();

	}

}