com.google.gwt.maps.client.geocode
Class DirectionQueryOptions

java.lang.Object
  extended by com.google.gwt.maps.client.geocode.DirectionQueryOptions

public final class DirectionQueryOptions
extends java.lang.Object

A class that stores parameters used to create a new instance of the Directions object.


Nested Class Summary
static class DirectionQueryOptions.TravelMode
          Constant values used for setting the mode of travel for retrieving directions.
 
Constructor Summary
DirectionQueryOptions()
          Create an options object with default parameters.
DirectionQueryOptions(MapWidget map)
          Create an options object with default parameters associated with a particular map.
DirectionQueryOptions(MapWidget map, DirectionsPanel panel)
          Create an options object with default parameters associated with a particular map and a panel to put the textual directions in.
 
Method Summary
 void setAvoidHighways(boolean avoid)
          If true directions will attempt to exclude highways when computing directions.
 void setLocale(java.lang.String locale)
          The locale to use for the directions result.
 void setPreserveViewport(boolean preserveViewport)
          By default, when a Directions object has a map, the map is centered and zoomed to the bounding box of the the directions result.
 void setRetrievePolyline(boolean retrievePolyline)
          By default, the Directions.load*() methods fetch polyline data only if a map is attached to the Directions object.
 void setRetrieveSteps(boolean retrieveSteps)
          By default, the Directions.load*() methods fetch steps data only if a panel is attached to the Directions object.
 void setTravelMode(DirectionQueryOptions.TravelMode mode)
          The mode of travel, such as driving (default) or walking.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectionQueryOptions

public DirectionQueryOptions()
Create an options object with default parameters.


DirectionQueryOptions

public DirectionQueryOptions(MapWidget map)
Create an options object with default parameters associated with a particular map.

Parameters:
map - the map to draw directions on.

DirectionQueryOptions

public DirectionQueryOptions(MapWidget map,
                             DirectionsPanel panel)
Create an options object with default parameters associated with a particular map and a panel to put the textual directions in.

Parameters:
map -
panel -
Method Detail

setAvoidHighways

public void setAvoidHighways(boolean avoid)
If true directions will attempt to exclude highways when computing directions. Note that directions may still include highways if there are no viable alternatives.


setLocale

public void setLocale(java.lang.String locale)
The locale to use for the directions result. For example, "en_US", "fr", "fr_CA", etc.

Parameters:
locale - the locale to use for directions results.

setPreserveViewport

public void setPreserveViewport(boolean preserveViewport)
By default, when a Directions object has a map, the map is centered and zoomed to the bounding box of the the directions result. When this option is set to true, the viewport is left alone for this request.

Parameters:
preserveViewport - pass true to leave alone the viewport (do not center).

setRetrievePolyline

public void setRetrievePolyline(boolean retrievePolyline)
By default, the Directions.load*() methods fetch polyline data only if a map is attached to the Directions object. This field can be used to override this behavior and retrieve polyline data even when a map is not attached to the Directions object.

Parameters:
retrievePolyline - pass true to retrieve polyline data even when a map is not attached to the Directions object.

setRetrieveSteps

public void setRetrieveSteps(boolean retrieveSteps)
By default, the Directions.load*() methods fetch steps data only if a panel is attached to the Directions object. This field can be used to override this behavior and retrieve steps data even when a panel is not attached to the Directions object.

Parameters:
retrieveSteps - pass true to retrieve steps data even when a panel is not attached to the Directions object.

setTravelMode

public void setTravelMode(DirectionQueryOptions.TravelMode mode)
The mode of travel, such as driving (default) or walking. Note that if you specify walking directions, you will need to specify a <div> panel to hold a warning notice to users.

Parameters:
mode - the mode of travel.