yes, it worked!
I had not looked in the deep the DirectionsCallBack and
DirectionResult api .
This is my solution:

DirectionsCallback callback=new DirectionsCallback(){
                @Override
                public void onFailure(int statusCode) {
                        Window.alert(""+statusCode);
                }
                @Override
                public void onSuccess(DirectionResults result) {
                        Polyline poly=result.getPolyline();
                        PolyStyleOptions options=PolyStyleOptions.getInstance();
                        options.setColor("00D600");
                        poly.setStrokeStyle(options);
                }

        };

Directions.load("from: lugano to: zurich",new DirectionQueryOptions
(map),callback);


-------------------------------------




Thank you Eric.



On 21 Giu, 04:25, Eric Ayers <[email protected]> wrote:
> Ok.  It is more work to set it up and add the items to the map, but if you
> look at the DirectionsResult object and the corresponding classes to create
> a directions query, you'll see that there is an option to return the
> polyline object.  You can set the style on that object to change its color
> and then manually add it to the map.
>
>
>
> On Fri, Jun 19, 2009 at 1:55 PM, Enea <[email protected]> wrote:
>
> > Hi Eric,
> > thank you for your answare.
>
> > I 've tried what you tell me, but setting a style to a
> > DirectionsPanel ,only affects the Panel where the textual directions
> > are listed.
>
> > My purpose was another:
> > change the color of the tour on the map.
> > The default color is purple:
>
> > for example:
>
> >http://maps.google.com/maps?f=q&source=s_q&hl=it&geocode=&q=da+giubia...
>
> > if you open this map, you see that the color of the street to do, is
> > purple...
> > It's possible to change this color?
>
> > On 19 Giu, 13:33, Eric Ayers <[email protected]> wrote:
> > > I think you could do this with CSS.  Put a style on your DirectionsPanel
> > with
>
> > > directionsPanel1.setStyleName("directions1");
> > > directionsPanel2.setStyleName("directions2");
>
> > > .css file:
>
> > > .directions1 {
> > >   background-color: #eee;}
>
> > > .directions2 {
> > >   background-color: #fee;
>
> > > }
>
> > > Or, if you wanted to affect some elements specifically in a different
> > > way, you could use CSS descendent selectors:
>
> > > .directions1 td {
> > >   color: red;
>
> > > }
>
> > > .directions2 td {
> > >   color: green;
>
> > > }
>
> > > Look at the DOM using firebug or another tool to see which elements
> > > and classnames are are defined inside the Directions Panel.
>
> > > -Eric
>
> > > On Thu, Jun 18, 2009 at 7:03 PM, Enea<[email protected]> wrote:
>
> > > > hi,
> > > > This is my first post here... :)
> > > > My question is if there is a way to change the color of Directions
> > > > shown on a Map with the gwt-maps api.
> > > > I have searched in the api but not found...
> > > > my problem is that i have to display more than one "tour", and it
> > > > would be nice to show these tours in different colors.
>
> > > > Thanks in advance :)
>
> > > > ---gwt|rocks---
>
> > > --
> > > Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://
> > code.google.com/webtoolkit/
>
> --
> Eric Z. Ayers - GWT Team - Atlanta, GA USAhttp://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 [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to