2008-08-19 00:24:50 UTC
I downloaded two set of jar files: googlemaps_gwt_2_2_1.jar provided by sourceforge and gwt-maps.jar provided by google.
I was skimming through the classes and I want to use the following classes: Directions, Distance, Route, Geocoder and Waypoint. All of this is provided by gwt-maps.jar, your jar file has only a Geocoder, LatLng, etc but no Directions or Distance:
http://www.columbia.edu/~nlevitt/googlemaps-gwt/doc/com/mapitz/gwt/googleMaps/client/package-summary.html
I found the gwt-maps.jar limited as well, for instance I want to find the distance in a route, and I wasn't sure how to do that given the methods provided in the gwt-maps.jar.
I found a waypoint class which can be used to create an array of arguments to the Geocoder class for specifying multi-point directions which is great, however I don't see how to use the
distance class. It define the distance class as follows: The object contains two fields: a number called indicating the numeric value of the distance (in meters), and a string containing a localized string representation of the distance in the units that are predominant in the starting country of this set of directions. In order to use the route class (it can't be direcly created), it can be indirectly Created by the Directions class to store information about a single route in a directions result. However, it does not elaborate how this is done. Because in the ROute class there is a method, getDistance() , which is what I want in order to obtain the total distance of a route. I am not familiar with javascript which is what the google maps api is based on. From reading the google maps api though, it mentions a way to create a GRoute object from a Gdirections objects using the method getRoute(i) however this method does not exist in any of the classes defined in any of the jar files.
Let me know if there is a way to obtain the distance of a route with some sample code, using the jar files( I may have overlooked at them), without using javascript. What I want to be able to do in google maps is input a file with a bunch of addresses and outputing a distance output for all possible combinations among the addresses.
For example:
Input File
---------------------
"address 1"
"address 2"
....
...
...
....
...
"address n"
--------------------
Output file
---------------
distance bet. "address 1" and "address 2" ---d12 meters
distance bet. "address 1" and "address 3" ---d13 meters
......
....
distance bet."address 1" and "address n" ---d1n meters
distance bet. "address2" and "address3" ----- d23 meters
distance bet. "address 2" and "address 4" ---d24 meters
....
...
distance bet. "address 2" and "address n"---d2n meters
....
...
...
distance bet. "address n-1" and "address n"---dn-1,n meters