make DirectionsTravelMode.Driving/Walking static ?

48 views
Skip to first unread message

pef

unread,
Nov 4, 2010, 1:55:25 PM11/4/10
to gwt-maps3-discuss
Hello,

I have a suggestion for the API : can the two methods
DirectionsTravelMode.Driving() and ...Walking() be made static ?

Indeed, unless I missed something, I need to do the following whenever
I want to build a DirectionsRequest instance :

DirectionsTravelMode l_travel_mode = new
DirectionsTravelMode();
DirectionsRequest l_request = new DirectionsRequest();
l_request.setOriginLatLng(...);
l_request.setDestinationLatLng(...);
l_request.setTravelMode(l_travel_mode.Driving());

If they were static, this would spare me the local variable
instanciation, and I could just say :
l_request.setTravelMode(DirectionsTravelMode.Driving());

-- pef

Vinay

unread,
Nov 4, 2010, 11:07:55 PM11/4/10
to pef, gwt-maps3-discuss
Pef, this looks reasonable. We are in process of changing design of the GWT api, moving from JS interop to simple overlays. So I recommend not to write anything serious using existing api. But I would always appreciate people try it out and send me valuable feedback(like this one :).

Thanks!
--
Vinay
Reply all
Reply to author
Forward
0 new messages