On Fri, Dec 19, 2008 at 12:10 PM, prad <pradnyas...@gmail.com> wrote:

>
> Eric,
> I got it to work. i just did a clean build and compiled and it seemed
> to resolve the issue.


I'm glad you found a solution!


>
> I have one other question. With loadFromWaypoints () the map shows
> markers for every waypoint. is there a way to avoid all markers except
> for the start and end?


Yes, you can do something similar to this snippet:

    DirectionQueryOptions dirOptions = new DirectionQueryOptions();
    dirOptions.setRetrievePolyline(true);
    dirOptions.setRetrieveSteps(true);
    Directions.load(
        "from:here, usa to:there, india",
        dirOptions, new DirectionsCallback() {

          public void onFailure(int statusCode) {
            Window.alert("Query failed: " + statusCode + " "
                + StatusCodes.getName(statusCode));
          }

          public void onSuccess(DirectionResults result) {
            map.addOverlay(result.getPolyline());
          }
        });
     }

Then, you can also retrieve the 2 endpoints from the DirectionsResult object
and create markers for them.


> Thanks
> Pradnya
>
> On Dec 19, 8:33 am, Eric Ayers <zun...@google.com> wrote:
> > I've written 3 new unit tests and have been unable to reproduce the
> > problem from here.
> >
> >
> >
> > On Fri, Dec 19, 2008 at 7:17 AM, Eric Ayers <zun...@google.com> wrote:
> > > Yes, the code that is published as a sample app on the public site
> still
> > > works, as does my current project.  Can you run theDirectionsexamples
> at:
> >
> > >  http://gwt.google.com/samples/HelloMaps-1.0.2/HelloMaps.html
> >
> > > Could it be that you are runningDirections.load() more than once in
> > > parallel?  Only one is supposed to be active at a time (I see that the
> > > javadoc does not reflect that.)  I just added a unit test that tests
> it.
> >
> > > Also, if you are running the test from outside the US, that might make
> a
> > > difference.  I believe that the geocoding tries to take into account
> your
> > > location when performing the query)  Try adding 'USA' to the end of the
> > > from: and to: query parameters.
> >
> > > If you are still having trouble running gwt-maps-1.0.2, could you post
> the
> > > stack trace again?
> >
> > > On Thu, Dec 18, 2008 at 9:43 PM, prad <pradnyas...@gmail.com> wrote:
> >
> > >> I still get the same error. are you able to run your code fine?
> >
> > >> On Dec 18, 2:49 pm, prad <pradnyas...@gmail.com> wrote:
> > >> > let me try and get back to you.. but meanwhile if you get to the
> > >> > solution i would appreciate it!
> >
> > >> > thanks!
> >
> > >> > On Dec 18, 2:36 pm, Eric Ayers <zun...@google.com> wrote:
> >
> > >> > > The stack trace you pasted last time pointed to a comment in this
> > >> > > file,
> > >> > > which is why I suspected a version change might fix it.
> >
> > >> > > I just checked the online demo:
> >
> > >> > > >
> http://gwt.google.com/samples/HelloMaps-1.0.2/HelloMaps.html#Simple%2...
> >
> > >> > > And geocoding/directionsstill works there.  I'm working on another
> > >> > > piece of
> > >> > > code that is similar, but creates DirectionsQueryOptions() with no
> > >> > > arguments.  The difference between these 2 and your example is
> that
> > >> > > you are
> > >> > > using the constructor that takes one Map argument.  Could you try
> > >> > > changing
> > >> > > the way you use DirectionQueryOptions and see if makes a
> difference
> > >> > > for you?
> >
> > >> > > -Eric.
> >
> > >> > > On Thu, Dec 18, 2008 at 1:26 PM, prad <pradnyas...@gmail.com>
> wrote:
> >
> > >> > > > today morning i tried using the latest version and i still get
> hte
> > >> > > > same error. i looked up at their sample classes fordirectionsand
> > >> > > > nothing seems to be changed since the last version. am i missing
> > >> > > > something here?
> >
> > >> > > > On Dec 18, 1:01 pm, Eric Ayers <zun...@google.com> wrote:
> > >> > > > > The latest version of the Maps API library for GWT is 1.0.2
> and
> > >> > > > > has
> > >> > > > > modifications to theDirectionsclass since 1.0.0
> >
> > >> > > > > On Thu, Dec 18, 2008 at 10:06 AM, Pradnya Sute
> > >> > > > > <pradnyas...@gmail.com
> > >> > > > >wrote:
> >
> > >> > > > > > i am using gwt-maps api verison 1.0.0 and in the script tag.
> >
> > >> > > > > >     <script type="text/javascript" src="
> > >> > > >http://maps.google.com/maps?*gwt=1
> > >> > > > > > *&amp;file=api&amp;v=2&amp;key=<my key>></script>
> >
> > >> > > > > > On Thu, Dec 18, 2008 at 6:35 AM, Eric Ayers <
> zun...@google.com>
> > >> > > > > > wrote:
> >
> > >> > > > > >> Can you tell me which version of the Maps API you are
> loading
> > >> > > > > >> in the
> > >> > > > > >> <script> tag  and which version of the gwt-maps API you are
> > >> > > > > >> using?
> >
> > >> > > > > >> On Wed, Dec 17, 2008 at 5:48 PM, prad <
> pradnyas...@gmail.com>
> > >> > > > > >> wrote:
> >
> > >> > > > > >>> All, I get this error when trying toloaddirections. I
> tried
> > >> > > > > >>> using
> > >> > > > > >>> bothloadas well as loadFromWaypoints. I couldnt find a
> > >> > > > > >>> relevant
> > >> > > > post
> > >> > > > > >>> on the group so far. can someone help me here?
> >
> > >> > > > > >>> Here is my code:
> > >> > > > > >>>  map = new
> > >> > > > > >>> MapWidget(LatLng.newInstance(hotelBean.getHotelLat(),
> > >> > > > > >>> hotelBean.getHotelLng()), 13);
> > >> > > > > >>>    map.setHeight("400px");
> > >> > > > > >>>    map.setWidth("400px");
> > >> > > > > >>>    mapPanel.add(map);
> > >> > > > > >>>    mainPanel.add(mapPanel);
> >
> > >> > > > > >>>    DirectionQueryOptions opts = new
> > >> > > > > >>> DirectionQueryOptions(map);
> > >> > > > > >>>    String query = "from: 500 Memorial Dr, Cambridge, MA
> to: 4
> > >> > > > > >>> Yawkey
> > >> > > > > >>> Way, Boston, MA";
> > >> > > > > >>>    Directions.load(query , opts, new DirectionsCallback()
> {
> > >> > > > > >>>      public void onFailure(int statusCode) {
> > >> > > > > >>>        LogUtils.debug("Failed toloaddirections: Status ");
> > >> > > > > >>>        Window.alert("Failed toloaddirections: Status ");
> > >> > > > > >>>      }
> >
> > >> > > > > >>>      public void onSuccess(DirectionResults result) {
> > >> > > > > >>>        LogUtils.debug("Successfully loadeddirections.");
> > >> > > > > >>>      }
> > >> > > > > >>>    });
> >
> > >> > > > > >>> And below is the error
> >
> > >> > > > > >>> [ERROR] Uncaught exception escaped
> > >> > > > > >>> com.google.gwt.core.client.JavaScriptException:
> (TypeError):
> > >> > > > 'getStatus
> > >> > > > > >>> ()' is null or not an object
> > >> > > > > >>>  number: -2146823281
> > >> > > > > >>>  description: 'getStatus()' is null or not an object
> > >> > > > > >>>        at
> > >> > > > com.google.gwt.maps.client.impl.__DirectionsImplImpl.construct
> > >> > > > > >>> (Native Method)
> > >> > > > > >>>        at
> > >> > > > com.google.gwt.maps.client.geocode.Directions.createDirections
> > >> > > > > >>> (Directions.java:176)
> > >> > > > > >>>        at
> >
> > >> > > > > >>>
> com.google.gwt.maps.client.geocode.Directions.load(Directions.java:
> > >> > > > > >>> 57)
> > >> > > > > >>>        at
> >
> > >> > > >
> com.ihg.dec.apps.hi.gwt.hotel.client.navigation.HotelDetailDrivingDirectionsResultsView.addDrivingDirectionsMap
> > >> > > > > >>> (HotelDetailDrivingDirectionsResultsView.java:177)
> > >> > > > > >>>        at
> >
> > >> > > >
> com.ihg.dec.apps.hi.gwt.hotel.client.navigation.HotelDetailDrivingDirectionsResultsView.process
> > >> > > > > >>> (HotelDetailDrivingDirectionsResultsView.java:74)
> > >> > > > > >>>        at
> >
> > >> > > >
> com.ihg.dec.apps.hi.gwt.arch.navigation.AbstractEntryPoint.manageViewVisibility
> > >> > > > > >>> (AbstractEntryPoint.java:207)
> > >> > > > > >>>        at
> >
> > >> > > >
> com.ihg.dec.apps.hi.gwt.arch.navigation.AbstractEntryPoint.onHistoryChanged
> > >> > > > > >>> (AbstractEntryPoint.java:162)
> > >> > > > > >>>        at
> >
> > >> > > > > >>>
> com.google.gwt.user.client.impl.HistoryImpl.fireHistoryChangedImpl
> > >> > > > > >>> (HistoryImpl.java:56)
> > >> > > > > >>>        at
> com.google.gwt.user.client.impl.HistoryImpl.newItem
> > >> > > > > >>> (HistoryImpl.java:103)
> > >> > > > > >>>        at
> > >> > > > com.google.gwt.user.client.History.newItem(History.java:149)
> > >> > > > > >>>        at
> > >> > > > com.google.gwt.user.client.History.newItem(History.java:132)
> > >> > > > > >>>        at
> >
> > >> > > >
> com.ihg.dec.apps.hi.gwt.hotel.client.widgets.hoteldetail.directions.HotelDetailCustomDrivingDirectionsFormWidget
> >
> > >> > > > > >>>
> $1.onSuccess(HotelDetailCustomDrivingDirectionsFormWidget.java:193)
> > >> > > > > >>>        at
> >
> > >> > > >
> com.ihg.dec.apps.hi.gwt.hotel.client.widgets.hoteldetail.directions.HotelDetailCustomDrivingDirectionsFormWidget
> >
> > >> > > > > >>>
> $1.onSuccess(HotelDetailCustomDrivingDirectionsFormWidget.java:1)
> > >> > > > > >>>        at
> >
> > >> > > >
> com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived
> > >> > > > > >>> (RequestCallbackAdapter.java:215)
> > >> > > > > >>>        at
> > >> > > > com.google.gwt.http.client.Request.fireOnResponseReceivedImpl
> > >> > > > > >>> (Request.java:254)
> > >> > > > > >>>        at
> >
> > >> > > > > >>>
> com.google.gwt.http.client.Request.fireOnResponseReceivedAndCatch
> > >> > > > > >>> (Request.java:226)
> > >> > > > > >>>        at
> > >> > > > > >>> com.google.gwt.http.client.Request.fireOnResponseReceived
> > >> > > > > >>> (Request.java:217
> >
> > >> > > > > >> --
> > >> > > > > >> Eric Z. Ayers - GWT Team - Atlanta, GA USA
> > >> > > > > >>http://code.google.com/webtoolkit/
> >
> > >> > > > > --
> > >> > > > > Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://
> > >> > > > code.google.com/webtoolkit/
> >
> > >> > > --
> > >> > > Eric Z. Ayers - GWT Team - Atlanta, GA
> > >> > > USAhttp://code.google.com/webtoolkit/
> >
> > > --
> > > Eric Z. Ayers - GWT Team - Atlanta, GA USA
> > >http://code.google.com/webtoolkit/
> >
> > --
> > Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://
> code.google.com/webtoolkit/
> >
>


-- 
Eric Z. Ayers - GWT Team - Atlanta, GA USA
http://code.google.com/webtoolkit/

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to Google-Web-Toolkit@googlegroups.com
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to