Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i used this following code for to show the map in java swing application
Java
public class Tracking extends JInternalFrame  {
	
	private MapPanel map;
	private JLabel map1;
	
	public Tracking(String lan,String lat,String codeno){
		super("Tracking :"+codeno+"-Location",false,true,false,true);
		setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
		setSize(700,500);
		map=new MapPanel();
		map.setZoom(13);
		double lon = Double.valueOf(lan);
		double latt = Double.valueOf(lat);
		map1=new JLabel(new ImageIcon(ClassLoader.getSystemResource("Image/position.png")));
		Point position = map.computePosition(new Point2D.Double(lon,latt));
		map1.setLocation(position);
		map1.setFocusable(true);
		map.setIgnoreRepaint(true);
		map.setFocusable(true);
		map.setCenterPosition(position); // sets to the computed position
		add(map);
		map.add(map1);
	}
}

it runs good. but i want show the correct location on map.
Posted
Updated 2-Apr-14 8:58am
v2
Comments
TorstenH. 2-Apr-14 15:33pm    
What kind of map?
Where is the problem?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900