import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; /** *
* This class demonstrates how to use the Goolgle Maps API with java. Google * Maps is based on Javascript which is similar to, but not the same as, Java. * This class writes an html file to disk and then launches an external web * browser to view the map. *
*
* This code is based on an example from the Google Maps website:
* http://code.google.com/apis/maps/documentation/examples/marker-simple.html
*
* The documentation for all things related to Google Maps is in the Google
* Maps API: http://code.google.com/apis/maps/documentation/
*
* * @author Mark Woehrer; edited by Wayne Smith, 4/2009 * @version 1a5 */ public class Driver { /** * The content is stored in a template containing placeholders for the * various points of interest (and the zoom factor). A simple search and * replace operation is performed replacing each placeholder with the * appropriate javascript. */ private String content; public Driver() throws IOException { super(); /* * The content contains four placeholders; one for the center point, zoom * level, zip point, and contact list. The placeholders are the names * surrounded by underscores. For example, the placeholder for the * center point is _center_point_. * * Other map attributes may be changed by directly modifying the * template. For example, to change the icon used, * you could do something like: * * // Create our "tiny" marker icon * var blueIcon = new GIcon(G_DEFAULT_ICON); * blueIcon.image = "http://www.google.com/intl/en_us/mapfiles/ms/micons/blue-dot.png"; * * // Set up our GMarkerOptions object * markerOptions = { icon:blueIcon }; * * (Pulled from http://code.google.com/apis/maps/documentation/overlays.html#Icons_overview) */ content = "\n" + "\n" + "
\n" + " \n" + "