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 006 /** 007 * The directions response retrieved from the directions server. You can render these using a DirectionsRenderer or parse this object and render it yourself. You must display the warnings and copyrights as noted in the Maps API terms of service. Note that though this result is "JSON-like," it is not strictly JSON, as it indirectly includes LatLng objects. 008 * <br><br> 009 * See <a href="https://developers.google.com/maps/documentation/javascript/reference#DirectionsResult">DirectionsResult API Doc</a> 010 */ 011 public class DirectionsResult extends JavaScriptObject { 012 013 /** 014 * use newInstance(); 015 */ 016 protected DirectionsResult() {} 017 018 /** 019 * An array of DirectionsRoutes, each of which contains information about the legs and steps of which it is composed. There will only be one route unless the DirectionsRequest was made with provideRouteAlternatives set to true. (This property was formerly known as "trips".) 020 */ 021 public static final DirectionsResult newInstance() { 022 return JavaScriptObject.createObject().cast(); 023 } 024 025 /** 026 * An array of DirectionsRoutes, each of which contains information about the legs and steps of which it is composed. There will only be one route unless the DirectionsRequest was made with provideRouteAlternatives set to true. (This property was formerly known as "trips".) 027 * @param routes 028 */ 029 public final native void setRoutes(JsArray<DirectionsRoute> routes) /*-{ 030 this.routes = routes; 031 }-*/; 032 033 /** 034 * An array of DirectionsRoutes, each of which contains information about the legs and steps of which it is composed. There will only be one route unless the DirectionsRequest was made with provideRouteAlternatives set to true. (This property was formerly known as "trips".) 035 */ 036 public final native JsArray<DirectionsRoute> getRoutes() /*-{ 037 return this.routes; 038 }-*/; 039 040 }