I'm currently using the Java Map Projection Library (I was able to obtain the code used for the Applet from the author and modify it for use in a desktop application - not sure if he linked to that on his website yet) to draw a map of the Earth in an application. However, I want to take this a step further. I have a set of latitude/longitude points that I want to plot on this map - I just need to draw a circle at each point and perhaps some lines connecting the circles (points) on the map. However, as the user uses the built-in panning and zooming capabilities, the points need to be redrawn in the proper position. The best I have been able to achieve is maintaining the points when zooming, and even then the points get larger as you zoom in.
I'm totally open to switching libraries, however I really haven't found a library that can take care of drawing a world map, particularly onto a Swing component (it doesn't need to be that accurate, just show the various landmasses somewhat correctly) and also plotting additional points on top of that map and having them "stick" to various latitude/longitude coordinates.
I have looked at Google Earth and NASA WorldWind, however they are awfully heavy for my purposes (I don't need anything that detailed or accurate) and it doesn't seem that easy to allow for offline use and integrate the world image view into an existing application.
Suggestions or thoughts?
Here are examples of formats that work: Decimal degrees (DD): 41.40338, 2.17403. Degrees, minutes, and seconds (DMS): 41°24'12.2"N 2°10'26.5"E. Degrees and decimal minutes (DMM): 41 24.2028, 2 10.4418.
The geographic grid is a system designed to pinpoint any location on Earth by laying a vertical and horizontal grid over the Earth's layout. The vertical lines are called the longitude and the horizontal lines are the latitude. The intersection of these two points determines any exact location.
If you're using a map with longitude and latitude lines, stick a pin where you're located. Then, draw a straight horizontal line from your point to the east or west edge of the map. Then, draw a vertical line from your location to the north or south edge of the map. Put together the 2 coordinates to find your position.
You might take a look at other components of the www.osgeo.org Java stack. One of them is geotools: http://geotools.codehaus.org/
they is also development going on to create a GUI: http://geotools.codehaus.org/GUI+Architecture
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With