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.core.client.JsArrayInteger; 006 import com.google.gwt.core.client.JsArrayString; 007 import com.google.gwt.maps.client.base.LatLng; 008 import com.google.gwt.maps.client.base.LatLngBounds; 009 010 /** 011 * A single route containing a set of legs in a DirectionsResult. (This object was formerly known as "DirectionsTrip".) Note that though this object is "JSON-like," it is not strictly JSON, as it directly and indirectly includes LatLng objects. 012 * <br><br> 013 * See <a href="https://developers.google.com/maps/documentation/javascript/reference#DirectionsRoute">DirectionsRoute API Doc</a> 014 */ 015 public class DirectionsRoute extends JavaScriptObject { 016 017 /** 018 * use newInstance(); 019 */ 020 protected DirectionsRoute() {} 021 022 /** 023 * A single route containing a set of legs in a DirectionsResult. (This object was formerly known as "DirectionsTrip".) Note that though this object is "JSON-like," it is not strictly JSON, as it directly and indirectly includes LatLng objects. 024 */ 025 public static final DirectionsRoute newInstance() { 026 return JavaScriptObject.createObject().cast(); 027 } 028 029 /** 030 * The bounds for this route. 031 * @param bounds 032 */ 033 public final native void setBounds(LatLngBounds bounds) /*-{ 034 this.bounds = bounds; 035 }-*/; 036 037 /** 038 * The bounds for this route. 039 */ 040 public final native LatLngBounds getBounds() /*-{ 041 return this.bounds; 042 }-*/; 043 044 /** 045 * Copyrights text to be displayed for this route. 046 * @param copyrights 047 */ 048 public final native void setCopyrights(String copyrights) /*-{ 049 this.copyrights = copyrights; 050 }-*/; 051 052 /** 053 * Copyrights text to be displayed for this route. 054 */ 055 public final native String getCopyrights() /*-{ 056 return this.copyrights; 057 }-*/; 058 059 /** 060 * An array of DirectionsLegs, each of which contains information about the steps of which it is composed. There will be one leg for each waypoint or destination specified. So a route with no waypoints will contain one DirectionsLeg and a route with one waypoint will contain two. (This property was formerly known as "routes".) 061 * @param legs 062 */ 063 public final native void setLegs(JsArray<DirectionsLeg> legs) /*-{ 064 this.legs = legs; 065 }-*/; 066 067 /** 068 * An array of DirectionsLegs, each of which contains information about the steps of which it is composed. There will be one leg for each waypoint or destination specified. So a route with no waypoints will contain one DirectionsLeg and a route with one waypoint will contain two. (This property was formerly known as "routes".) 069 */ 070 public final native JsArray<DirectionsLeg> getLegs() /*-{ 071 return this.legs; 072 }-*/; 073 074 /** 075 * An array of LatLngs representing the entire course of this route. The path is simplified in order to make it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs). 076 * @param overview_path 077 */ 078 public final native void setOverview_Path(JsArray<LatLng> overview_path) /*-{ 079 this.overview_path = overview_path; 080 }-*/; 081 082 /** 083 * An array of LatLngs representing the entire course of this route. The path is simplified in order to make it suitable in contexts where a small number of vertices is required (such as Static Maps API URLs). 084 */ 085 public final native JsArray<LatLng> getOverview_Path() /*-{ 086 return this.overview_path; 087 }-*/; 088 089 /** 090 * Warnings to be displayed when showing these directions. 091 * @param warnings 092 */ 093 public final native void setWarnings(JsArrayString warnings) /*-{ 094 this.warnings = warnings; 095 }-*/; 096 097 /** 098 * Warnings to be displayed when showing these directions. 099 */ 100 public final native JsArrayString getWarnings() /*-{ 101 return this.warnings; 102 }-*/; 103 104 /** 105 * If optimizeWaypoints was set to true, this field will contain the re-ordered permutation of the input waypoints. For example, if the input was: 106 Origin: Los Angeles 107 Waypoints: Dallas, Bangor, Phoenix 108 Destination: New York 109 and the optimized output was ordered as follows: 110 Origin: Los Angeles 111 Waypoints: Phoenix, Dallas, Bangor 112 Destination: New York 113 then this field will be an Array containing the values [2, 0, 1]. Note that the numbering of waypoints is zero-based. 114 If any of the input waypoints has stopover set to false, this field will be empty, since route optimization is not available for such queries. 115 * @param waypoint_order 116 */ 117 public final native void setWayPoint_Order(JsArrayInteger waypoint_order) /*-{ 118 this.waypoint_order = waypoint_order; 119 }-*/; 120 121 /** 122 * If optimizeWaypoints was set to true, this field will contain the re-ordered permutation of the input waypoints. For example, if the input was: 123 Origin: Los Angeles 124 Waypoints: Dallas, Bangor, Phoenix 125 Destination: New York 126 and the optimized output was ordered as follows: 127 Origin: Los Angeles 128 Waypoints: Phoenix, Dallas, Bangor 129 Destination: New York 130 then this field will be an Array containing the values [2, 0, 1]. Note that the numbering of waypoints is zero-based. 131 If any of the input waypoints has stopover set to false, this field will be empty, since route optimization is not available for such queries. 132 */ 133 public final native JsArrayInteger getWayPoint_Order() /*-{ 134 return this.waypoint_order; 135 }-*/; 136 137 }