001 package com.google.gwt.maps.client.services;
002
003 import com.google.gwt.core.client.JavaScriptObject;
004 import com.google.gwt.core.client.JsArray;
005 import com.google.gwt.maps.client.base.LatLng;
006
007 /**
008 * A single DirectionsStep in a DirectionsResult. Some fields may be undefined. Note that though this object is "JSON-like," it is not strictly JSON, as it directly includes LatLng objects.
009 * <br><br>
010 * See <a href="https://developers.google.com/maps/documentation/javascript/reference#DirectionsStep">DirectionsStep API Doc</a>
011 */
012 public class DirectionsStep extends JavaScriptObject {
013
014 /**
015 * use newInstance();
016 */
017 protected DirectionsStep() {}
018
019 /**
020 * A single DirectionsStep in a DirectionsResult. Some fields may be undefined. Note that though this object is "JSON-like," it is not strictly JSON, as it directly includes LatLng objects.
021 */
022 public static final DirectionsStep newInstance() {
023 return JavaScriptObject.createObject().cast();
024 }
025
026 /**
027 * The distance covered by this step. This property may be undefined as the distance may be unknown.
028 * @param distance
029 */
030 public final native void setDistance(Distance distance) /*-{
031 this.distance = distance;
032 }-*/;
033
034 /**
035 * The distance covered by this step. This property may be undefined as the distance may be unknown.
036 */
037 public final native Distance getDistance() /*-{
038 return this.distance;
039 }-*/;
040
041 /**
042 * The typical time required to perform this step in seconds and in text form. This property may be undefined as the duration may be unknown.
043 * @param duration
044 */
045 public final native void setDuration(Duration duration) /*-{
046 this.duration = duration;
047 }-*/;
048
049 /**
050 * The typical time required to perform this step in seconds and in text form. This property may be undefined as the duration may be unknown.
051 */
052 public final native Duration getDuration() /*-{
053 return this.duration;
054 }-*/;
055
056 /**
057 * The ending location of this step.
058 * @param end_location
059 */
060 public final native void setEnd_Location(LatLng end_location) /*-{
061 this.end_location = end_location;
062 }-*/;
063
064 /**
065 * The ending location of this step.
066 */
067 public final native LatLng getEnd_Location() /*-{
068 return this.end_location;
069 }-*/;
070
071 /**
072 * Instructions for this step.
073 * @param instructions
074 */
075 public final native void setInstructions(String instructions) /*-{
076 this.instructions = instructions;
077 }-*/;
078
079 /**
080 * Instructions for this step.
081 */
082 public final native String getInstructions() /*-{
083 return this.instructions;
084 }-*/;
085
086 /**
087 * A sequence of LatLngs describing the course of this step.
088 * @param path
089 */
090 public final native void setPath(JsArray<LatLng> path) /*-{
091 this.path = path;
092 }-*/;
093
094 /**
095 * A sequence of LatLngs describing the course of this step.
096 */
097 public final native JsArray<LatLng> getPath() /*-{
098 return this.path;
099 }-*/;
100
101 /**
102 * The starting location of this step.
103 * @param start_location
104 */
105 public final native void setStart_Location(LatLng start_location) /*-{
106 this.start_location = start_location;
107 }-*/;
108
109 /**
110 * The starting location of this step.
111 */
112 public final native LatLng getStart_Location() /*-{
113 return this.start_location;
114 }-*/;
115
116 /**
117 * The mode of travel used in this step.
118 * @param travel_mode
119 */
120 public final void setTravel_Mode(TravelMode travel_mode) {
121 setTravel_ModeImpl(travel_mode.value());
122 }
123
124 private final native void setTravel_ModeImpl(String travel_mode) /*-{
125 this.travel_mode = travel_mode;
126 }-*/;
127
128 /**
129 * The mode of travel used in this step.
130 */
131 public final TravelMode getTravelMode() {
132 return TravelMode.fromValue(getTravel_ModeImpl());
133 }
134
135 private final native String getTravel_ModeImpl() /*-{
136 return this.travel_mode;
137 }-*/;
138
139 }