« November 2005 | Main | February 2006 »
December 30, 2005
Cruise the World with the Google Maps API
For my first foray into the Google Maps API, I decided to plot the Silversea 2007 World Cruise. For only $53,000, you can take a 126 day cruise to 6 continents. While I most likely will not be on that cruise ($53k is a little much), I thought it would be tedious fun to chart out all of the destinations using the API.
For the most part, the coding was pretty straight-forward. I used Google Earth to find the latitude and longitude of almost all the stopping points. I was not able to find coordinates for all destinations though, so the below map does not show all points on the cruise. However, it does show the idea of what the cruise route will be.
One thing I did not anticipate was the API's handling of polylines across the International Date Line. Let's say there is one point on each side of the International Date Line and you try to connect them with a polyline. Instead of drawing a short line between the two points, the API will instead draw a long line all the way across the world to connect them. There is a discussion about this behavior here. To combat this problem, I had to make two different polylines, one for each side of the Date Line.
The finished product is below, or you can see it on its own page here. The starting point is Fort Lauderdale, FL and it goes South from there. You will have to use your imagination and connect the points between French Polynesia and Fiji as that is where the Date Line problem lies. After going around the world, the trip ends at New York, NY.
Posted by Chuck at 09:48 AM | Comments (3) | TrackBack
December 06, 2005
A Simple JSP to View Everything in Your Classpath
TSIA:
<!-- This page prints the classpath URL's under the current System
classloader. -->
<%
ClassLoader sysClassLoader = ClassLoader.getSystemClassLoader();
java.net.URL[] urls = ((java.net.URLClassLoader)sysClassLoader)
.getURLs();
for(int i=0; i < urls.length; i++)
{
out.println(urls[i].getFile() + "<BR>");
}
%>
Sample Output:
/C:/JRun4/servers/lib/
/C:/JRun4/servers/lib/pbclient42RE.jar
/C:/JRun4/servers/lib/pbserver42RE.jar
/C:/JRun4/servers/lib/pointbase-service.jar
/C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/cfusion.jar
/C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/
/C:/JRun4/servers/cfusion/cfusion-ear/cfusion-war/WEB-INF/cfusion/lib/bcel.jar
etc...
Code modified from A Java Geek's Diary.
Posted by Chuck at 04:11 PM | Comments (1) | TrackBack